From c70fdf599b0b8322c2733118690aed8cf2c711dd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 17 Nov 2020 03:28:06 -0800 Subject: [PATCH] feat: Automated regeneration of securitycenter v1 client (#1542) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2020-11-17 03:14:05,382 synthtool [DEBUG] > Executing /home/kbuilder/.cache/synthtool/google-api-ruby-client/synth.py. On branch autosynth-securitycenter-v1 nothing to commit, working tree clean 2020-11-17 03:14:05,413 synthtool [DEBUG] > Running: docker run --rm -v/home/kbuilder/.cache/synthtool/google-api-ruby-client:/workspace -v/var/run/docker.sock:/var/run/docker.sock -w /workspace --entrypoint script/synth.rb gcr.io/cloud-devrel-kokoro-resources/yoshi-ruby/autosynth securitycenter v1 DEBUG:synthtool:Running: docker run --rm -v/home/kbuilder/.cache/synthtool/google-api-ruby-client:/workspace -v/var/run/docker.sock:/var/run/docker.sock -w /workspace --entrypoint script/synth.rb gcr.io/cloud-devrel-kokoro-resources/yoshi-ruby/autosynth securitycenter v1 bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. The dependency jruby-openssl (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for java. To add those platforms to the bundle, run `bundle lock --add-platform java`. Fetching gem metadata from https://rubygems.org/......... Fetching gem metadata from https://rubygems.org/. Resolving dependencies... Fetching rake 11.3.0 Installing rake 11.3.0 Fetching concurrent-ruby 1.1.7 Installing concurrent-ruby 1.1.7 Fetching i18n 1.8.5 Installing i18n 1.8.5 Fetching minitest 5.14.2 Installing minitest 5.14.2 Fetching thread_safe 0.3.6 Installing thread_safe 0.3.6 Fetching tzinfo 1.2.8 Installing tzinfo 1.2.8 Fetching activesupport 5.0.7.2 Installing activesupport 5.0.7.2 Fetching public_suffix 4.0.6 Installing public_suffix 4.0.6 Fetching addressable 2.7.0 Installing addressable 2.7.0 Fetching ast 2.4.1 Installing ast 2.4.1 Using bundler 2.1.4 Fetching byebug 11.1.3 Installing byebug 11.1.3 with native extensions Fetching coderay 1.1.3 Installing coderay 1.1.3 Fetching json 2.3.1 Installing json 2.3.1 with native extensions Fetching docile 1.3.2 Installing docile 1.3.2 Fetching simplecov-html 0.10.2 Installing simplecov-html 0.10.2 Fetching simplecov 0.16.1 Installing simplecov 0.16.1 Using sync 0.5.0 Fetching tins 1.26.0 Installing tins 1.26.0 Fetching term-ansicolor 1.7.1 Installing term-ansicolor 1.7.1 Fetching thor 0.20.3 Installing thor 0.20.3 Fetching coveralls 0.8.23 Installing coveralls 0.8.23 Fetching crack 0.4.4 Installing crack 0.4.4 Fetching declarative 0.0.20 Installing declarative 0.0.20 Fetching declarative-option 0.1.0 Installing declarative-option 0.1.0 Fetching diff-lcs 1.4.4 Installing diff-lcs 1.4.4 Fetching dotenv 2.7.6 Installing dotenv 2.7.6 Fetching fakefs 0.20.1 Installing fakefs 0.20.1 Fetching multipart-post 2.1.1 Installing multipart-post 2.1.1 Fetching ruby2_keywords 0.0.2 Installing ruby2_keywords 0.0.2 Fetching faraday 1.1.0 Installing faraday 1.1.0 Fetching gems 1.2.0 Installing gems 1.2.0 Fetching github-markup 1.7.0 Installing github-markup 1.7.0 Fetching jwt 2.2.2 Installing jwt 2.2.2 Fetching memoist 0.16.2 Installing memoist 0.16.2 Fetching multi_json 1.15.0 Installing multi_json 1.15.0 Fetching os 0.9.6 Installing os 0.9.6 Fetching signet 0.14.0 Installing signet 0.14.0 Fetching googleauth 0.14.0 Installing googleauth 0.14.0 Fetching httpclient 2.8.3 Installing httpclient 2.8.3 Fetching mini_mime 1.0.2 Installing mini_mime 1.0.2 Fetching uber 0.1.0 Installing uber 0.1.0 Fetching representable 3.0.4 Installing representable 3.0.4 Fetching retriable 3.1.2 Installing retriable 3.1.2 Fetching rexml 3.2.4 Installing rexml 3.2.4 Using google-api-client 0.50.0 from source at `.` Fetching google-id-token 1.4.2 Installing google-id-token 1.4.2 Fetching hashdiff 1.0.1 Installing hashdiff 1.0.1 Fetching mime-types-data 3.2020.1104 Installing mime-types-data 3.2020.1104 Fetching mime-types 3.3.1 Installing mime-types 3.3.1 Fetching multi_xml 0.6.0 Installing multi_xml 0.6.0 Fetching httparty 0.18.1 Installing httparty 0.18.1 Fetching rspec-support 3.10.0 Installing rspec-support 3.10.0 Fetching rspec-core 3.10.0 Installing rspec-core 3.10.0 Fetching rspec-expectations 3.10.0 Installing rspec-expectations 3.10.0 Fetching rspec-mocks 3.10.0 Installing rspec-mocks 3.10.0 Fetching rspec 3.10.0 Installing rspec 3.10.0 Fetching json_spec 1.1.5 Installing json_spec 1.1.5 Fetching launchy 2.5.0 Installing launchy 2.5.0 Fetching little-plugger 1.1.4 Installing little-plugger 1.1.4 Fetching logging 2.3.0 Installing logging 2.3.0 Fetching method_source 1.0.0 Installing method_source 1.0.0 Fetching opencensus 0.5.0 Installing opencensus 0.5.0 Fetching parallel 1.20.0 Installing parallel 1.20.0 Fetching parser 2.7.2.0 Installing parser 2.7.2.0 Fetching powerpack 0.1.3 Installing powerpack 0.1.3 Fetching pry 0.13.1 Installing pry 0.13.1 Fetching pry-byebug 3.9.0 Installing pry-byebug 3.9.0 Fetching yard 0.9.25 Installing yard 0.9.25 Fetching pry-doc 0.13.5 Installing pry-doc 0.13.5 Fetching rainbow 2.2.2 Installing rainbow 2.2.2 with native extensions Fetching redcarpet 3.5.0 Installing redcarpet 3.5.0 with native extensions Fetching redis 3.3.5 Installing redis 3.3.5 Fetching rmail 1.1.4 Installing rmail 1.1.4 Fetching ruby-progressbar 1.10.1 Installing ruby-progressbar 1.10.1 Fetching unicode-display_width 1.7.0 Installing unicode-display_width 1.7.0 Fetching rubocop 0.49.1 Installing rubocop 0.49.1 Fetching webmock 2.3.2 Installing webmock 2.3.2 Bundle complete! 31 Gemfile dependencies, 78 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from i18n: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. But that may break your application. If you are upgrading your Rails application from an older version of Rails: Please check your Rails app for 'config.i18n.fallbacks = true'. If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be 'config.i18n.fallbacks = [I18n.default_locale]'. If not, fallbacks will be broken in your app by I18n 1.1.x. If you are starting a NEW Rails application, you can ignore this notice. For more info see: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 Post-install message from httparty: When you HTTParty, you must party hard! echo a | bundle exec bin/generate-api gen generated --api=securitycenter.v1 --names-out=/workspace/api_names_out.yaml Loading securitycenter, version v1 from https://raw.githubusercontent.com/googleapis/discovery-artifact-manager/master/discoveries/securitycenter.v1.json conflict google/apis/securitycenter_v1.rb Wrote metadata to generated/google/apis/securitycenter_v1/synth.metadata. DEBUG:synthtool:Wrote metadata to generated/google/apis/securitycenter_v1/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/7e06f273-92b4-427a-ba27-5b49afa0b082/targets - [ ] To automatically regenerate this PR, check this box. --- api_names_out.yaml | 94 + generated/google/apis/securitycenter_v1.rb | 2 +- .../google/apis/securitycenter_v1/classes.rb | 91 + .../apis/securitycenter_v1/representations.rb | 37 + .../google/apis/securitycenter_v1/service.rb | 1862 +++++++++++++---- .../apis/securitycenter_v1/synth.metadata | 2 +- 6 files changed, 1672 insertions(+), 416 deletions(-) diff --git a/api_names_out.yaml b/api_names_out.yaml index cf18fa9def0..c762d5948ad 100644 --- a/api_names_out.yaml +++ b/api_names_out.yaml @@ -132886,6 +132886,8 @@ "/securitycenter:v1/Asset/securityMarks": security_marks "/securitycenter:v1/Asset/updateTime": update_time "/securitycenter:v1/AssetDiscoveryConfig": asset_discovery_config +"/securitycenter:v1/AssetDiscoveryConfig/folderIds": folder_ids +"/securitycenter:v1/AssetDiscoveryConfig/folderIds/folder_id": folder_id "/securitycenter:v1/AssetDiscoveryConfig/inclusionMode": inclusion_mode "/securitycenter:v1/AssetDiscoveryConfig/projectIds": project_ids "/securitycenter:v1/AssetDiscoveryConfig/projectIds/project_id": project_id @@ -132921,6 +132923,9 @@ "/securitycenter:v1/Finding/sourceProperties": source_properties "/securitycenter:v1/Finding/sourceProperties/source_property": source_property "/securitycenter:v1/Finding/state": state +"/securitycenter:v1/Folder": folder +"/securitycenter:v1/Folder/resourceFolder": resource_folder +"/securitycenter:v1/Folder/resourceFolderDisplayName": resource_folder_display_name "/securitycenter:v1/GetIamPolicyRequest": get_iam_policy_request "/securitycenter:v1/GetIamPolicyRequest/options": options "/securitycenter:v1/GetPolicyOptions": get_policy_options @@ -132930,6 +132935,8 @@ "/securitycenter:v1/GoogleCloudSecuritycenterV1NotificationMessage/notificationConfigName": notification_config_name "/securitycenter:v1/GoogleCloudSecuritycenterV1NotificationMessage/resource": resource "/securitycenter:v1/GoogleCloudSecuritycenterV1Resource": google_cloud_securitycenter_v1_resource +"/securitycenter:v1/GoogleCloudSecuritycenterV1Resource/folders": folders +"/securitycenter:v1/GoogleCloudSecuritycenterV1Resource/folders/folder": folder "/securitycenter:v1/GoogleCloudSecuritycenterV1Resource/name": name "/securitycenter:v1/GoogleCloudSecuritycenterV1Resource/parent": parent "/securitycenter:v1/GoogleCloudSecuritycenterV1Resource/parentDisplayName": parent_display_name @@ -132963,6 +132970,9 @@ "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Finding/sourceProperties": source_properties "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Finding/sourceProperties/source_property": source_property "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Finding/state": state +"/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Folder": google_cloud_securitycenter_v1p1beta1_folder +"/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Folder/resourceFolder": resource_folder +"/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Folder/resourceFolderDisplayName": resource_folder_display_name "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1IamPolicy": google_cloud_securitycenter_v1p1beta1_iam_policy "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1IamPolicy/policyBlob": policy_blob "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1NotificationMessage": google_cloud_securitycenter_v1p1beta1_notification_message @@ -132971,6 +132981,8 @@ "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1NotificationMessage/resource": resource "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1NotificationMessage/temporalAsset": temporal_asset "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Resource": google_cloud_securitycenter_v1p1beta1_resource +"/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Resource/folders": folders +"/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Resource/folders/folder": folder "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Resource/name": name "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Resource/parent": parent "/securitycenter:v1/GoogleCloudSecuritycenterV1p1beta1Resource/parentDisplayName": parent_display_name @@ -133085,6 +133097,8 @@ "/securitycenter:v1/Policy/etag": etag "/securitycenter:v1/Policy/version": version "/securitycenter:v1/Resource": resource +"/securitycenter:v1/Resource/folders": folders +"/securitycenter:v1/Resource/folders/folder": folder "/securitycenter:v1/Resource/name": name "/securitycenter:v1/Resource/parentDisplayName": parent_display_name "/securitycenter:v1/Resource/parentName": parent_name @@ -133092,6 +133106,8 @@ "/securitycenter:v1/Resource/projectName": project_name "/securitycenter:v1/RunAssetDiscoveryRequest": run_asset_discovery_request "/securitycenter:v1/SecurityCenterProperties": security_center_properties +"/securitycenter:v1/SecurityCenterProperties/folders": folders +"/securitycenter:v1/SecurityCenterProperties/folders/folder": folder "/securitycenter:v1/SecurityCenterProperties/resourceDisplayName": resource_display_name "/securitycenter:v1/SecurityCenterProperties/resourceName": resource_name "/securitycenter:v1/SecurityCenterProperties/resourceOwners": resource_owners @@ -133132,6 +133148,45 @@ "/securitycenter:v1/fields": fields "/securitycenter:v1/key": key "/securitycenter:v1/quotaUser": quota_user +"/securitycenter:v1/securitycenter.folders.assets.group": group_folder_asset +"/securitycenter:v1/securitycenter.folders.assets.group/parent": parent +"/securitycenter:v1/securitycenter.folders.assets.list": list_folder_assets +"/securitycenter:v1/securitycenter.folders.assets.list/compareDuration": compare_duration +"/securitycenter:v1/securitycenter.folders.assets.list/fieldMask": field_mask +"/securitycenter:v1/securitycenter.folders.assets.list/filter": filter +"/securitycenter:v1/securitycenter.folders.assets.list/orderBy": order_by +"/securitycenter:v1/securitycenter.folders.assets.list/pageSize": page_size +"/securitycenter:v1/securitycenter.folders.assets.list/pageToken": page_token +"/securitycenter:v1/securitycenter.folders.assets.list/parent": parent +"/securitycenter:v1/securitycenter.folders.assets.list/readTime": read_time +"/securitycenter:v1/securitycenter.folders.assets.updateSecurityMarks": update_folder_asset_security_marks +"/securitycenter:v1/securitycenter.folders.assets.updateSecurityMarks/name": name +"/securitycenter:v1/securitycenter.folders.assets.updateSecurityMarks/startTime": start_time +"/securitycenter:v1/securitycenter.folders.assets.updateSecurityMarks/updateMask": update_mask +"/securitycenter:v1/securitycenter.folders.sources.findings.group": group_folder_source_finding +"/securitycenter:v1/securitycenter.folders.sources.findings.group/parent": parent +"/securitycenter:v1/securitycenter.folders.sources.findings.list": list_folder_source_findings +"/securitycenter:v1/securitycenter.folders.sources.findings.list/compareDuration": compare_duration +"/securitycenter:v1/securitycenter.folders.sources.findings.list/fieldMask": field_mask +"/securitycenter:v1/securitycenter.folders.sources.findings.list/filter": filter +"/securitycenter:v1/securitycenter.folders.sources.findings.list/orderBy": order_by +"/securitycenter:v1/securitycenter.folders.sources.findings.list/pageSize": page_size +"/securitycenter:v1/securitycenter.folders.sources.findings.list/pageToken": page_token +"/securitycenter:v1/securitycenter.folders.sources.findings.list/parent": parent +"/securitycenter:v1/securitycenter.folders.sources.findings.list/readTime": read_time +"/securitycenter:v1/securitycenter.folders.sources.findings.patch": patch_folder_source_finding +"/securitycenter:v1/securitycenter.folders.sources.findings.patch/name": name +"/securitycenter:v1/securitycenter.folders.sources.findings.patch/updateMask": update_mask +"/securitycenter:v1/securitycenter.folders.sources.findings.setState": set_folder_source_finding_state +"/securitycenter:v1/securitycenter.folders.sources.findings.setState/name": name +"/securitycenter:v1/securitycenter.folders.sources.findings.updateSecurityMarks": update_folder_source_finding_security_marks +"/securitycenter:v1/securitycenter.folders.sources.findings.updateSecurityMarks/name": name +"/securitycenter:v1/securitycenter.folders.sources.findings.updateSecurityMarks/startTime": start_time +"/securitycenter:v1/securitycenter.folders.sources.findings.updateSecurityMarks/updateMask": update_mask +"/securitycenter:v1/securitycenter.folders.sources.list": list_folder_sources +"/securitycenter:v1/securitycenter.folders.sources.list/pageSize": page_size +"/securitycenter:v1/securitycenter.folders.sources.list/pageToken": page_token +"/securitycenter:v1/securitycenter.folders.sources.list/parent": parent "/securitycenter:v1/securitycenter.organizations.assets.group": group_assets "/securitycenter:v1/securitycenter.organizations.assets.group/parent": parent "/securitycenter:v1/securitycenter.organizations.assets.list": list_organization_assets @@ -133219,6 +133274,45 @@ "/securitycenter:v1/securitycenter.organizations.updateOrganizationSettings": update_organization_organization_settings "/securitycenter:v1/securitycenter.organizations.updateOrganizationSettings/name": name "/securitycenter:v1/securitycenter.organizations.updateOrganizationSettings/updateMask": update_mask +"/securitycenter:v1/securitycenter.projects.assets.group": group_project_asset +"/securitycenter:v1/securitycenter.projects.assets.group/parent": parent +"/securitycenter:v1/securitycenter.projects.assets.list": list_project_assets +"/securitycenter:v1/securitycenter.projects.assets.list/compareDuration": compare_duration +"/securitycenter:v1/securitycenter.projects.assets.list/fieldMask": field_mask +"/securitycenter:v1/securitycenter.projects.assets.list/filter": filter +"/securitycenter:v1/securitycenter.projects.assets.list/orderBy": order_by +"/securitycenter:v1/securitycenter.projects.assets.list/pageSize": page_size +"/securitycenter:v1/securitycenter.projects.assets.list/pageToken": page_token +"/securitycenter:v1/securitycenter.projects.assets.list/parent": parent +"/securitycenter:v1/securitycenter.projects.assets.list/readTime": read_time +"/securitycenter:v1/securitycenter.projects.assets.updateSecurityMarks": update_project_asset_security_marks +"/securitycenter:v1/securitycenter.projects.assets.updateSecurityMarks/name": name +"/securitycenter:v1/securitycenter.projects.assets.updateSecurityMarks/startTime": start_time +"/securitycenter:v1/securitycenter.projects.assets.updateSecurityMarks/updateMask": update_mask +"/securitycenter:v1/securitycenter.projects.sources.findings.group": group_project_source_finding +"/securitycenter:v1/securitycenter.projects.sources.findings.group/parent": parent +"/securitycenter:v1/securitycenter.projects.sources.findings.list": list_project_source_findings +"/securitycenter:v1/securitycenter.projects.sources.findings.list/compareDuration": compare_duration +"/securitycenter:v1/securitycenter.projects.sources.findings.list/fieldMask": field_mask +"/securitycenter:v1/securitycenter.projects.sources.findings.list/filter": filter +"/securitycenter:v1/securitycenter.projects.sources.findings.list/orderBy": order_by +"/securitycenter:v1/securitycenter.projects.sources.findings.list/pageSize": page_size +"/securitycenter:v1/securitycenter.projects.sources.findings.list/pageToken": page_token +"/securitycenter:v1/securitycenter.projects.sources.findings.list/parent": parent +"/securitycenter:v1/securitycenter.projects.sources.findings.list/readTime": read_time +"/securitycenter:v1/securitycenter.projects.sources.findings.patch": patch_project_source_finding +"/securitycenter:v1/securitycenter.projects.sources.findings.patch/name": name +"/securitycenter:v1/securitycenter.projects.sources.findings.patch/updateMask": update_mask +"/securitycenter:v1/securitycenter.projects.sources.findings.setState": set_project_source_finding_state +"/securitycenter:v1/securitycenter.projects.sources.findings.setState/name": name +"/securitycenter:v1/securitycenter.projects.sources.findings.updateSecurityMarks": update_project_source_finding_security_marks +"/securitycenter:v1/securitycenter.projects.sources.findings.updateSecurityMarks/name": name +"/securitycenter:v1/securitycenter.projects.sources.findings.updateSecurityMarks/startTime": start_time +"/securitycenter:v1/securitycenter.projects.sources.findings.updateSecurityMarks/updateMask": update_mask +"/securitycenter:v1/securitycenter.projects.sources.list": list_project_sources +"/securitycenter:v1/securitycenter.projects.sources.list/pageSize": page_size +"/securitycenter:v1/securitycenter.projects.sources.list/pageToken": page_token +"/securitycenter:v1/securitycenter.projects.sources.list/parent": parent "/securitycenter:v1beta1/Asset": asset "/securitycenter:v1beta1/Asset/createTime": create_time "/securitycenter:v1beta1/Asset/name": name diff --git a/generated/google/apis/securitycenter_v1.rb b/generated/google/apis/securitycenter_v1.rb index c911ada07e5..d5b3ccc5518 100644 --- a/generated/google/apis/securitycenter_v1.rb +++ b/generated/google/apis/securitycenter_v1.rb @@ -26,7 +26,7 @@ module Apis # @see https://console.cloud.google.com/apis/api/securitycenter.googleapis.com/overview module SecuritycenterV1 VERSION = 'V1' - REVISION = '20201106' + REVISION = '20201112' # View and manage your data across Google Cloud Platform services AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform' diff --git a/generated/google/apis/securitycenter_v1/classes.rb b/generated/google/apis/securitycenter_v1/classes.rb index 052ab8ad5c6..e722f9a6bc4 100644 --- a/generated/google/apis/securitycenter_v1/classes.rb +++ b/generated/google/apis/securitycenter_v1/classes.rb @@ -95,6 +95,12 @@ def update!(**args) class AssetDiscoveryConfig include Google::Apis::Core::Hashable + # The folder ids to use for filtering asset discovery. It consists of only + # digits, e.g., 756619654966. + # Corresponds to the JSON property `folderIds` + # @return [Array] + attr_accessor :folder_ids + # The mode to use for filtering asset discovery. # Corresponds to the JSON property `inclusionMode` # @return [String] @@ -111,6 +117,7 @@ def initialize(**args) # Update properties of this object def update!(**args) + @folder_ids = args[:folder_ids] if args.key?(:folder_ids) @inclusion_mode = args[:inclusion_mode] if args.key?(:inclusion_mode) @project_ids = args[:project_ids] if args.key?(:project_ids) end @@ -428,6 +435,32 @@ def update!(**args) end end + # Message that contains the resource name and display name of a folder resource. + class Folder + include Google::Apis::Core::Hashable + + # Full resource name of this folder. See: https://cloud.google.com/apis/design/ + # resource_names#full_resource_name + # Corresponds to the JSON property `resourceFolder` + # @return [String] + attr_accessor :resource_folder + + # The user defined display name for this folder. + # Corresponds to the JSON property `resourceFolderDisplayName` + # @return [String] + attr_accessor :resource_folder_display_name + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @resource_folder = args[:resource_folder] if args.key?(:resource_folder) + @resource_folder_display_name = args[:resource_folder_display_name] if args.key?(:resource_folder_display_name) + end + end + # Request message for `GetIamPolicy` method. class GetIamPolicyRequest include Google::Apis::Core::Hashable @@ -511,6 +544,13 @@ def update!(**args) class GoogleCloudSecuritycenterV1Resource include Google::Apis::Core::Hashable + # 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. + # Corresponds to the JSON property `folders` + # @return [Array] + attr_accessor :folders + # The full resource name of the resource. See: https://cloud.google.com/apis/ # design/resource_names#full_resource_name # Corresponds to the JSON property `name` @@ -543,6 +583,7 @@ def initialize(**args) # Update properties of this object def update!(**args) + @folders = args[:folders] if args.key?(:folders) @name = args[:name] if args.key?(:name) @parent = args[:parent] if args.key?(:parent) @parent_display_name = args[:parent_display_name] if args.key?(:parent_display_name) @@ -706,6 +747,32 @@ def update!(**args) end end + # Message that contains the resource name and display name of a folder resource. + class GoogleCloudSecuritycenterV1p1beta1Folder + include Google::Apis::Core::Hashable + + # Full resource name of this folder. See: https://cloud.google.com/apis/design/ + # resource_names#full_resource_name + # Corresponds to the JSON property `resourceFolder` + # @return [String] + attr_accessor :resource_folder + + # The user defined display name for this folder. + # Corresponds to the JSON property `resourceFolderDisplayName` + # @return [String] + attr_accessor :resource_folder_display_name + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @resource_folder = args[:resource_folder] if args.key?(:resource_folder) + @resource_folder_display_name = args[:resource_folder_display_name] if args.key?(:resource_folder_display_name) + end + end + # Security Command Center's Notification class GoogleCloudSecuritycenterV1p1beta1NotificationMessage include Google::Apis::Core::Hashable @@ -744,6 +811,13 @@ def update!(**args) class GoogleCloudSecuritycenterV1p1beta1Resource include Google::Apis::Core::Hashable + # 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. + # Corresponds to the JSON property `folders` + # @return [Array] + attr_accessor :folders + # The full resource name of the resource. See: https://cloud.google.com/apis/ # design/resource_names#full_resource_name # Corresponds to the JSON property `name` @@ -776,6 +850,7 @@ def initialize(**args) # Update properties of this object def update!(**args) + @folders = args[:folders] if args.key?(:folders) @name = args[:name] if args.key?(:name) @parent = args[:parent] if args.key?(:parent) @parent_display_name = args[:parent_display_name] if args.key?(:parent_display_name) @@ -1641,6 +1716,13 @@ def update!(**args) class Resource include Google::Apis::Core::Hashable + # 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. + # Corresponds to the JSON property `folders` + # @return [Array] + attr_accessor :folders + # The full resource name of the resource. See: https://cloud.google.com/apis/ # design/resource_names#full_resource_name # Corresponds to the JSON property `name` @@ -1673,6 +1755,7 @@ def initialize(**args) # Update properties of this object def update!(**args) + @folders = args[:folders] if args.key?(:folders) @name = args[:name] if args.key?(:name) @parent_display_name = args[:parent_display_name] if args.key?(:parent_display_name) @parent_name = args[:parent_name] if args.key?(:parent_name) @@ -1699,6 +1782,13 @@ def update!(**args) class SecurityCenterProperties include Google::Apis::Core::Hashable + # 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. + # Corresponds to the JSON property `folders` + # @return [Array] + attr_accessor :folders + # The user defined display name for this resource. # Corresponds to the JSON property `resourceDisplayName` # @return [String] @@ -1751,6 +1841,7 @@ def initialize(**args) # Update properties of this object def update!(**args) + @folders = args[:folders] if args.key?(:folders) @resource_display_name = args[:resource_display_name] if args.key?(:resource_display_name) @resource_name = args[:resource_name] if args.key?(:resource_name) @resource_owners = args[:resource_owners] if args.key?(:resource_owners) diff --git a/generated/google/apis/securitycenter_v1/representations.rb b/generated/google/apis/securitycenter_v1/representations.rb index 609df0957b4..d52f0238ad0 100644 --- a/generated/google/apis/securitycenter_v1/representations.rb +++ b/generated/google/apis/securitycenter_v1/representations.rb @@ -70,6 +70,12 @@ class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end + class Folder + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class GetIamPolicyRequest class Representation < Google::Apis::Core::JsonRepresentation; end @@ -112,6 +118,12 @@ class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end + class GoogleCloudSecuritycenterV1p1beta1Folder + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class GoogleCloudSecuritycenterV1p1beta1NotificationMessage class Representation < Google::Apis::Core::JsonRepresentation; end @@ -323,6 +335,7 @@ class Representation < Google::Apis::Core::JsonRepresentation class AssetDiscoveryConfig # @private class Representation < Google::Apis::Core::JsonRepresentation + collection :folder_ids, as: 'folderIds' property :inclusion_mode, as: 'inclusionMode' collection :project_ids, as: 'projectIds' end @@ -388,6 +401,14 @@ class Representation < Google::Apis::Core::JsonRepresentation end end + class Folder + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :resource_folder, as: 'resourceFolder' + property :resource_folder_display_name, as: 'resourceFolderDisplayName' + end + end + class GetIamPolicyRequest # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -417,6 +438,8 @@ class Representation < Google::Apis::Core::JsonRepresentation class GoogleCloudSecuritycenterV1Resource # @private class Representation < Google::Apis::Core::JsonRepresentation + collection :folders, as: 'folders', class: Google::Apis::SecuritycenterV1::Folder, decorator: Google::Apis::SecuritycenterV1::Folder::Representation + property :name, as: 'name' property :parent, as: 'parent' property :parent_display_name, as: 'parentDisplayName' @@ -459,6 +482,14 @@ class Representation < Google::Apis::Core::JsonRepresentation end end + class GoogleCloudSecuritycenterV1p1beta1Folder + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :resource_folder, as: 'resourceFolder' + property :resource_folder_display_name, as: 'resourceFolderDisplayName' + end + end + class GoogleCloudSecuritycenterV1p1beta1NotificationMessage # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -473,6 +504,8 @@ class Representation < Google::Apis::Core::JsonRepresentation class GoogleCloudSecuritycenterV1p1beta1Resource # @private class Representation < Google::Apis::Core::JsonRepresentation + collection :folders, as: 'folders', class: Google::Apis::SecuritycenterV1::GoogleCloudSecuritycenterV1p1beta1Folder, decorator: Google::Apis::SecuritycenterV1::GoogleCloudSecuritycenterV1p1beta1Folder::Representation + property :name, as: 'name' property :parent, as: 'parent' property :parent_display_name, as: 'parentDisplayName' @@ -676,6 +709,8 @@ class Representation < Google::Apis::Core::JsonRepresentation class Resource # @private class Representation < Google::Apis::Core::JsonRepresentation + collection :folders, as: 'folders', class: Google::Apis::SecuritycenterV1::Folder, decorator: Google::Apis::SecuritycenterV1::Folder::Representation + property :name, as: 'name' property :parent_display_name, as: 'parentDisplayName' property :parent_name, as: 'parentName' @@ -693,6 +728,8 @@ class Representation < Google::Apis::Core::JsonRepresentation class SecurityCenterProperties # @private class Representation < Google::Apis::Core::JsonRepresentation + collection :folders, as: 'folders', class: Google::Apis::SecuritycenterV1::Folder, decorator: Google::Apis::SecuritycenterV1::Folder::Representation + property :resource_display_name, as: 'resourceDisplayName' property :resource_name, as: 'resourceName' collection :resource_owners, as: 'resourceOwners' diff --git a/generated/google/apis/securitycenter_v1/service.rb b/generated/google/apis/securitycenter_v1/service.rb index 1aa5a4b0007..0aaabbc4816 100644 --- a/generated/google/apis/securitycenter_v1/service.rb +++ b/generated/google/apis/securitycenter_v1/service.rb @@ -48,80 +48,10 @@ def initialize @batch_path = 'batch' end - # Gets the settings for an organization. - # @param [String] name - # Required. Name of the organization to get organization settings for. Its - # format is "organizations/[organization_id]/organizationSettings". - # @param [String] fields - # Selector specifying which fields to include in a partial response. - # @param [String] quota_user - # Available to use for quota purposes for server-side applications. Can be any - # arbitrary string assigned to a user, but should not exceed 40 characters. - # @param [Google::Apis::RequestOptions] options - # Request-specific options - # - # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::OrganizationSettings] parsed result object - # @yieldparam err [StandardError] error object if request failed - # - # @return [Google::Apis::SecuritycenterV1::OrganizationSettings] - # - # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried - # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification - # @raise [Google::Apis::AuthorizationError] Authorization is required - def get_organization_organization_settings(name, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:get, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation - command.response_class = Google::Apis::SecuritycenterV1::OrganizationSettings - command.params['name'] = name unless name.nil? - command.query['fields'] = fields unless fields.nil? - command.query['quotaUser'] = quota_user unless quota_user.nil? - execute_or_queue_command(command, &block) - end - - # Updates an organization's settings. - # @param [String] name - # The relative resource name of the settings. See: https://cloud.google.com/apis/ - # design/resource_names#relative_resource_name Example: "organizations/` - # organization_id`/organizationSettings". - # @param [Google::Apis::SecuritycenterV1::OrganizationSettings] organization_settings_object - # @param [String] update_mask - # The FieldMask to use when updating the settings resource. If empty all mutable - # fields will be updated. - # @param [String] fields - # Selector specifying which fields to include in a partial response. - # @param [String] quota_user - # Available to use for quota purposes for server-side applications. Can be any - # arbitrary string assigned to a user, but should not exceed 40 characters. - # @param [Google::Apis::RequestOptions] options - # Request-specific options - # - # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::OrganizationSettings] parsed result object - # @yieldparam err [StandardError] error object if request failed - # - # @return [Google::Apis::SecuritycenterV1::OrganizationSettings] - # - # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried - # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification - # @raise [Google::Apis::AuthorizationError] Authorization is required - def update_organization_organization_settings(name, organization_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:patch, 'v1/{+name}', options) - command.request_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation - command.request_object = organization_settings_object - command.response_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation - command.response_class = Google::Apis::SecuritycenterV1::OrganizationSettings - command.params['name'] = name unless name.nil? - command.query['updateMask'] = update_mask unless update_mask.nil? - command.query['fields'] = fields unless fields.nil? - command.query['quotaUser'] = quota_user unless quota_user.nil? - execute_or_queue_command(command, &block) - end - # Filters an organization's assets and groups them by their specified properties. # @param [String] parent # Required. Name of the organization to groupBy. Its format is "organizations/[ - # organization_id]". + # organization_id], folders/[folder_id], or projects/[project_id]". # @param [Google::Apis::SecuritycenterV1::GroupAssetsRequest] group_assets_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. @@ -140,7 +70,7 @@ def update_organization_organization_settings(name, organization_settings_object # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def group_assets(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + def group_folder_asset(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/assets:group', options) command.request_representation = Google::Apis::SecuritycenterV1::GroupAssetsRequest::Representation command.request_object = group_assets_request_object @@ -155,7 +85,8 @@ def group_assets(parent, group_assets_request_object = nil, fields: nil, quota_u # Lists an organization's assets. # @param [String] parent # Required. Name of the organization assets should belong to. Its format is " - # organizations/[organization_id]". + # organizations/[organization_id], folders/[folder_id], or projects/[project_id]" + # . # @param [String] compare_duration # When compare_duration is set, the ListAssetsResult's "state_change" attribute # is updated to indicate whether the asset was added, removed, or remained @@ -251,7 +182,7 @@ def group_assets(parent, group_assets_request_object = nil, fields: nil, quota_u # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def list_organization_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) + def list_folder_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/assets', options) command.response_representation = Google::Apis::SecuritycenterV1::ListAssetsResponse::Representation command.response_class = Google::Apis::SecuritycenterV1::ListAssetsResponse @@ -268,42 +199,6 @@ def list_organization_assets(parent, compare_duration: nil, field_mask: nil, fil execute_or_queue_command(command, &block) end - # 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 [String] parent - # Required. Name of the organization to run asset discovery for. Its format is " - # organizations/[organization_id]". - # @param [Google::Apis::SecuritycenterV1::RunAssetDiscoveryRequest] run_asset_discovery_request_object - # @param [String] fields - # Selector specifying which fields to include in a partial response. - # @param [String] quota_user - # Available to use for quota purposes for server-side applications. Can be any - # arbitrary string assigned to a user, but should not exceed 40 characters. - # @param [Google::Apis::RequestOptions] options - # Request-specific options - # - # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Operation] parsed result object - # @yieldparam err [StandardError] error object if request failed - # - # @return [Google::Apis::SecuritycenterV1::Operation] - # - # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried - # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification - # @raise [Google::Apis::AuthorizationError] Authorization is required - def run_organization_asset_discovery(parent, run_asset_discovery_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+parent}/assets:runDiscovery', options) - command.request_representation = Google::Apis::SecuritycenterV1::RunAssetDiscoveryRequest::Representation - command.request_object = run_asset_discovery_request_object - command.response_representation = Google::Apis::SecuritycenterV1::Operation::Representation - command.response_class = Google::Apis::SecuritycenterV1::Operation - command.params['parent'] = parent unless parent.nil? - command.query['fields'] = fields unless fields.nil? - command.query['quotaUser'] = quota_user unless quota_user.nil? - execute_or_queue_command(command, &block) - end - # Updates security marks. # @param [String] name # The relative resource name of the SecurityMarks. See: https://cloud.google.com/ @@ -336,7 +231,7 @@ def run_organization_asset_discovery(parent, run_asset_discovery_request_object # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def update_organization_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + def update_folder_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', options) command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation command.request_object = security_marks_object @@ -350,15 +245,18 @@ def update_organization_asset_security_marks(name, security_marks_object = nil, execute_or_queue_command(command, &block) end - # Creates a notification config. + # Lists all sources belonging to an organization. # @param [String] parent - # Required. Resource name of the new notification config's parent. Its format is - # "organizations/[organization_id]". - # @param [Google::Apis::SecuritycenterV1::NotificationConfig] notification_config_object - # @param [String] config_id - # 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. + # 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 [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -368,31 +266,38 @@ def update_organization_asset_security_marks(name, security_marks_object = nil, # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::NotificationConfig] + # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def create_organization_notification_config(parent, notification_config_object = nil, config_id: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+parent}/notificationConfigs', options) - command.request_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation - command.request_object = notification_config_object - command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation - command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig + def list_folder_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/sources', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse command.params['parent'] = parent unless parent.nil? - command.query['configId'] = config_id unless config_id.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Deletes a notification config. - # @param [String] name - # Required. Name of the notification config to delete. Its format is " - # organizations/[organization_id]/notificationConfigs/[config_id]". + # 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 [String] 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 [Google::Apis::SecuritycenterV1::GroupFindingsRequest] group_findings_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -402,28 +307,102 @@ def create_organization_notification_config(parent, notification_config_object = # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::GroupFindingsResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Empty] + # @return [Google::Apis::SecuritycenterV1::GroupFindingsResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def delete_organization_notification_config(name, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:delete, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation - command.response_class = Google::Apis::SecuritycenterV1::Empty - command.params['name'] = name unless name.nil? + def group_folder_source_finding(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/findings:group', options) + command.request_representation = Google::Apis::SecuritycenterV1::GroupFindingsRequest::Representation + command.request_object = group_findings_request_object + command.response_representation = Google::Apis::SecuritycenterV1::GroupFindingsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::GroupFindingsResponse + command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Gets a notification config. - # @param [String] name - # Required. Name of the notification config to get. Its format is "organizations/ - # [organization_id]/notificationConfigs/[config_id]". + # 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 [String] 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] compare_duration + # 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 [String] field_mask + # A field mask to specify the Finding fields to be listed in the response. An + # empty field mask will list all fields. + # @param [String] filter + # Expression that defines the filter to apply across findings. The expression is + # a list of one or more restrictions combined via logical operators `AND` and ` + # OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. + # Restrictions have the form ` ` and may have a `-` character in front of them + # to indicate negation. Examples include: * name * source_properties.a_property * + # security_marks.marks.marka The supported operators are: * `=` for all value + # types. * `>`, `<`, `>=`, `<=` for integer values. * `:`, meaning substring + # matching, for strings. The supported value types are: * string literals in + # quotes. * integer literals without quotes. * boolean literals `true` and ` + # false` without quotes. The following field and operator combinations are + # supported: name: `=` parent: `=`, `:` resource_name: `=`, `:` state: `=`, `:` + # category: `=`, `:` external_uri: `=`, `:` event_time: `=`, `>`, `<`, `>=`, `<=` + # Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` `event_time = 1560208038000` + # security_marks.marks: `=`, `:` source_properties: `=`, `:`, `>`, `<`, `>=`, `<= + # ` For example, `source_properties.size = 100` is a valid filter string. 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] order_by + # 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 [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] read_time + # 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] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -433,74 +412,44 @@ def delete_organization_notification_config(name, fields: nil, quota_user: nil, # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::ListFindingsResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::NotificationConfig] + # @return [Google::Apis::SecuritycenterV1::ListFindingsResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def get_organization_notification_config(name, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:get, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation - command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig - command.params['name'] = name unless name.nil? - command.query['fields'] = fields unless fields.nil? - command.query['quotaUser'] = quota_user unless quota_user.nil? - execute_or_queue_command(command, &block) - end - - # Lists notification configs. - # @param [String] parent - # Required. Name of the organization to list notification configs. Its format is - # "organizations/[organization_id]". - # @param [Fixnum] page_size - # The maximum number of results to return in a single response. Default is 10, - # minimum is 1, maximum is 1000. - # @param [String] page_token - # 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 [String] fields - # Selector specifying which fields to include in a partial response. - # @param [String] quota_user - # Available to use for quota purposes for server-side applications. Can be any - # arbitrary string assigned to a user, but should not exceed 40 characters. - # @param [Google::Apis::RequestOptions] options - # Request-specific options - # - # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse] parsed result object - # @yieldparam err [StandardError] error object if request failed - # - # @return [Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse] - # - # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried - # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification - # @raise [Google::Apis::AuthorizationError] Authorization is required - def list_organization_notification_configs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:get, 'v1/{+parent}/notificationConfigs', options) - command.response_representation = Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse::Representation - command.response_class = Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse + def list_folder_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/findings', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListFindingsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListFindingsResponse command.params['parent'] = parent unless parent.nil? + command.query['compareDuration'] = compare_duration unless compare_duration.nil? + command.query['fieldMask'] = field_mask unless field_mask.nil? + command.query['filter'] = filter unless filter.nil? + command.query['orderBy'] = order_by unless order_by.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? + command.query['readTime'] = read_time unless read_time.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Updates a notification config. The following update fields are allowed: - # description, pubsub_topic, streaming_config.filter + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. # @param [String] name - # 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". - # @param [Google::Apis::SecuritycenterV1::NotificationConfig] notification_config_object + # 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`" + # @param [Google::Apis::SecuritycenterV1::Finding] finding_object # @param [String] update_mask - # The FieldMask to use when updating the notification config. If empty all - # mutable fields will be updated. + # 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 [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -510,20 +459,20 @@ def list_organization_notification_configs(parent, page_size: nil, page_token: n # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::NotificationConfig] + # @return [Google::Apis::SecuritycenterV1::Finding] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def patch_organization_notification_config(name, notification_config_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + def patch_folder_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', options) - command.request_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation - command.request_object = notification_config_object - command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation - command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig + command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.request_object = finding_object + command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.response_class = Google::Apis::SecuritycenterV1::Finding command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? @@ -531,16 +480,12 @@ def patch_organization_notification_config(name, notification_config_object = ni execute_or_queue_command(command, &block) end - # 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 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 Operation.error value with a google.rpc.Status.code of 1, - # corresponding to `Code.CANCELLED`. + # Updates the state of a finding. # @param [String] name - # The name of the operation resource to be cancelled. + # 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::Apis::SecuritycenterV1::SetFindingStateRequest] set_finding_state_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -550,30 +495,41 @@ def patch_organization_notification_config(name, notification_config_object = ni # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Empty] + # @return [Google::Apis::SecuritycenterV1::Finding] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def cancel_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+name}:cancel', options) - command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation - command.response_class = Google::Apis::SecuritycenterV1::Empty + def set_folder_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+name}:setState', options) + command.request_representation = Google::Apis::SecuritycenterV1::SetFindingStateRequest::Representation + command.request_object = set_finding_state_request_object + command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.response_class = Google::Apis::SecuritycenterV1::Finding command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # 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`. + # Updates security marks. # @param [String] name - # The name of the operation resource to be deleted. + # 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". + # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object + # @param [String] start_time + # 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 [String] update_mask + # 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 [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -583,28 +539,32 @@ def cancel_organization_operation(name, fields: nil, quota_user: nil, options: n # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Empty] + # @return [Google::Apis::SecuritycenterV1::SecurityMarks] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def delete_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:delete, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation - command.response_class = Google::Apis::SecuritycenterV1::Empty + def update_folder_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.request_object = security_marks_object + command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks command.params['name'] = name unless name.nil? + command.query['startTime'] = start_time unless start_time.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # 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. + # Gets the settings for an organization. # @param [String] name - # The name of the operation resource. + # Required. Name of the organization to get organization settings for. Its + # format is "organizations/[organization_id]/organizationSettings". # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -614,40 +574,33 @@ def delete_organization_operation(name, fields: nil, quota_user: nil, options: n # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Operation] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::OrganizationSettings] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Operation] + # @return [Google::Apis::SecuritycenterV1::OrganizationSettings] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def get_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block) + def get_organization_organization_settings(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::Operation::Representation - command.response_class = Google::Apis::SecuritycenterV1::Operation + command.response_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation + command.response_class = Google::Apis::SecuritycenterV1::OrganizationSettings command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Lists operations that match the specified filter in the request. If the server - # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` - # binding allows API services to override the binding to use different resource - # name schemes, such as `users/*/operations`. To override the binding, API - # services can add a binding such as `"/v1/`name=users/*`/operations"` to their - # service configuration. For backwards compatibility, the default name includes - # the operations collection id, however overriding users must ensure the name - # binding is the parent resource, without the operations collection id. + # Updates an organization's settings. # @param [String] name - # The name of the operation's parent resource. - # @param [String] filter - # The standard list filter. - # @param [Fixnum] page_size - # The standard list page size. - # @param [String] page_token - # The standard list page token. + # The relative resource name of the settings. See: https://cloud.google.com/apis/ + # design/resource_names#relative_resource_name Example: "organizations/` + # organization_id`/organizationSettings". + # @param [Google::Apis::SecuritycenterV1::OrganizationSettings] organization_settings_object + # @param [String] update_mask + # The FieldMask to use when updating the settings resource. If empty all mutable + # fields will be updated. # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -657,32 +610,32 @@ def get_organization_operation(name, fields: nil, quota_user: nil, options: nil, # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::ListOperationsResponse] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::OrganizationSettings] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::ListOperationsResponse] + # @return [Google::Apis::SecuritycenterV1::OrganizationSettings] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def list_organization_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:get, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::ListOperationsResponse::Representation - command.response_class = Google::Apis::SecuritycenterV1::ListOperationsResponse + def update_organization_organization_settings(name, organization_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation + command.request_object = organization_settings_object + command.response_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation + command.response_class = Google::Apis::SecuritycenterV1::OrganizationSettings command.params['name'] = name unless name.nil? - command.query['filter'] = filter unless filter.nil? - command.query['pageSize'] = page_size unless page_size.nil? - command.query['pageToken'] = page_token unless page_token.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Creates a source. + # Filters an organization's assets and groups them by their specified properties. # @param [String] parent - # Required. Resource name of the new source's parent. Its format should be " - # organizations/[organization_id]". - # @param [Google::Apis::SecuritycenterV1::Source] source_object + # Required. Name of the organization to groupBy. Its format is "organizations/[ + # organization_id], folders/[folder_id], or projects/[project_id]". + # @param [Google::Apis::SecuritycenterV1::GroupAssetsRequest] group_assets_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -692,102 +645,1084 @@ def list_organization_operations(name, filter: nil, page_size: nil, page_token: # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::GroupAssetsResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Source] + # @return [Google::Apis::SecuritycenterV1::GroupAssetsResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def create_organization_source(parent, source_object = nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+parent}/sources', options) - command.request_representation = Google::Apis::SecuritycenterV1::Source::Representation - command.request_object = source_object - command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation - command.response_class = Google::Apis::SecuritycenterV1::Source + def group_assets(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/assets:group', options) + command.request_representation = Google::Apis::SecuritycenterV1::GroupAssetsRequest::Representation + command.request_object = group_assets_request_object + command.response_representation = Google::Apis::SecuritycenterV1::GroupAssetsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::GroupAssetsResponse command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Gets a source. - # @param [String] name - # Required. Relative resource name of the source. Its format is "organizations/[ - # organization_id]/source/[source_id]". - # @param [String] fields - # Selector specifying which fields to include in a partial response. - # @param [String] quota_user - # Available to use for quota purposes for server-side applications. Can be any - # arbitrary string assigned to a user, but should not exceed 40 characters. - # @param [Google::Apis::RequestOptions] options - # Request-specific options - # - # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object - # @yieldparam err [StandardError] error object if request failed - # - # @return [Google::Apis::SecuritycenterV1::Source] - # - # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried - # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification - # @raise [Google::Apis::AuthorizationError] Authorization is required - def get_organization_source(name, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:get, 'v1/{+name}', options) - command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation - command.response_class = Google::Apis::SecuritycenterV1::Source - command.params['name'] = name unless name.nil? - command.query['fields'] = fields unless fields.nil? - command.query['quotaUser'] = quota_user unless quota_user.nil? - execute_or_queue_command(command, &block) - end - - # Gets the access control policy on the specified Source. - # @param [String] resource - # REQUIRED: The resource for which the policy is being requested. See the - # operation documentation for the appropriate value for this field. - # @param [Google::Apis::SecuritycenterV1::GetIamPolicyRequest] get_iam_policy_request_object - # @param [String] fields - # Selector specifying which fields to include in a partial response. - # @param [String] quota_user - # Available to use for quota purposes for server-side applications. Can be any - # arbitrary string assigned to a user, but should not exceed 40 characters. - # @param [Google::Apis::RequestOptions] options + # Lists an organization's assets. + # @param [String] 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] compare_duration + # When compare_duration is set, the ListAssetsResult's "state_change" attribute + # is updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the read_time. + # This is the time between (read_time - compare_duration) and read_time. The + # state_change value is derived based on the presence of the asset at the two + # points in time. Intermediate state changes between the two times don't affect + # the result. For example, the results aren't affected if the asset is removed + # and re-created again. Possible "state_change" values when compare_duration is + # specified: * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. * "REMOVED": indicates that the + # asset was present at the start of compare_duration, but not present at + # read_time. * "ACTIVE": indicates that the asset was present at both the start + # and the end of the time period defined by compare_duration and read_time. If + # compare_duration is not specified, then the only possible state_change is " + # UNUSED", which will be the state_change set for all assets present at + # read_time. + # @param [String] field_mask + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. An empty field mask will list all fields. + # @param [String] filter + # Expression that defines the filter to apply across assets. The expression is a + # list of zero or more restrictions combined via logical operators `AND` and `OR` + # . Parentheses are supported, and `OR` has higher precedence than `AND`. + # Restrictions have the form ` ` and may have a `-` character in front of them + # to indicate negation. The fields map to those defined in the Asset resource. + # Examples include: * name * security_center_properties.resource_name * + # resource_properties.a_property * security_marks.marks.marka The supported + # operators are: * `=` for all value types. * `>`, `<`, `>=`, `<=` for integer + # values. * `:`, meaning substring matching, for strings. The supported value + # types are: * string literals in quotes. * integer literals without quotes. * + # boolean literals `true` and `false` without quotes. The following are the + # allowed field and operator combinations: * name: `=` * update_time: `=`, `>`, ` + # <`, `>=`, `<=` Usage: This should be milliseconds since epoch or an RFC3339 + # string. Examples: `update_time = "2019-06-10T16:07:18-07:00"` `update_time = + # 1560208038000` * create_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be + # milliseconds since epoch or an RFC3339 string. Examples: `create_time = "2019- + # 06-10T16:07:18-07:00"` `create_time = 1560208038000` * iam_policy.policy_blob: + # `=`, `:` * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * + # security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, + # `:` * security_center_properties.resource_display_name: `=`, `:` * + # security_center_properties.resource_type: `=`, `:` * + # security_center_properties.resource_parent: `=`, `:` * + # security_center_properties.resource_parent_display_name: `=`, `:` * + # security_center_properties.resource_project: `=`, `:` * + # security_center_properties.resource_project_display_name: `=`, `:` * + # security_center_properties.resource_owners: `=`, `:` For example, ` + # resource_properties.size = 100` is a valid filter string. 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] order_by + # 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 [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] read_time + # 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] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::ListAssetsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::ListAssetsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def list_organization_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/assets', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListAssetsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListAssetsResponse + command.params['parent'] = parent unless parent.nil? + command.query['compareDuration'] = compare_duration unless compare_duration.nil? + command.query['fieldMask'] = field_mask unless field_mask.nil? + command.query['filter'] = filter unless filter.nil? + command.query['orderBy'] = order_by unless order_by.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['readTime'] = read_time unless read_time.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # 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 [String] parent + # Required. Name of the organization to run asset discovery for. Its format is " + # organizations/[organization_id]". + # @param [Google::Apis::SecuritycenterV1::RunAssetDiscoveryRequest] run_asset_discovery_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Operation] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Operation] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def run_organization_asset_discovery(parent, run_asset_discovery_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/assets:runDiscovery', options) + command.request_representation = Google::Apis::SecuritycenterV1::RunAssetDiscoveryRequest::Representation + command.request_object = run_asset_discovery_request_object + command.response_representation = Google::Apis::SecuritycenterV1::Operation::Representation + command.response_class = Google::Apis::SecuritycenterV1::Operation + command.params['parent'] = parent unless parent.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Updates security marks. + # @param [String] name + # The relative resource name of the SecurityMarks. See: https://cloud.google.com/ + # apis/design/resource_names#relative_resource_name Examples: "organizations/` + # organization_id`/assets/`asset_id`/securityMarks" "organizations/` + # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks". + # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object + # @param [String] start_time + # 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 [String] update_mask + # 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 [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::SecurityMarks] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def update_organization_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.request_object = security_marks_object + command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks + command.params['name'] = name unless name.nil? + command.query['startTime'] = start_time unless start_time.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Creates a notification config. + # @param [String] parent + # Required. Resource name of the new notification config's parent. Its format is + # "organizations/[organization_id]". + # @param [Google::Apis::SecuritycenterV1::NotificationConfig] notification_config_object + # @param [String] config_id + # 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 [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::NotificationConfig] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def create_organization_notification_config(parent, notification_config_object = nil, config_id: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/notificationConfigs', options) + command.request_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation + command.request_object = notification_config_object + command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation + command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig + command.params['parent'] = parent unless parent.nil? + command.query['configId'] = config_id unless config_id.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Deletes a notification config. + # @param [String] name + # Required. Name of the notification config to delete. Its format is " + # organizations/[organization_id]/notificationConfigs/[config_id]". + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Empty] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def delete_organization_notification_config(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:delete, 'v1/{+name}', options) + command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation + command.response_class = Google::Apis::SecuritycenterV1::Empty + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Gets a notification config. + # @param [String] name + # Required. Name of the notification config to get. Its format is "organizations/ + # [organization_id]/notificationConfigs/[config_id]". + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::NotificationConfig] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def get_organization_notification_config(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+name}', options) + command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation + command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Lists notification configs. + # @param [String] parent + # Required. Name of the organization to list notification configs. Its format is + # "organizations/[organization_id]". + # @param [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def list_organization_notification_configs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/notificationConfigs', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse + command.params['parent'] = parent unless parent.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Updates a notification config. The following update fields are allowed: + # description, pubsub_topic, streaming_config.filter + # @param [String] name + # 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". + # @param [Google::Apis::SecuritycenterV1::NotificationConfig] notification_config_object + # @param [String] update_mask + # The FieldMask to use when updating the notification config. If empty all + # mutable fields will be updated. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::NotificationConfig] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def patch_organization_notification_config(name, notification_config_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation + command.request_object = notification_config_object + command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation + command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig + command.params['name'] = name unless name.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # 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 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 Operation.error value with a google.rpc.Status.code of 1, + # corresponding to `Code.CANCELLED`. + # @param [String] name + # The name of the operation resource to be cancelled. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Empty] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def cancel_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+name}:cancel', options) + command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation + command.response_class = Google::Apis::SecuritycenterV1::Empty + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # 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 [String] name + # The name of the operation resource to be deleted. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Empty] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def delete_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:delete, 'v1/{+name}', options) + command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation + command.response_class = Google::Apis::SecuritycenterV1::Empty + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # 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 [String] name + # The name of the operation resource. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Operation] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Operation] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def get_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+name}', options) + command.response_representation = Google::Apis::SecuritycenterV1::Operation::Representation + command.response_class = Google::Apis::SecuritycenterV1::Operation + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Lists operations that match the specified filter in the request. If the server + # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` + # binding allows API services to override the binding to use different resource + # name schemes, such as `users/*/operations`. To override the binding, API + # services can add a binding such as `"/v1/`name=users/*`/operations"` to their + # service configuration. For backwards compatibility, the default name includes + # the operations collection id, however overriding users must ensure the name + # binding is the parent resource, without the operations collection id. + # @param [String] name + # The name of the operation's parent resource. + # @param [String] filter + # The standard list filter. + # @param [Fixnum] page_size + # The standard list page size. + # @param [String] page_token + # The standard list page token. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::ListOperationsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::ListOperationsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def list_organization_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+name}', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListOperationsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListOperationsResponse + command.params['name'] = name unless name.nil? + command.query['filter'] = filter unless filter.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Creates a source. + # @param [String] parent + # Required. Resource name of the new source's parent. Its format should be " + # organizations/[organization_id]". + # @param [Google::Apis::SecuritycenterV1::Source] source_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Source] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def create_organization_source(parent, source_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/sources', options) + command.request_representation = Google::Apis::SecuritycenterV1::Source::Representation + command.request_object = source_object + command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation + command.response_class = Google::Apis::SecuritycenterV1::Source + command.params['parent'] = parent unless parent.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Gets a source. + # @param [String] name + # Required. Relative resource name of the source. Its format is "organizations/[ + # organization_id]/source/[source_id]". + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Source] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def get_organization_source(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+name}', options) + command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation + command.response_class = Google::Apis::SecuritycenterV1::Source + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Gets the access control policy on the specified Source. + # @param [String] resource + # REQUIRED: The resource for which the policy is being requested. See the + # operation documentation for the appropriate value for this field. + # @param [Google::Apis::SecuritycenterV1::GetIamPolicyRequest] get_iam_policy_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Policy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Policy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def get_source_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options) + command.request_representation = Google::Apis::SecuritycenterV1::GetIamPolicyRequest::Representation + command.request_object = get_iam_policy_request_object + command.response_representation = Google::Apis::SecuritycenterV1::Policy::Representation + command.response_class = Google::Apis::SecuritycenterV1::Policy + command.params['resource'] = resource unless resource.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Lists all sources belonging to an organization. + # @param [String] 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 [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def list_organization_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/sources', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse + command.params['parent'] = parent unless parent.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Updates a source. + # @param [String] name + # The relative resource name of this source. See: https://cloud.google.com/apis/ + # design/resource_names#relative_resource_name Example: "organizations/` + # organization_id`/sources/`source_id`" + # @param [Google::Apis::SecuritycenterV1::Source] source_object + # @param [String] update_mask + # The FieldMask to use when updating the source resource. If empty all mutable + # fields will be updated. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Source] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def patch_organization_source(name, source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::Source::Representation + command.request_object = source_object + command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation + command.response_class = Google::Apis::SecuritycenterV1::Source + command.params['name'] = name unless name.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Sets the access control policy on the specified Source. + # @param [String] resource + # REQUIRED: The resource for which the policy is being specified. See the + # operation documentation for the appropriate value for this field. + # @param [Google::Apis::SecuritycenterV1::SetIamPolicyRequest] set_iam_policy_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Policy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Policy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def set_source_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options) + command.request_representation = Google::Apis::SecuritycenterV1::SetIamPolicyRequest::Representation + command.request_object = set_iam_policy_request_object + command.response_representation = Google::Apis::SecuritycenterV1::Policy::Representation + command.response_class = Google::Apis::SecuritycenterV1::Policy + command.params['resource'] = resource unless resource.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Returns the permissions that a caller has on the specified source. + # @param [String] resource + # REQUIRED: The resource for which the policy detail is being requested. See the + # operation documentation for the appropriate value for this field. + # @param [Google::Apis::SecuritycenterV1::TestIamPermissionsRequest] test_iam_permissions_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::TestIamPermissionsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::TestIamPermissionsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def test_source_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options) + command.request_representation = Google::Apis::SecuritycenterV1::TestIamPermissionsRequest::Representation + command.request_object = test_iam_permissions_request_object + command.response_representation = Google::Apis::SecuritycenterV1::TestIamPermissionsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::TestIamPermissionsResponse + command.params['resource'] = resource unless resource.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Creates a finding. The corresponding source must exist for finding creation to + # succeed. + # @param [String] parent + # Required. Resource name of the new finding's parent. Its format should be " + # organizations/[organization_id]/sources/[source_id]". + # @param [Google::Apis::SecuritycenterV1::Finding] finding_object + # @param [String] finding_id + # 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 [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Policy] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Policy] + # @return [Google::Apis::SecuritycenterV1::Finding] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def get_source_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options) - command.request_representation = Google::Apis::SecuritycenterV1::GetIamPolicyRequest::Representation - command.request_object = get_iam_policy_request_object - command.response_representation = Google::Apis::SecuritycenterV1::Policy::Representation - command.response_class = Google::Apis::SecuritycenterV1::Policy - command.params['resource'] = resource unless resource.nil? + def create_organization_source_finding(parent, finding_object = nil, finding_id: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/findings', options) + command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.request_object = finding_object + command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.response_class = Google::Apis::SecuritycenterV1::Finding + command.params['parent'] = parent unless parent.nil? + command.query['findingId'] = finding_id unless finding_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Lists all sources belonging to an organization. + # 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 [String] parent - # Required. Resource name of the parent of sources to list. Its format should be - # "organizations/[organization_id]". + # 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 [Google::Apis::SecuritycenterV1::GroupFindingsRequest] group_findings_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::GroupFindingsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::GroupFindingsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def group_findings(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/findings:group', options) + command.request_representation = Google::Apis::SecuritycenterV1::GroupFindingsRequest::Representation + command.request_object = group_findings_request_object + command.response_representation = Google::Apis::SecuritycenterV1::GroupFindingsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::GroupFindingsResponse + command.params['parent'] = parent unless parent.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # 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 [String] 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] compare_duration + # 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 [String] field_mask + # A field mask to specify the Finding fields to be listed in the response. An + # empty field mask will list all fields. + # @param [String] filter + # Expression that defines the filter to apply across findings. The expression is + # a list of one or more restrictions combined via logical operators `AND` and ` + # OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. + # Restrictions have the form ` ` and may have a `-` character in front of them + # to indicate negation. Examples include: * name * source_properties.a_property * + # security_marks.marks.marka The supported operators are: * `=` for all value + # types. * `>`, `<`, `>=`, `<=` for integer values. * `:`, meaning substring + # matching, for strings. The supported value types are: * string literals in + # quotes. * integer literals without quotes. * boolean literals `true` and ` + # false` without quotes. The following field and operator combinations are + # supported: name: `=` parent: `=`, `:` resource_name: `=`, `:` state: `=`, `:` + # category: `=`, `:` external_uri: `=`, `:` event_time: `=`, `>`, `<`, `>=`, `<=` + # Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` `event_time = 1560208038000` + # security_marks.marks: `=`, `:` source_properties: `=`, `:`, `>`, `<`, `>=`, `<= + # ` For example, `source_properties.size = 100` is a valid filter string. 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] order_by + # 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 [Fixnum] page_size # The maximum number of results to return in a single response. Default is 10, # minimum is 1, maximum is 1000. # @param [String] page_token - # 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. + # 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 [String] read_time + # 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] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::ListFindingsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::ListFindingsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def list_organization_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/findings', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListFindingsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListFindingsResponse + command.params['parent'] = parent unless parent.nil? + command.query['compareDuration'] = compare_duration unless compare_duration.nil? + command.query['fieldMask'] = field_mask unless field_mask.nil? + command.query['filter'] = filter unless filter.nil? + command.query['orderBy'] = order_by unless order_by.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['readTime'] = read_time unless read_time.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + # @param [String] name + # The relative resource name of this finding. See: https://cloud.google.com/apis/ + # design/resource_names#relative_resource_name Example: "organizations/` + # organization_id`/sources/`source_id`/findings/`finding_id`" + # @param [Google::Apis::SecuritycenterV1::Finding] finding_object + # @param [String] update_mask + # 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 [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Finding] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def patch_organization_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.request_object = finding_object + command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.response_class = Google::Apis::SecuritycenterV1::Finding + command.params['name'] = name unless name.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Updates the state of a finding. + # @param [String] name + # Required. The relative resource name of the finding. See: https://cloud.google. + # com/apis/design/resource_names#relative_resource_name Example: "organizations/` + # organization_id`/sources/`source_id`/finding/`finding_id`". + # @param [Google::Apis::SecuritycenterV1::SetFindingStateRequest] set_finding_state_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SecuritycenterV1::Finding] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def set_organization_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+name}:setState', options) + command.request_representation = Google::Apis::SecuritycenterV1::SetFindingStateRequest::Representation + command.request_object = set_finding_state_request_object + command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation + command.response_class = Google::Apis::SecuritycenterV1::Finding + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Updates security marks. + # @param [String] name + # The relative resource name of the SecurityMarks. See: https://cloud.google.com/ + # apis/design/resource_names#relative_resource_name Examples: "organizations/` + # organization_id`/assets/`asset_id`/securityMarks" "organizations/` + # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks". + # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object + # @param [String] start_time + # 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 [String] update_mask + # 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 [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -797,35 +1732,33 @@ def get_source_iam_policy(resource, get_iam_policy_request_object = nil, fields: # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse] + # @return [Google::Apis::SecuritycenterV1::SecurityMarks] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def list_organization_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:get, 'v1/{+parent}/sources', options) - command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation - command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse - command.params['parent'] = parent unless parent.nil? - command.query['pageSize'] = page_size unless page_size.nil? - command.query['pageToken'] = page_token unless page_token.nil? + def update_organization_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.request_object = security_marks_object + command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks + command.params['name'] = name unless name.nil? + command.query['startTime'] = start_time unless start_time.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Updates a source. - # @param [String] name - # The relative resource name of this source. See: https://cloud.google.com/apis/ - # design/resource_names#relative_resource_name Example: "organizations/` - # organization_id`/sources/`source_id`" - # @param [Google::Apis::SecuritycenterV1::Source] source_object - # @param [String] update_mask - # The FieldMask to use when updating the source resource. If empty all mutable - # fields will be updated. + # Filters an organization's assets and groups them by their specified properties. + # @param [String] parent + # Required. Name of the organization to groupBy. Its format is "organizations/[ + # organization_id], folders/[folder_id], or projects/[project_id]". + # @param [Google::Apis::SecuritycenterV1::GroupAssetsRequest] group_assets_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -835,32 +1768,109 @@ def list_organization_sources(parent, page_size: nil, page_token: nil, fields: n # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::GroupAssetsResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Source] + # @return [Google::Apis::SecuritycenterV1::GroupAssetsResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def patch_organization_source(name, source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:patch, 'v1/{+name}', options) - command.request_representation = Google::Apis::SecuritycenterV1::Source::Representation - command.request_object = source_object - command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation - command.response_class = Google::Apis::SecuritycenterV1::Source - command.params['name'] = name unless name.nil? - command.query['updateMask'] = update_mask unless update_mask.nil? + def group_project_asset(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v1/{+parent}/assets:group', options) + command.request_representation = Google::Apis::SecuritycenterV1::GroupAssetsRequest::Representation + command.request_object = group_assets_request_object + command.response_representation = Google::Apis::SecuritycenterV1::GroupAssetsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::GroupAssetsResponse + command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Sets the access control policy on the specified Source. - # @param [String] resource - # REQUIRED: The resource for which the policy is being specified. See the - # operation documentation for the appropriate value for this field. - # @param [Google::Apis::SecuritycenterV1::SetIamPolicyRequest] set_iam_policy_request_object + # Lists an organization's assets. + # @param [String] 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] compare_duration + # When compare_duration is set, the ListAssetsResult's "state_change" attribute + # is updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the read_time. + # This is the time between (read_time - compare_duration) and read_time. The + # state_change value is derived based on the presence of the asset at the two + # points in time. Intermediate state changes between the two times don't affect + # the result. For example, the results aren't affected if the asset is removed + # and re-created again. Possible "state_change" values when compare_duration is + # specified: * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. * "REMOVED": indicates that the + # asset was present at the start of compare_duration, but not present at + # read_time. * "ACTIVE": indicates that the asset was present at both the start + # and the end of the time period defined by compare_duration and read_time. If + # compare_duration is not specified, then the only possible state_change is " + # UNUSED", which will be the state_change set for all assets present at + # read_time. + # @param [String] field_mask + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. An empty field mask will list all fields. + # @param [String] filter + # Expression that defines the filter to apply across assets. The expression is a + # list of zero or more restrictions combined via logical operators `AND` and `OR` + # . Parentheses are supported, and `OR` has higher precedence than `AND`. + # Restrictions have the form ` ` and may have a `-` character in front of them + # to indicate negation. The fields map to those defined in the Asset resource. + # Examples include: * name * security_center_properties.resource_name * + # resource_properties.a_property * security_marks.marks.marka The supported + # operators are: * `=` for all value types. * `>`, `<`, `>=`, `<=` for integer + # values. * `:`, meaning substring matching, for strings. The supported value + # types are: * string literals in quotes. * integer literals without quotes. * + # boolean literals `true` and `false` without quotes. The following are the + # allowed field and operator combinations: * name: `=` * update_time: `=`, `>`, ` + # <`, `>=`, `<=` Usage: This should be milliseconds since epoch or an RFC3339 + # string. Examples: `update_time = "2019-06-10T16:07:18-07:00"` `update_time = + # 1560208038000` * create_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be + # milliseconds since epoch or an RFC3339 string. Examples: `create_time = "2019- + # 06-10T16:07:18-07:00"` `create_time = 1560208038000` * iam_policy.policy_blob: + # `=`, `:` * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * + # security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, + # `:` * security_center_properties.resource_display_name: `=`, `:` * + # security_center_properties.resource_type: `=`, `:` * + # security_center_properties.resource_parent: `=`, `:` * + # security_center_properties.resource_parent_display_name: `=`, `:` * + # security_center_properties.resource_project: `=`, `:` * + # security_center_properties.resource_project_display_name: `=`, `:` * + # security_center_properties.resource_owners: `=`, `:` For example, ` + # resource_properties.size = 100` is a valid filter string. 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] order_by + # 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 [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] read_time + # 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] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -870,31 +1880,46 @@ def patch_organization_source(name, source_object = nil, update_mask: nil, field # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Policy] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::ListAssetsResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Policy] + # @return [Google::Apis::SecuritycenterV1::ListAssetsResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def set_source_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options) - command.request_representation = Google::Apis::SecuritycenterV1::SetIamPolicyRequest::Representation - command.request_object = set_iam_policy_request_object - command.response_representation = Google::Apis::SecuritycenterV1::Policy::Representation - command.response_class = Google::Apis::SecuritycenterV1::Policy - command.params['resource'] = resource unless resource.nil? + def list_project_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/assets', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListAssetsResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListAssetsResponse + command.params['parent'] = parent unless parent.nil? + command.query['compareDuration'] = compare_duration unless compare_duration.nil? + command.query['fieldMask'] = field_mask unless field_mask.nil? + command.query['filter'] = filter unless filter.nil? + command.query['orderBy'] = order_by unless order_by.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['readTime'] = read_time unless read_time.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Returns the permissions that a caller has on the specified source. - # @param [String] resource - # REQUIRED: The resource for which the policy detail is being requested. See the - # operation documentation for the appropriate value for this field. - # @param [Google::Apis::SecuritycenterV1::TestIamPermissionsRequest] test_iam_permissions_request_object + # Updates security marks. + # @param [String] name + # The relative resource name of the SecurityMarks. See: https://cloud.google.com/ + # apis/design/resource_names#relative_resource_name Examples: "organizations/` + # organization_id`/assets/`asset_id`/securityMarks" "organizations/` + # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks". + # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object + # @param [String] start_time + # 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 [String] update_mask + # 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 [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -904,36 +1929,40 @@ def set_source_iam_policy(resource, set_iam_policy_request_object = nil, fields: # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::TestIamPermissionsResponse] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::TestIamPermissionsResponse] + # @return [Google::Apis::SecuritycenterV1::SecurityMarks] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def test_source_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options) - command.request_representation = Google::Apis::SecuritycenterV1::TestIamPermissionsRequest::Representation - command.request_object = test_iam_permissions_request_object - command.response_representation = Google::Apis::SecuritycenterV1::TestIamPermissionsResponse::Representation - command.response_class = Google::Apis::SecuritycenterV1::TestIamPermissionsResponse - command.params['resource'] = resource unless resource.nil? + def update_project_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v1/{+name}', options) + command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.request_object = security_marks_object + command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation + command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks + command.params['name'] = name unless name.nil? + command.query['startTime'] = start_time unless start_time.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end - # Creates a finding. The corresponding source must exist for finding creation to - # succeed. + # Lists all sources belonging to an organization. # @param [String] parent - # Required. Resource name of the new finding's parent. Its format should be " - # organizations/[organization_id]/sources/[source_id]". - # @param [Google::Apis::SecuritycenterV1::Finding] finding_object - # @param [String] finding_id - # 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. + # 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 [Fixnum] page_size + # The maximum number of results to return in a single response. Default is 10, + # minimum is 1, maximum is 1000. + # @param [String] page_token + # 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 [String] fields # Selector specifying which fields to include in a partial response. # @param [String] quota_user @@ -943,22 +1972,21 @@ def test_source_iam_permissions(resource, test_iam_permissions_request_object = # Request-specific options # # @yield [result, err] Result & error if block supplied - # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object + # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object # @yieldparam err [StandardError] error object if request failed # - # @return [Google::Apis::SecuritycenterV1::Finding] + # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse] # # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def create_organization_source_finding(parent, finding_object = nil, finding_id: nil, fields: nil, quota_user: nil, options: nil, &block) - command = make_simple_command(:post, 'v1/{+parent}/findings', options) - command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation - command.request_object = finding_object - command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation - command.response_class = Google::Apis::SecuritycenterV1::Finding + def list_project_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v1/{+parent}/sources', options) + command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation + command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse command.params['parent'] = parent unless parent.nil? - command.query['findingId'] = finding_id unless finding_id.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) @@ -966,11 +1994,15 @@ def create_organization_source_finding(parent, finding_object = nil, finding_id: # 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 + # id. Example: /v1/organizations/`organization_id`/sources/-/findings, /v1/ + # folders/`folder_id`/sources/-/findings, /v1/projects/`project_id`/sources/-/ + # findings # @param [String] parent # Required. Name of the source to groupBy. Its format is "organizations/[ - # organization_id]/sources/[source_id]". To groupBy across all sources provide a - # source_id of `-`. For example: organizations/`organization_id`/sources/- + # 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 [Google::Apis::SecuritycenterV1::GroupFindingsRequest] group_findings_request_object # @param [String] fields # Selector specifying which fields to include in a partial response. @@ -989,7 +2021,7 @@ def create_organization_source_finding(parent, finding_object = nil, finding_id: # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def group_findings(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + def group_project_source_finding(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/findings:group', options) command.request_representation = Google::Apis::SecuritycenterV1::GroupFindingsRequest::Representation command.request_object = group_findings_request_object @@ -1006,9 +2038,11 @@ def group_findings(parent, group_findings_request_object = nil, fields: nil, quo # findings # @param [String] parent # Required. Name of the source the findings belong to. Its format is " - # organizations/[organization_id]/sources/[source_id]". To list across all - # sources provide a source_id of `-`. For example: organizations/` - # organization_id`/sources/- + # 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] compare_duration # When compare_duration is set, the ListFindingsResult's "state_change" # attribute is updated to indicate whether the finding had its state changed, @@ -1092,7 +2126,7 @@ def group_findings(parent, group_findings_request_object = nil, fields: nil, quo # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def list_organization_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) + def list_project_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/findings', options) command.response_representation = Google::Apis::SecuritycenterV1::ListFindingsResponse::Representation command.response_class = Google::Apis::SecuritycenterV1::ListFindingsResponse @@ -1139,7 +2173,7 @@ def list_organization_source_findings(parent, compare_duration: nil, field_mask: # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def patch_organization_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + def patch_project_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', options) command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation command.request_object = finding_object @@ -1175,7 +2209,7 @@ def patch_organization_source_finding(name, finding_object = nil, update_mask: n # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def set_organization_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + def set_project_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:setState', options) command.request_representation = Google::Apis::SecuritycenterV1::SetFindingStateRequest::Representation command.request_object = set_finding_state_request_object @@ -1219,7 +2253,7 @@ def set_organization_source_finding_state(name, set_finding_state_request_object # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification # @raise [Google::Apis::AuthorizationError] Authorization is required - def update_organization_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + def update_project_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', options) command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation command.request_object = security_marks_object diff --git a/generated/google/apis/securitycenter_v1/synth.metadata b/generated/google/apis/securitycenter_v1/synth.metadata index d205479fe89..8b51c41a5b7 100644 --- a/generated/google/apis/securitycenter_v1/synth.metadata +++ b/generated/google/apis/securitycenter_v1/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/google-api-ruby-client.git", - "sha": "33b84d0738d4f86612984844493a4e0f8651f26d" + "sha": "fd68d8388ddace483f1cff77d52a03934f656362" } } ]