diff --git a/protos/google/cloud/securitycenter/v1/finding.proto b/protos/google/cloud/securitycenter/v1/finding.proto index e14266b4..d914a698 100644 --- a/protos/google/cloud/securitycenter/v1/finding.proto +++ b/protos/google/cloud/securitycenter/v1/finding.proto @@ -119,6 +119,21 @@ message Finding { LOW = 4; } + // Mute state a finding can be in. + enum Mute { + // Unspecified. + MUTE_UNSPECIFIED = 0; + + // Finding has been muted. + MUTED = 1; + + // Finding has been unmuted. + UNMUTED = 2; + + // Finding has never been muted/unmuted. + UNDEFINED = 4; + } + // Represents what kind of Finding it is. enum FindingClass { // Unspecified finding class. @@ -207,6 +222,10 @@ message Finding { // finding. string canonical_name = 14; + // Indicates the mute state of a finding (either unspecified, muted, unmuted + // or undefined). + Mute mute = 15; + // The class of the finding. FindingClass finding_class = 17; @@ -221,4 +240,12 @@ message Finding { // CVE stands for Common Vulnerabilities and Exposures // (https://cve.mitre.org/about/) Vulnerability vulnerability = 20; + + // Output only. The most recent time this finding was muted or unmuted. + google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // First known as mute_annotation. Records additional information about the + // mute operation e.g. mute config that muted the finding, user who muted the + // finding, etc. + string mute_initiator = 28; } diff --git a/protos/google/cloud/securitycenter/v1/mute_config.proto b/protos/google/cloud/securitycenter/v1/mute_config.proto new file mode 100644 index 00000000..78d63a66 --- /dev/null +++ b/protos/google/cloud/securitycenter/v1/mute_config.proto @@ -0,0 +1,90 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "MuteConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A mute config is a Cloud SCC resource that contains the configuration +// to mute create/update events of findings. +message MuteConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/MuteConfig" + pattern: "organizations/{organization}/muteConfigs/{mute_config}" + pattern: "folders/{folder}/muteConfigs/{mute_config}" + pattern: "projects/{project}/muteConfigs/{mute_config}" + }; + + // This field will be ignored if provided on config creation. Format + // "organizations/{organization}/muteConfigs/{mute_config}" + // "folders/{folder}/muteConfigs/{mute_config}" + // "projects/{project}/muteConfigs/{mute_config}" + string name = 1; + + // The human readable name to be displayed for the mute config. + string display_name = 2 [deprecated = true]; + + // A description of the mute config. + string description = 3; + + // Required. An expression that defines the filter to apply across create/update events + // of findings. While creating a filter string, be mindful of the + // scope in which the mute configuration is being created. E.g., If a filter + // contains project = X but is created under the project = Y scope, it might + // not match any findings. + // + // The following field and operator combinations are supported: + // + // * severity: `=`, `:` + // * category: `=`, `:` + // * resource.name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.folders.resource_folder: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.type: `=`, `:` + // * finding_class: `=`, `:` + // * indicator.ip_addresses: `=`, `:` + // * indicator.domains: `=`, `:` + string filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time at which the mute config was created. + // This field is set by the server and will be ignored if provided on config + // creation. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the mute config was updated. + // This field is set by the server and will be ignored if provided on config + // creation or update. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user who last edited the mute config. + // This field is set by the server and will be ignored if provided on config + // creation or update. + string most_recent_editor = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 89f89a0c..a7690a17 100644 --- a/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -24,6 +24,7 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/folder.proto"; +import "google/cloud/securitycenter/v1/mute_config.proto"; import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; @@ -49,6 +50,29 @@ service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Kicks off an LRO to bulk mute findings for a parent based on a filter. The + // parent can be either an organization, folder or project. The findings + // matched by the filter will be muted after the LRO is done. + rpc BulkMuteFindings(BulkMuteFindingsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/findings:bulkMute" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*}/findings:bulkMute" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1.BulkMuteFindingsResponse" + metadata_type: "google.protobuf.Empty" + }; + } + // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { option (google.api.http) = { @@ -68,6 +92,24 @@ service SecurityCenter { option (google.api.method_signature) = "parent,finding_id,finding"; } + // Creates a mute config. + rpc CreateMuteConfig(CreateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/muteConfigs" + body: "mute_config" + additional_bindings { + post: "/v1/{parent=folders/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/muteConfigs" + body: "mute_config" + } + }; + option (google.api.method_signature) = "parent,mute_config"; + option (google.api.method_signature) = "parent,mute_config,mute_config_id"; + } + // Creates a notification config. rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { @@ -78,6 +120,20 @@ service SecurityCenter { option (google.api.method_signature) = "parent,notification_config"; } + // Deletes an existing mute config. + rpc DeleteMuteConfig(DeleteMuteConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/muteConfigs/*}" + additional_bindings { + delete: "/v1/{name=folders/*/muteConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/muteConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + // Deletes a notification config. rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -95,6 +151,20 @@ service SecurityCenter { option (google.api.method_signature) = "resource"; } + // Gets a mute config. + rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/muteConfigs/*}" + additional_bindings { + get: "/v1/{name=folders/*/muteConfigs/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/muteConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + // Gets a notification config. rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { @@ -188,6 +258,20 @@ service SecurityCenter { }; } + // Lists mute configs. + rpc ListMuteConfigs(ListMuteConfigsRequest) returns (ListMuteConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/muteConfigs" + additional_bindings { + get: "/v1/{parent=folders/*}/muteConfigs" + } + additional_bindings { + get: "/v1/{parent=projects/*}/muteConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + // Lists notification configs. rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { option (google.api.http) = { @@ -245,6 +329,23 @@ service SecurityCenter { option (google.api.method_signature) = "name,state,start_time"; } + // Updates the mute state of a finding. + rpc SetMute(SetMuteRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/sources/*/findings/*}:setMute" + body: "*" + additional_bindings { + post: "/v1/{name=folders/*/sources/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v1/{name=projects/*/sources/*/findings/*}:setMute" + body: "*" + } + }; + option (google.api.method_signature) = "name,mute"; + } + // Sets the access control policy on the specified Source. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { @@ -281,6 +382,23 @@ service SecurityCenter { option (google.api.method_signature) = "finding"; } + // Updates a mute config. + rpc UpdateMuteConfig(UpdateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + patch: "/v1/{mute_config.name=organizations/*/muteConfigs/*}" + body: "mute_config" + additional_bindings { + patch: "/v1/{mute_config.name=folders/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v1/{mute_config.name=projects/*/muteConfigs/*}" + body: "mute_config" + } + }; + option (google.api.method_signature) = "mute_config,update_mask"; + } + // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter @@ -341,6 +459,55 @@ service SecurityCenter { } } +// Request message for bulk findings update. +// +// Note: +// 1. If multiple bulk update requests match the same resource, the order in +// which they get executed is not defined. +// 2. Once a bulk operation is started, there is no way to stop it. +message BulkMuteFindingsRequest { + // Required. The parent, at which bulk action needs to be applied. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "*" + } + ]; + + // Expression that identifies findings that should be updated. + // The expression is a list of zero or more restrictions combined + // via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + // has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 2; + + // This can be a mute configuration name or any identifier for mute/unmute + // of findings based on the filter. + string mute_annotation = 3 [deprecated = true]; +} + +// The response to a BulkMute request. Contains the LRO information. +message BulkMuteFindingsResponse { + +} + // Request message for creating a finding. message CreateFindingRequest { // Required. Resource name of the new finding's parent. Its format should be @@ -362,6 +529,28 @@ message CreateFindingRequest { Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request message for creating a mute config. +message CreateMuteConfigRequest { + // Required. Resource name of the new mute configs's parent. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/MuteConfig" + } + ]; + + // Required. The mute config being created. + MuteConfig mute_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must consist of lower case letters, numbers, and hyphen, with the first + // character a letter, the last a letter or a number, and a 63 character + // maximum. + string mute_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + // Request message for creating a notification config. message CreateNotificationConfigRequest { // Required. Resource name of the new notification config's parent. Its format is @@ -400,6 +589,20 @@ message CreateSourceRequest { Source source = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request message for deleting a mute config. +message DeleteMuteConfigRequest { + // Required. Name of the mute config to delete. Its format is + // organizations/{organization}/muteConfigs/{config_id}, + // folders/{folder}/muteConfigs/{config_id}, or + // projects/{project}/muteConfigs/{config_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/MuteConfig" + } + ]; +} + // Request message for deleting a notification config. message DeleteNotificationConfigRequest { // Required. Name of the notification config to delete. Its format is @@ -412,6 +615,20 @@ message DeleteNotificationConfigRequest { ]; } +// Request message for retrieving a mute config. +message GetMuteConfigRequest { + // Required. Name of the mute config to retrieve. Its format is + // organizations/{organization}/muteConfigs/{config_id}, + // folders/{folder}/muteConfigs/{config_id}, or + // projects/{project}/muteConfigs/{config_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/MuteConfig" + } + ]; +} + // Request message for getting a notification config. message GetNotificationConfigRequest { // Required. Name of the notification config to get. Its format is @@ -778,6 +995,43 @@ message GroupResult { int64 count = 2; } +// Request message for listing mute configs at a given scope e.g. organization, +// folder or project. +message ListMuteConfigsRequest { + // Required. The parent, which owns the collection of mute configs. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/MuteConfig" + } + ]; + + // The maximum number of configs to return. The service may return fewer than + // this value. + // If unspecified, at most 10 configs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListMuteConfigs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListMuteConfigs` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for listing mute configs. +message ListMuteConfigsResponse { + // The mute configs from the specified parent. + repeated MuteConfig mute_configs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + // Request message for listing notification configs. message ListNotificationConfigsRequest { // Required. Name of the organization to list notification configs. @@ -1290,6 +1544,25 @@ message SetFindingStateRequest { google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request message for updating a finding's mute status. +message SetMuteRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", + // "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired state of the Mute. + Finding.Mute mute = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { // Required. Name of the organization to run asset discovery for. Its format is @@ -1322,6 +1595,16 @@ message UpdateFindingRequest { google.protobuf.FieldMask update_mask = 2; } +// Request message for updating a mute config. +message UpdateMuteConfigRequest { + // Required. The mute config being updated. + MuteConfig mute_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index dffff733..66a9913c 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -626,6 +626,9 @@ export namespace google { /** Finding canonicalName */ canonicalName?: (string|null); + /** Finding mute */ + mute?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + /** Finding findingClass */ findingClass?: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass|null); @@ -634,6 +637,12 @@ export namespace google { /** Finding vulnerability */ vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + + /** Finding muteUpdateTime */ + muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding muteInitiator */ + muteInitiator?: (string|null); } /** Represents a Finding. */ @@ -681,6 +690,9 @@ export namespace google { /** Finding canonicalName. */ public canonicalName: string; + /** Finding mute. */ + public mute: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + /** Finding findingClass. */ public findingClass: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass); @@ -690,6 +702,12 @@ export namespace google { /** Finding vulnerability. */ public vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + /** Finding muteUpdateTime. */ + public muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding muteInitiator. */ + public muteInitiator: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -779,6 +797,14 @@ export namespace google { LOW = 4 } + /** Mute enum. */ + enum Mute { + MUTE_UNSPECIFIED = 0, + MUTED = 1, + UNMUTED = 2, + UNDEFINED = 4 + } + /** FindingClass enum. */ enum FindingClass { FINDING_CLASS_UNSPECIFIED = 0, @@ -1360,6 +1386,132 @@ export namespace google { } } + /** Properties of a MuteConfig. */ + interface IMuteConfig { + + /** MuteConfig name */ + name?: (string|null); + + /** MuteConfig displayName */ + displayName?: (string|null); + + /** MuteConfig description */ + description?: (string|null); + + /** MuteConfig filter */ + filter?: (string|null); + + /** MuteConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig mostRecentEditor */ + mostRecentEditor?: (string|null); + } + + /** Represents a MuteConfig. */ + class MuteConfig implements IMuteConfig { + + /** + * Constructs a new MuteConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IMuteConfig); + + /** MuteConfig name. */ + public name: string; + + /** MuteConfig displayName. */ + public displayName: string; + + /** MuteConfig description. */ + public description: string; + + /** MuteConfig filter. */ + public filter: string; + + /** MuteConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig mostRecentEditor. */ + public mostRecentEditor: string; + + /** + * Creates a new MuteConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IMuteConfig): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @param message MuteConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @param message MuteConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuteConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Verifies a MuteConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuteConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. + * @param message MuteConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.MuteConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a NotificationConfig. */ interface INotificationConfig { @@ -2151,6 +2303,20 @@ export namespace google { */ public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindingsCallback): void; + + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @returns Promise + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest): Promise; + /** * Calls CreateSource. * @param request CreateSourceRequest message or plain object @@ -2179,6 +2345,20 @@ export namespace google { */ public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public createMuteConfig(request: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfigCallback): void; + + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @returns Promise + */ + public createMuteConfig(request: google.cloud.securitycenter.v1.ICreateMuteConfigRequest): Promise; + /** * Calls CreateNotificationConfig. * @param request CreateNotificationConfigRequest message or plain object @@ -2193,6 +2373,20 @@ export namespace google { */ public createNotificationConfig(request: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): Promise; + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfigCallback): void; + + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @returns Promise + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest): Promise; + /** * Calls DeleteNotificationConfig. * @param request DeleteNotificationConfigRequest message or plain object @@ -2221,6 +2415,20 @@ export namespace google { */ public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public getMuteConfig(request: google.cloud.securitycenter.v1.IGetMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfigCallback): void; + + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @returns Promise + */ + public getMuteConfig(request: google.cloud.securitycenter.v1.IGetMuteConfigRequest): Promise; + /** * Calls GetNotificationConfig. * @param request GetNotificationConfigRequest message or plain object @@ -2319,6 +2527,20 @@ export namespace google { */ public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMuteConfigsResponse + */ + public listMuteConfigs(request: google.cloud.securitycenter.v1.IListMuteConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigsCallback): void; + + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @returns Promise + */ + public listMuteConfigs(request: google.cloud.securitycenter.v1.IListMuteConfigsRequest): Promise; + /** * Calls ListNotificationConfigs. * @param request ListNotificationConfigsRequest message or plain object @@ -2375,6 +2597,20 @@ export namespace google { */ public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setMute(request: google.cloud.securitycenter.v1.ISetMuteRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetMuteCallback): void; + + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @returns Promise + */ + public setMute(request: google.cloud.securitycenter.v1.ISetMuteRequest): Promise; + /** * Calls SetIamPolicy. * @param request SetIamPolicyRequest message or plain object @@ -2417,6 +2653,20 @@ export namespace google { */ public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public updateMuteConfig(request: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfigCallback): void; + + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @returns Promise + */ + public updateMuteConfig(request: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest): Promise; + /** * Calls UpdateNotificationConfig. * @param request UpdateNotificationConfigRequest message or plain object @@ -2476,6 +2726,13 @@ export namespace google { namespace SecurityCenter { + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#bulkMuteFindings}. + * @param error Error, if any + * @param [response] Operation + */ + type BulkMuteFindingsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. * @param error Error, if any @@ -2490,6 +2747,13 @@ export namespace google { */ type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type CreateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. * @param error Error, if any @@ -2497,6 +2761,13 @@ export namespace google { */ type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteMuteConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMuteConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. * @param error Error, if any @@ -2511,6 +2782,13 @@ export namespace google { */ type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type GetMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. * @param error Error, if any @@ -2560,6 +2838,13 @@ export namespace google { */ type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listMuteConfigs}. + * @param error Error, if any + * @param [response] ListMuteConfigsResponse + */ + type ListMuteConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListMuteConfigsResponse) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. * @param error Error, if any @@ -2588,6 +2873,13 @@ export namespace google { */ type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setMute}. + * @param error Error, if any + * @param [response] Finding + */ + type SetMuteCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. * @param error Error, if any @@ -2609,6 +2901,13 @@ export namespace google { */ type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type UpdateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. * @param error Error, if any @@ -2638,6 +2937,192 @@ export namespace google { type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; } + /** Properties of a BulkMuteFindingsRequest. */ + interface IBulkMuteFindingsRequest { + + /** BulkMuteFindingsRequest parent */ + parent?: (string|null); + + /** BulkMuteFindingsRequest filter */ + filter?: (string|null); + + /** BulkMuteFindingsRequest muteAnnotation */ + muteAnnotation?: (string|null); + } + + /** Represents a BulkMuteFindingsRequest. */ + class BulkMuteFindingsRequest implements IBulkMuteFindingsRequest { + + /** + * Constructs a new BulkMuteFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest); + + /** BulkMuteFindingsRequest parent. */ + public parent: string; + + /** BulkMuteFindingsRequest filter. */ + public filter: string; + + /** BulkMuteFindingsRequest muteAnnotation. */ + public muteAnnotation: string; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @param message BulkMuteFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @param message BulkMuteFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Verifies a BulkMuteFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkMuteFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @param message BulkMuteFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BulkMuteFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BulkMuteFindingsResponse. */ + interface IBulkMuteFindingsResponse { + } + + /** Represents a BulkMuteFindingsResponse. */ + class BulkMuteFindingsResponse implements IBulkMuteFindingsResponse { + + /** + * Constructs a new BulkMuteFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse); + + /** + * Creates a new BulkMuteFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @param message BulkMuteFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @param message BulkMuteFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Verifies a BulkMuteFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkMuteFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. + * @param message BulkMuteFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BulkMuteFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CreateFindingRequest. */ interface ICreateFindingRequest { @@ -2740,6 +3225,108 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a CreateMuteConfigRequest. */ + interface ICreateMuteConfigRequest { + + /** CreateMuteConfigRequest parent */ + parent?: (string|null); + + /** CreateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** CreateMuteConfigRequest muteConfigId */ + muteConfigId?: (string|null); + } + + /** Represents a CreateMuteConfigRequest. */ + class CreateMuteConfigRequest implements ICreateMuteConfigRequest { + + /** + * Constructs a new CreateMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateMuteConfigRequest); + + /** CreateMuteConfigRequest parent. */ + public parent: string; + + /** CreateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** CreateMuteConfigRequest muteConfigId. */ + public muteConfigId: string; + + /** + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateMuteConfigRequest): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @param message CreateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @param message CreateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Verifies a CreateMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @param message CreateMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CreateNotificationConfigRequest. */ interface ICreateNotificationConfigRequest { @@ -2938,6 +3525,96 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a DeleteMuteConfigRequest. */ + interface IDeleteMuteConfigRequest { + + /** DeleteMuteConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteMuteConfigRequest. */ + class DeleteMuteConfigRequest implements IDeleteMuteConfigRequest { + + /** + * Constructs a new DeleteMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest); + + /** DeleteMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @param message DeleteMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @param message DeleteMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Verifies a DeleteMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @param message DeleteMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a DeleteNotificationConfigRequest. */ interface IDeleteNotificationConfigRequest { @@ -3009,20 +3686,110 @@ export namespace google { /** * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteNotificationConfigRequest + * @returns DeleteNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetMuteConfigRequest. */ + interface IGetMuteConfigRequest { + + /** GetMuteConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetMuteConfigRequest. */ + class GetMuteConfigRequest implements IGetMuteConfigRequest { + + /** + * Constructs a new GetMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest); + + /** GetMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Verifies a GetMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMuteConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetMuteConfigRequest; /** - * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. - * @param message DeleteNotificationConfigRequest + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. + * @param message GetMuteConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteNotificationConfigRequest to JSON. + * Converts this GetMuteConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -3862,6 +4629,204 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ListMuteConfigsRequest. */ + interface IListMuteConfigsRequest { + + /** ListMuteConfigsRequest parent */ + parent?: (string|null); + + /** ListMuteConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListMuteConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMuteConfigsRequest. */ + class ListMuteConfigsRequest implements IListMuteConfigsRequest { + + /** + * Constructs a new ListMuteConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListMuteConfigsRequest); + + /** ListMuteConfigsRequest parent. */ + public parent: string; + + /** ListMuteConfigsRequest pageSize. */ + public pageSize: number; + + /** ListMuteConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMuteConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMuteConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListMuteConfigsRequest): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @param message ListMuteConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @param message ListMuteConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Verifies a ListMuteConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMuteConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Creates a plain object from a ListMuteConfigsRequest message. Also converts values to other types if specified. + * @param message ListMuteConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListMuteConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListMuteConfigsResponse. */ + interface IListMuteConfigsResponse { + + /** ListMuteConfigsResponse muteConfigs */ + muteConfigs?: (google.cloud.securitycenter.v1.IMuteConfig[]|null); + + /** ListMuteConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMuteConfigsResponse. */ + class ListMuteConfigsResponse implements IListMuteConfigsResponse { + + /** + * Constructs a new ListMuteConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListMuteConfigsResponse); + + /** ListMuteConfigsResponse muteConfigs. */ + public muteConfigs: google.cloud.securitycenter.v1.IMuteConfig[]; + + /** ListMuteConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMuteConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMuteConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListMuteConfigsResponse): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @param message ListMuteConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @param message ListMuteConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Verifies a ListMuteConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMuteConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. + * @param message ListMuteConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListMuteConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ListNotificationConfigsRequest. */ interface IListNotificationConfigsRequest { @@ -5199,6 +6164,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a SetMuteRequest. */ + interface ISetMuteRequest { + + /** SetMuteRequest name */ + name?: (string|null); + + /** SetMuteRequest mute */ + mute?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + } + + /** Represents a SetMuteRequest. */ + class SetMuteRequest implements ISetMuteRequest { + + /** + * Constructs a new SetMuteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISetMuteRequest); + + /** SetMuteRequest name. */ + public name: string; + + /** SetMuteRequest mute. */ + public mute: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + + /** + * Creates a new SetMuteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMuteRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISetMuteRequest): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @param message SetMuteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @param message SetMuteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Verifies a SetMuteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMuteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. + * @param message SetMuteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SetMuteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMuteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a RunAssetDiscoveryRequest. */ interface IRunAssetDiscoveryRequest { @@ -5385,6 +6446,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an UpdateMuteConfigRequest. */ + interface IUpdateMuteConfigRequest { + + /** UpdateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** UpdateMuteConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateMuteConfigRequest. */ + class UpdateMuteConfigRequest implements IUpdateMuteConfigRequest { + + /** + * Constructs a new UpdateMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest); + + /** UpdateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** UpdateMuteConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @param message UpdateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @param message UpdateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Verifies an UpdateMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Creates a plain object from an UpdateMuteConfigRequest message. Also converts values to other types if specified. + * @param message UpdateMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an UpdateNotificationConfigRequest. */ interface IUpdateNotificationConfigRequest { diff --git a/protos/protos.js b/protos/protos.js index 9690fb96..89d96cb6 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -1562,9 +1562,12 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity * @property {string|null} [canonicalName] Finding canonicalName + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability + * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {string|null} [muteInitiator] Finding muteInitiator */ /** @@ -1679,6 +1682,14 @@ */ Finding.prototype.canonicalName = ""; + /** + * Finding mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mute = 0; + /** * Finding findingClass. * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass @@ -1703,6 +1714,22 @@ */ Finding.prototype.vulnerability = null; + /** + * Finding muteUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteUpdateTime = null; + + /** + * Finding muteInitiator. + * @member {string} muteInitiator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteInitiator = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1754,12 +1781,18 @@ writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); return writer; }; @@ -1849,6 +1882,9 @@ case 14: message.canonicalName = reader.string(); break; + case 15: + message.mute = reader.int32(); + break; case 17: message.findingClass = reader.int32(); break; @@ -1858,6 +1894,12 @@ case 20: message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); break; + case 21: + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 28: + message.muteInitiator = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1956,6 +1998,16 @@ if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) if (!$util.isString(message.canonicalName)) return "canonicalName: string expected"; + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } if (message.findingClass != null && message.hasOwnProperty("findingClass")) switch (message.findingClass) { default: @@ -1977,6 +2029,14 @@ if (error) return "vulnerability." + error; } + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); + if (error) + return "muteUpdateTime." + error; + } + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + if (!$util.isString(message.muteInitiator)) + return "muteInitiator: string expected"; return null; }; @@ -2065,6 +2125,24 @@ } if (object.canonicalName != null) message.canonicalName = String(object.canonicalName); + switch (object.mute) { + case "MUTE_UNSPECIFIED": + case 0: + message.mute = 0; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; + break; + } switch (object.findingClass) { case "FINDING_CLASS_UNSPECIFIED": case 0: @@ -2097,6 +2175,13 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); } + if (object.muteUpdateTime != null) { + if (typeof object.muteUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); + message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); + } + if (object.muteInitiator != null) + message.muteInitiator = String(object.muteInitiator); return message; }; @@ -2127,9 +2212,12 @@ object.createTime = null; object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; object.canonicalName = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; object.indicator = null; object.vulnerability = null; + object.muteUpdateTime = null; + object.muteInitiator = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2159,12 +2247,18 @@ object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) object.canonicalName = message.canonicalName; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; if (message.findingClass != null && message.hasOwnProperty("findingClass")) object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; if (message.indicator != null && message.hasOwnProperty("indicator")) object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) + object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + object.muteInitiator = message.muteInitiator; return object; }; @@ -2215,6 +2309,24 @@ return values; })(); + /** + * Mute enum. + * @name google.cloud.securitycenter.v1.Finding.Mute + * @enum {number} + * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNMUTED=2 UNMUTED value + * @property {number} UNDEFINED=4 UNDEFINED value + */ + Finding.Mute = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNMUTED"] = 2; + values[valuesById[4] = "UNDEFINED"] = 4; + return values; + })(); + /** * FindingClass enum. * @name google.cloud.securitycenter.v1.Finding.FindingClass @@ -3783,28 +3895,30 @@ return Cvssv3; })(); - v1.NotificationConfig = (function() { + v1.MuteConfig = (function() { /** - * Properties of a NotificationConfig. + * Properties of a MuteConfig. * @memberof google.cloud.securitycenter.v1 - * @interface INotificationConfig - * @property {string|null} [name] NotificationConfig name - * @property {string|null} [description] NotificationConfig description - * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic - * @property {string|null} [serviceAccount] NotificationConfig serviceAccount - * @property {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig + * @interface IMuteConfig + * @property {string|null} [name] MuteConfig name + * @property {string|null} [displayName] MuteConfig displayName + * @property {string|null} [description] MuteConfig description + * @property {string|null} [filter] MuteConfig filter + * @property {google.protobuf.ITimestamp|null} [createTime] MuteConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MuteConfig updateTime + * @property {string|null} [mostRecentEditor] MuteConfig mostRecentEditor */ /** - * Constructs a new NotificationConfig. + * Constructs a new MuteConfig. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a NotificationConfig. - * @implements INotificationConfig + * @classdesc Represents a MuteConfig. + * @implements IMuteConfig * @constructor - * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set */ - function NotificationConfig(properties) { + function MuteConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3812,124 +3926,130 @@ } /** - * NotificationConfig name. + * MuteConfig name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.name = ""; + MuteConfig.prototype.name = ""; /** - * NotificationConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.description = ""; + MuteConfig.prototype.displayName = ""; /** - * NotificationConfig pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.pubsubTopic = ""; + MuteConfig.prototype.description = ""; /** - * NotificationConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.serviceAccount = ""; + MuteConfig.prototype.filter = ""; /** - * NotificationConfig streamingConfig. - * @member {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.streamingConfig = null; + MuteConfig.prototype.createTime = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * MuteConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.updateTime = null; /** - * NotificationConfig notifyConfig. - * @member {"streamingConfig"|undefined} notifyConfig - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { - get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); + MuteConfig.prototype.mostRecentEditor = ""; /** - * Creates a new NotificationConfig instance using the specified properties. + * Creates a new MuteConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig instance */ - NotificationConfig.create = function create(properties) { - return new NotificationConfig(properties); + MuteConfig.create = function create(properties) { + return new MuteConfig(properties); }; /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {google.cloud.securitycenter.v1.IMuteConfig} message MuteConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationConfig.encode = function encode(message, writer) { + MuteConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); - if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) - $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.mostRecentEditor); return writer; }; /** - * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {google.cloud.securitycenter.v1.IMuteConfig} message MuteConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationConfig message from the specified reader or buffer. + * Decodes a MuteConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationConfig.decode = function decode(reader, length) { + MuteConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.MuteConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3937,16 +4057,22 @@ message.name = reader.string(); break; case 2: - message.description = reader.string(); + message.displayName = reader.string(); break; case 3: - message.pubsubTopic = reader.string(); + message.description = reader.string(); break; case 4: - message.serviceAccount = reader.string(); + message.filter = reader.string(); break; case 5: - message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.mostRecentEditor = reader.string(); break; default: reader.skipType(tag & 7); @@ -3957,340 +4083,170 @@ }; /** - * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + MuteConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationConfig message. + * Verifies a MuteConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationConfig.verify = function verify(message) { + MuteConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { - properties.notifyConfig = 1; - { - var error = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); - if (error) - return "streamingConfig." + error; - } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + if (!$util.isString(message.mostRecentEditor)) + return "mostRecentEditor: string expected"; return null; }; /** - * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig */ - NotificationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) + MuteConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MuteConfig) return object; - var message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + var message = new $root.google.cloud.securitycenter.v1.MuteConfig(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.streamingConfig != null) { - if (typeof object.streamingConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.NotificationConfig.streamingConfig: object expected"); - message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); + if (object.filter != null) + message.filter = String(object.filter); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.mostRecentEditor != null) + message.mostRecentEditor = String(object.mostRecentEditor); return message; }; /** - * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig} message NotificationConfig + * @param {google.cloud.securitycenter.v1.MuteConfig} message MuteConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationConfig.toObject = function toObject(message, options) { + MuteConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; + object.displayName = ""; object.description = ""; - object.pubsubTopic = ""; - object.serviceAccount = ""; + object.filter = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { - object.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); - if (options.oneofs) - object.notifyConfig = "streamingConfig"; - } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + object.mostRecentEditor = message.mostRecentEditor; return object; }; /** - * Converts this NotificationConfig to JSON. + * Converts this MuteConfig to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance * @returns {Object.} JSON object */ - NotificationConfig.prototype.toJSON = function toJSON() { + MuteConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - NotificationConfig.StreamingConfig = (function() { - - /** - * Properties of a StreamingConfig. - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @interface IStreamingConfig - * @property {string|null} [filter] StreamingConfig filter - */ + return MuteConfig; + })(); - /** - * Constructs a new StreamingConfig. - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @classdesc Represents a StreamingConfig. - * @implements IStreamingConfig - * @constructor - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set - */ - function StreamingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StreamingConfig filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @instance - */ - StreamingConfig.prototype.filter = ""; - - /** - * Creates a new StreamingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig instance - */ - StreamingConfig.create = function create(properties) { - return new StreamingConfig(properties); - }; - - /** - * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - return writer; - }; - - /** - * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StreamingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.filter = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StreamingConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig - */ - StreamingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} message StreamingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.filter = ""; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this StreamingConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @instance - * @returns {Object.} JSON object - */ - StreamingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StreamingConfig; - })(); - - return NotificationConfig; - })(); - - v1.NotificationMessage = (function() { + v1.NotificationConfig = (function() { /** - * Properties of a NotificationMessage. + * Properties of a NotificationConfig. * @memberof google.cloud.securitycenter.v1 - * @interface INotificationMessage - * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding - * @property {google.cloud.securitycenter.v1.IResource|null} [resource] NotificationMessage resource + * @interface INotificationConfig + * @property {string|null} [name] NotificationConfig name + * @property {string|null} [description] NotificationConfig description + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {string|null} [serviceAccount] NotificationConfig serviceAccount + * @property {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig */ /** - * Constructs a new NotificationMessage. + * Constructs a new NotificationConfig. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a NotificationMessage. - * @implements INotificationMessage + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig * @constructor - * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set */ - function NotificationMessage(properties) { + function NotificationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4298,115 +4254,141 @@ } /** - * NotificationMessage notificationConfigName. - * @member {string} notificationConfigName - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - NotificationMessage.prototype.notificationConfigName = ""; + NotificationConfig.prototype.name = ""; /** - * NotificationMessage finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - NotificationMessage.prototype.finding = null; + NotificationConfig.prototype.description = ""; /** - * NotificationMessage resource. - * @member {google.cloud.securitycenter.v1.IResource|null|undefined} resource - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - NotificationMessage.prototype.resource = null; + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * NotificationMessage event. - * @member {"finding"|undefined} event - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - Object.defineProperty(NotificationMessage.prototype, "event", { - get: $util.oneOfGetter($oneOfFields = ["finding"]), + Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new NotificationMessage instance using the specified properties. + * Creates a new NotificationConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance */ - NotificationMessage.create = function create(properties) { - return new NotificationMessage(properties); + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); }; /** - * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationMessage.encode = function encode(message, writer) { + NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); - if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.securitycenter.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationMessage message from the specified reader or buffer. + * Decodes a NotificationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationMessage.decode = function decode(reader, length) { + NotificationConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.notificationConfigName = reader.string(); + message.name = reader.string(); break; case 2: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + message.description = reader.string(); break; case 3: - message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); + message.pubsubTopic = reader.string(); + break; + case 4: + message.serviceAccount = reader.string(); + break; + case 5: + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4417,318 +4399,456 @@ }; /** - * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationMessage.decodeDelimited = function decodeDelimited(reader) { + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationMessage message. + * Verifies a NotificationConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationMessage.verify = function verify(message) { + NotificationConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) - if (!$util.isString(message.notificationConfigName)) - return "notificationConfigName: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - properties.event = 1; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.notifyConfig = 1; { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); if (error) - return "finding." + error; + return "streamingConfig." + error; } } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.securitycenter.v1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } return null; }; /** - * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig */ - NotificationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) return object; - var message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); - if (object.notificationConfigName != null) - message.notificationConfigName = String(object.notificationConfigName); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.resource: object expected"); - message.resource = $root.google.cloud.securitycenter.v1.Resource.fromObject(object.resource); + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); } return message; }; /** - * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage + * @param {google.cloud.securitycenter.v1.NotificationConfig} message NotificationConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationMessage.toObject = function toObject(message, options) { + NotificationConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.notificationConfigName = ""; - object.resource = null; + object.name = ""; + object.description = ""; + object.pubsubTopic = ""; + object.serviceAccount = ""; } - if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) - object.notificationConfigName = message.notificationConfigName; - if (message.finding != null && message.hasOwnProperty("finding")) { - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); if (options.oneofs) - object.event = "finding"; + object.notifyConfig = "streamingConfig"; } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.securitycenter.v1.Resource.toObject(message.resource, options); return object; }; /** - * Converts this NotificationMessage to JSON. + * Converts this NotificationConfig to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance * @returns {Object.} JSON object */ - NotificationMessage.prototype.toJSON = function toJSON() { + NotificationConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NotificationMessage; - })(); - - v1.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.securitycenter.v1 - * @interface IResource - * @property {string|null} [name] Resource name - * @property {string|null} [project] Resource project - * @property {string|null} [projectDisplayName] Resource projectDisplayName - * @property {string|null} [parent] Resource parent - * @property {string|null} [parentDisplayName] Resource parentDisplayName - * @property {string|null} [type] Resource type - * @property {Array.|null} [folders] Resource folders - * @property {string|null} [displayName] Resource displayName - */ + NotificationConfig.StreamingConfig = (function() { - /** - * Constructs a new Resource. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set - */ - function Resource(properties) { - this.folders = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ - /** - * Resource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.name = ""; + /** + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig + * @constructor + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + */ + function StreamingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Resource project. - * @member {string} project - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.project = ""; + /** + * StreamingConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @instance + */ + StreamingConfig.prototype.filter = ""; - /** - * Resource projectDisplayName. - * @member {string} projectDisplayName - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.projectDisplayName = ""; + /** + * Creates a new StreamingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig instance + */ + StreamingConfig.create = function create(properties) { + return new StreamingConfig(properties); + }; - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.Resource - * @instance + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + */ + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} message StreamingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this StreamingConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingConfig; + })(); + + return NotificationConfig; + })(); + + v1.NotificationMessage = (function() { + + /** + * Properties of a NotificationMessage. + * @memberof google.cloud.securitycenter.v1 + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v1.IResource|null} [resource] NotificationMessage resource */ - Resource.prototype.parent = ""; /** - * Resource parentDisplayName. - * @member {string} parentDisplayName - * @memberof google.cloud.securitycenter.v1.Resource + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage + * @constructor + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + */ + function NotificationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationMessage notificationConfigName. + * @member {string} notificationConfigName + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.parentDisplayName = ""; + NotificationMessage.prototype.notificationConfigName = ""; /** - * Resource type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.Resource + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.type = ""; + NotificationMessage.prototype.finding = null; /** - * Resource folders. - * @member {Array.} folders - * @memberof google.cloud.securitycenter.v1.Resource + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v1.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.folders = $util.emptyArray; + NotificationMessage.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Resource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.Resource + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.displayName = ""; + Object.defineProperty(NotificationMessage.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["finding"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Resource instance using the specified properties. + * Creates a new NotificationMessage instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Resource} Resource instance + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance */ - Resource.create = function create(properties) { - return new Resource(properties); + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + NotificationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); - if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); - if (message.folders != null && message.folders.length) - for (var i = 0; i < message.folders.length; ++i) - $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a NotificationMessage message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + NotificationMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.notificationConfigName = reader.string(); break; case 2: - message.project = reader.string(); + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); break; case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parent = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - case 6: - message.type = reader.string(); - break; - case 7: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); - break; - case 8: - message.displayName = reader.string(); + message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4739,184 +4859,148 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a NotificationMessage message. * @function verify - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + NotificationMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - if (!$util.isString(message.projectDisplayName)) - return "projectDisplayName: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - if (!$util.isString(message.parentDisplayName)) - return "parentDisplayName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.folders != null && message.hasOwnProperty("folders")) { - if (!Array.isArray(message.folders)) - return "folders: array expected"; - for (var i = 0; i < message.folders.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + var properties = {}; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (!$util.isString(message.notificationConfigName)) + return "notificationConfigName: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.event = 1; + { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); if (error) - return "folders." + error; + return "finding." + error; } } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Resource) + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) return object; - var message = new $root.google.cloud.securitycenter.v1.Resource(); - if (object.name != null) - message.name = String(object.name); - if (object.project != null) - message.project = String(object.project); - if (object.projectDisplayName != null) - message.projectDisplayName = String(object.projectDisplayName); - if (object.parent != null) - message.parent = String(object.parent); - if (object.parentDisplayName != null) - message.parentDisplayName = String(object.parentDisplayName); - if (object.type != null) - message.type = String(object.type); - if (object.folders) { - if (!Array.isArray(object.folders)) - throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); - message.folders = []; - for (var i = 0; i < object.folders.length; ++i) { - if (typeof object.folders[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); - message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); - } + var message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.Resource.fromObject(object.resource); } - if (object.displayName != null) - message.displayName = String(object.displayName); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.Resource} message Resource + * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + NotificationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.folders = []; if (options.defaults) { - object.name = ""; - object.project = ""; - object.projectDisplayName = ""; - object.parent = ""; - object.parentDisplayName = ""; - object.type = ""; - object.displayName = ""; + object.notificationConfigName = ""; + object.resource = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - object.projectDisplayName = message.projectDisplayName; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - object.parentDisplayName = message.parentDisplayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.folders && message.folders.length) { - object.folders = []; - for (var j = 0; j < message.folders.length; ++j) - object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + object.notificationConfigName = message.notificationConfigName; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.Resource.toObject(message.resource, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this NotificationMessage to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + NotificationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return NotificationMessage; })(); - v1.OrganizationSettings = (function() { + v1.Resource = (function() { /** - * Properties of an OrganizationSettings. + * Properties of a Resource. * @memberof google.cloud.securitycenter.v1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [project] Resource project + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parent] Resource parent + * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {string|null} [type] Resource type + * @property {Array.|null} [folders] Resource folders + * @property {string|null} [displayName] Resource displayName */ /** - * Constructs a new OrganizationSettings. + * Constructs a new Resource. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set */ - function OrganizationSettings(properties) { + function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4924,90 +5008,141 @@ } /** - * OrganizationSettings name. + * Resource name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @instance */ - OrganizationSettings.prototype.name = ""; + Resource.prototype.name = ""; /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Resource project. + * @member {string} project + * @memberof google.cloud.securitycenter.v1.Resource * @instance */ - OrganizationSettings.prototype.enableAssetDiscovery = false; + Resource.prototype.project = ""; /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.Resource * @instance */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + Resource.prototype.projectDisplayName = ""; /** - * Creates a new OrganizationSettings instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + * Resource parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Resource + * @instance */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); + Resource.prototype.parent = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.type = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); return writer; }; /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decode = function decode(reader, length) { + Resource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5015,10 +5150,27 @@ message.name = reader.string(); break; case 2: - message.enableAssetDiscovery = reader.bool(); + message.project = reader.string(); break; case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + message.projectDisplayName = reader.string(); + break; + case 4: + message.parent = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + case 6: + message.type = reader.string(); + break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + case 8: + message.displayName = reader.string(); break; default: reader.skipType(tag & 7); @@ -5029,121 +5181,411 @@ }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OrganizationSettings message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OrganizationSettings.verify = function verify(message) { + Resource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); - if (error) - return "assetDiscoveryConfig." + error; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; return null; }; /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.Resource} Resource */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Resource) return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + var message = new $root.google.cloud.securitycenter.v1.Resource(); if (object.name != null) message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + if (object.project != null) + message.project = String(object.project); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.type != null) + message.type = String(object.type); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } } + if (object.displayName != null) + message.displayName = String(object.displayName); return message; }; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {google.cloud.securitycenter.v1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OrganizationSettings.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; return object; }; /** - * Converts this OrganizationSettings to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @instance * @returns {Object.} JSON object */ - OrganizationSettings.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - OrganizationSettings.AssetDiscoveryConfig = (function() { + return Resource; + })(); - /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode - * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds - */ + v1.OrganizationSettings = (function() { - /** - * Constructs a new AssetDiscoveryConfig. + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds + */ + + /** + * Constructs a new AssetDiscoveryConfig. * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @classdesc Represents an AssetDiscoveryConfig. * @implements IAssetDiscoveryConfig @@ -5400,58 +5842,1340 @@ return object; }; - /** - * Converts this AssetDiscoveryConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - * @returns {Object.} JSON object - */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {number} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#bulkMuteFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef BulkMuteFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindingsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.bulkMuteFindings = function bulkMuteFindings(request, callback) { + return this.rpcCall(bulkMuteFindings, $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BulkMuteFindings" }); + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createMuteConfig = function createMuteConfig(request, callback) { + return this.rpcCall(createMuteConfig, $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "CreateMuteConfig" }); + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { + return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteMuteConfig = function deleteMuteConfig(request, callback) { + return this.rpcCall(deleteMuteConfig, $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMuteConfig" }); + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { + return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getMuteConfig = function getMuteConfig(request, callback) { + return this.rpcCall(getMuteConfig, $root.google.cloud.securitycenter.v1.GetMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "GetMuteConfig" }); + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { + return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listMuteConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListMuteConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} [response] ListMuteConfigsResponse + */ + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigsCallback} callback Node-style callback called with the error, if any, and ListMuteConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listMuteConfigs = function listMuteConfigs(request, callback) { + return this.rpcCall(listMuteConfigs, $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest, $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse, request, callback); + }, "name", { value: "ListMuteConfigs" }); + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { + return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setMute}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetMuteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} request SetMuteRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetMuteCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setMute = function setMute(request, callback) { + return this.rpcCall(setMute, $root.google.cloud.securitycenter.v1.SetMuteRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetMute" }); + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} request SetMuteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateMuteConfig = function updateMuteConfig(request, callback) { + return this.rpcCall(updateMuteConfig, $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "UpdateMuteConfig" }); + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { + return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {number} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value - */ - AssetDiscoveryConfig.InclusionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; - return values; - })(); + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ - return AssetDiscoveryConfig; - })(); + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); - return OrganizationSettings; + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; })(); - v1.RunAssetDiscoveryResponse = (function() { + v1.BulkMuteFindingsRequest = (function() { /** - * Properties of a RunAssetDiscoveryResponse. + * Properties of a BulkMuteFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IRunAssetDiscoveryResponse - * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state - * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + * @interface IBulkMuteFindingsRequest + * @property {string|null} [parent] BulkMuteFindingsRequest parent + * @property {string|null} [filter] BulkMuteFindingsRequest filter + * @property {string|null} [muteAnnotation] BulkMuteFindingsRequest muteAnnotation */ /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new BulkMuteFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a RunAssetDiscoveryResponse. - * @implements IRunAssetDiscoveryResponse + * @classdesc Represents a BulkMuteFindingsRequest. + * @implements IBulkMuteFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set */ - function RunAssetDiscoveryResponse(properties) { + function BulkMuteFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5459,89 +7183,292 @@ } /** - * RunAssetDiscoveryResponse state. - * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * BulkMuteFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @instance */ - RunAssetDiscoveryResponse.prototype.state = 0; + BulkMuteFindingsRequest.prototype.parent = ""; /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * BulkMuteFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @instance */ - RunAssetDiscoveryResponse.prototype.duration = null; + BulkMuteFindingsRequest.prototype.filter = ""; /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * BulkMuteFindingsRequest muteAnnotation. + * @member {string} muteAnnotation + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.muteAnnotation = ""; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance */ - RunAssetDiscoveryResponse.create = function create(properties) { - return new RunAssetDiscoveryResponse(properties); + BulkMuteFindingsRequest.create = function create(properties) { + return new BulkMuteFindingsRequest(properties); }; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encode = function encode(message, writer) { + BulkMuteFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.muteAnnotation != null && Object.hasOwnProperty.call(message, "muteAnnotation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteAnnotation); return writer; }; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.muteAnnotation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkMuteFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkMuteFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + if (!$util.isString(message.muteAnnotation)) + return "muteAnnotation: string expected"; + return null; + }; + + /** + * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + */ + BulkMuteFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.muteAnnotation != null) + message.muteAnnotation = String(object.muteAnnotation); + return message; + }; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} message BulkMuteFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkMuteFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.muteAnnotation = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + object.muteAnnotation = message.muteAnnotation; + return object; + }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BulkMuteFindingsRequest; + })(); + + v1.BulkMuteFindingsResponse = (function() { + + /** + * Properties of a BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IBulkMuteFindingsResponse + */ + + /** + * Constructs a new BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BulkMuteFindingsResponse. + * @implements IBulkMuteFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse=} [properties] Properties to set + */ + function BulkMuteFindingsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new BulkMuteFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse instance + */ + BulkMuteFindingsResponse.create = function create(properties) { + return new BulkMuteFindingsResponse(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + BulkMuteFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decode = function decode(reader, length) { + BulkMuteFindingsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -5551,958 +7478,1207 @@ }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a BulkMuteFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryResponse.verify = function verify(message) { + BulkMuteFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } return null; }; /** - * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse */ - RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + BulkMuteFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "COMPLETED": - case 1: - message.state = 1; - break; - case "SUPERSEDED": - case 2: - message.state = 2; - break; - case "TERMINATED": - case 3: - message.state = 3; - break; - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - return message; + return new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); }; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} message BulkMuteFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.duration = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; + BulkMuteFindingsResponse.toObject = function toObject() { + return {}; }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this BulkMuteFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} COMPLETED=1 COMPLETED value - * @property {number} SUPERSEDED=2 SUPERSEDED value - * @property {number} TERMINATED=3 TERMINATED value - */ - RunAssetDiscoveryResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPLETED"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - values[valuesById[3] = "TERMINATED"] = 3; - return values; - })(); - - return RunAssetDiscoveryResponse; + return BulkMuteFindingsResponse; })(); - v1.SecurityCenter = (function() { + v1.CreateFindingRequest = (function() { /** - * Constructs a new SecurityCenter service. + * Properties of a CreateFindingRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityCenter - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; - - /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. - */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding */ /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "CreateSource" }); + function CreateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding */ + CreateFindingRequest.prototype.parent = ""; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + CreateFindingRequest.prototype.findingId = ""; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateFindingRequest.prototype.finding = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; /** - * Calls CreateNotificationConfig. - * @function createNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { - return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); - }, "name", { value: "CreateNotificationConfig" }); + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls CreateNotificationConfig. - * @function createNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef DeleteNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls DeleteNotificationConfig. - * @function deleteNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { - return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteNotificationConfig" }); + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls DeleteNotificationConfig. - * @function deleteNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + return message; + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + return object; + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFindingRequest; + })(); + + v1.CreateMuteConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + * Properties of a CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateMuteConfigRequest + * @property {string|null} [parent] CreateMuteConfigRequest parent + * @property {google.cloud.securitycenter.v1.IMuteConfig|null} [muteConfig] CreateMuteConfigRequest muteConfig + * @property {string|null} [muteConfigId] CreateMuteConfigRequest muteConfigId */ /** - * Calls GetNotificationConfig. - * @function getNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig - * @returns {undefined} - * @variation 1 + * Constructs a new CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateMuteConfigRequest. + * @implements ICreateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { - return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); - }, "name", { value: "GetNotificationConfig" }); + function CreateMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetNotificationConfig. - * @function getNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateMuteConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateMuteConfigRequest.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * CreateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance */ + CreateMuteConfigRequest.prototype.muteConfig = null; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateMuteConfigRequest muteConfigId. + * @member {string} muteConfigId + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + CreateMuteConfigRequest.prototype.muteConfigId = ""; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest instance */ + CreateMuteConfigRequest.create = function create(properties) { + return new CreateMuteConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateMuteConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.muteConfigId != null && Object.hasOwnProperty.call(message, "muteConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteConfigId); + return writer; + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "GetSource" }); + CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + case 3: + message.muteConfigId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * Verifies a CreateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + CreateMuteConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfig); + if (error) + return "muteConfig." + error; + } + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + if (!$util.isString(message.muteConfigId)) + return "muteConfigId: string expected"; + return null; + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest */ + CreateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfig); + } + if (object.muteConfigId != null) + message.muteConfigId = String(object.muteConfigId); + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateMuteConfigRequest} message CreateMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.muteConfig = null; + object.muteConfigId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfig, options); + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + object.muteConfigId = message.muteConfigId; + return object; + }; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); + CreateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return CreateMuteConfigRequest; + })(); + + v1.CreateNotificationConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig */ /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); + function CreateNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateNotificationConfigRequest.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance */ + CreateNotificationConfigRequest.prototype.configId = ""; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + CreateNotificationConfigRequest.prototype.notificationConfig = null; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListNotificationConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls ListNotificationConfigs. - * @function listNotificationConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { - return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse, request, callback); - }, "name", { value: "ListNotificationConfigs" }); + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListNotificationConfigs. - * @function listNotificationConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.configId = reader.string(); + break; + case 3: + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + CreateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.notificationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateNotificationConfigRequest; + })(); + + v1.CreateSourceRequest = (function() { /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + CreateSourceRequest.prototype.parent = ""; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSourceRequest.prototype.source = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + return message; + }; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + return object; + }; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1.DeleteMuteConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + * Properties of a DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteMuteConfigRequest + * @property {string|null} [name] DeleteMuteConfigRequest name */ /** - * Calls UpdateNotificationConfig. - * @function updateNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig - * @returns {undefined} - * @variation 1 + * Constructs a new DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteMuteConfigRequest. + * @implements IDeleteMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { - return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); - }, "name", { value: "UpdateNotificationConfig" }); + function DeleteMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateNotificationConfig. - * @function updateNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * DeleteMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DeleteMuteConfigRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest instance */ + DeleteMuteConfigRequest.create = function create(properties) { + return new DeleteMuteConfigRequest(properties); + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); + DeleteMuteConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + DeleteMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DeleteMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "UpdateSource" }); + DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a DeleteMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + DeleteMuteConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + * Creates a DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest */ + DeleteMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} message DeleteMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); + DeleteMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this DeleteMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SecurityCenter; + return DeleteMuteConfigRequest; })(); - v1.CreateFindingRequest = (function() { + v1.DeleteNotificationConfigRequest = (function() { /** - * Properties of a CreateFindingRequest. + * Properties of a DeleteNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name */ /** - * Constructs a new CreateFindingRequest. + * Constructs a new DeleteNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set */ - function CreateFindingRequest(properties) { + function DeleteNotificationConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6510,101 +8686,75 @@ } /** - * CreateFindingRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @instance */ - CreateFindingRequest.prototype.finding = null; + DeleteNotificationConfigRequest.prototype.name = ""; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); }; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encode = function encode(message, writer) { + DeleteNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + DeleteNotificationConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6615,131 +8765,107 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies a DeleteNotificationConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { + DeleteNotificationConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } + var message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { + DeleteNotificationConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.findingId = ""; - object.finding = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this DeleteNotificationConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; + return DeleteNotificationConfigRequest; })(); - v1.CreateNotificationConfigRequest = (function() { + v1.GetMuteConfigRequest = (function() { /** - * Properties of a CreateNotificationConfigRequest. + * Properties of a GetMuteConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateNotificationConfigRequest - * @property {string|null} [parent] CreateNotificationConfigRequest parent - * @property {string|null} [configId] CreateNotificationConfigRequest configId - * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + * @interface IGetMuteConfigRequest + * @property {string|null} [name] GetMuteConfigRequest name */ /** - * Constructs a new CreateNotificationConfigRequest. + * Constructs a new GetMuteConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateNotificationConfigRequest. - * @implements ICreateNotificationConfigRequest + * @classdesc Represents a GetMuteConfigRequest. + * @implements IGetMuteConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set */ - function CreateNotificationConfigRequest(properties) { + function GetMuteConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6747,101 +8873,75 @@ } /** - * CreateNotificationConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.parent = ""; - - /** - * CreateNotificationConfigRequest configId. - * @member {string} configId - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.configId = ""; - - /** - * CreateNotificationConfigRequest notificationConfig. - * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * GetMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @instance */ - CreateNotificationConfigRequest.prototype.notificationConfig = null; + GetMuteConfigRequest.prototype.name = ""; /** - * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * Creates a new GetMuteConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest instance */ - CreateNotificationConfigRequest.create = function create(properties) { - return new CreateNotificationConfigRequest(properties); + GetMuteConfigRequest.create = function create(properties) { + return new GetMuteConfigRequest(properties); }; /** - * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNotificationConfigRequest.encode = function encode(message, writer) { + GetMuteConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); - if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) - $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNotificationConfigRequest.decode = function decode(reader, length) { + GetMuteConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetMuteConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.configId = reader.string(); - break; - case 3: - message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6852,130 +8952,107 @@ }; /** - * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateNotificationConfigRequest message. + * Verifies a GetMuteConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateNotificationConfigRequest.verify = function verify(message) { + GetMuteConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.configId != null && message.hasOwnProperty("configId")) - if (!$util.isString(message.configId)) - return "configId: string expected"; - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { - var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); - if (error) - return "notificationConfig." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest */ - CreateNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + GetMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetMuteConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.configId != null) - message.configId = String(object.configId); - if (object.notificationConfig != null) { - if (typeof object.notificationConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notificationConfig: object expected"); - message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); - } + var message = new $root.google.cloud.securitycenter.v1.GetMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {google.cloud.securitycenter.v1.GetMuteConfigRequest} message GetMuteConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateNotificationConfigRequest.toObject = function toObject(message, options) { + GetMuteConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.configId = ""; - object.notificationConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.configId != null && message.hasOwnProperty("configId")) - object.configId = message.configId; - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) - object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateNotificationConfigRequest to JSON. + * Converts this GetMuteConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @instance * @returns {Object.} JSON object */ - CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + GetMuteConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateNotificationConfigRequest; + return GetMuteConfigRequest; })(); - v1.CreateSourceRequest = (function() { + v1.GetNotificationConfigRequest = (function() { /** - * Properties of a CreateSourceRequest. + * Properties of a GetNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name */ /** - * Constructs a new CreateSourceRequest. + * Constructs a new GetNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set */ - function CreateSourceRequest(properties) { + function GetNotificationConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6983,88 +9060,75 @@ } /** - * CreateSourceRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.parent = ""; - - /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @instance */ - CreateSourceRequest.prototype.source = null; + GetNotificationConfigRequest.prototype.name = ""; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * Creates a new GetNotificationConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest instance */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); }; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encode = function encode(message, writer) { + GetNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decode = function decode(reader, length) { + GetNotificationConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -7075,121 +9139,107 @@ }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSourceRequest message. + * Verifies a GetNotificationConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSourceRequest.verify = function verify(message) { + GetNotificationConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); - if (error) - return "source." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); - } + var message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {google.cloud.securitycenter.v1.GetNotificationConfigRequest} message GetNotificationConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSourceRequest.toObject = function toObject(message, options) { + GetNotificationConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.source = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this GetNotificationConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @instance * @returns {Object.} JSON object */ - CreateSourceRequest.prototype.toJSON = function toJSON() { + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateSourceRequest; + return GetNotificationConfigRequest; })(); - v1.DeleteNotificationConfigRequest = (function() { + v1.GetOrganizationSettingsRequest = (function() { /** - * Properties of a DeleteNotificationConfigRequest. + * Properties of a GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteNotificationConfigRequest - * @property {string|null} [name] DeleteNotificationConfigRequest name + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name */ /** - * Constructs a new DeleteNotificationConfigRequest. + * Constructs a new GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a DeleteNotificationConfigRequest. - * @implements IDeleteNotificationConfigRequest + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - function DeleteNotificationConfigRequest(properties) { + function GetOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7197,35 +9247,35 @@ } /** - * DeleteNotificationConfigRequest name. + * GetOrganizationSettingsRequest name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance */ - DeleteNotificationConfigRequest.prototype.name = ""; + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ - DeleteNotificationConfigRequest.create = function create(properties) { - return new DeleteNotificationConfigRequest(properties); + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); }; /** - * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNotificationConfigRequest.encode = function encode(message, writer) { + GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -7234,33 +9284,33 @@ }; /** - * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNotificationConfigRequest.decode = function decode(reader, length) { + GetOrganizationSettingsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -7276,30 +9326,30 @@ }; /** - * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteNotificationConfigRequest message. + * Verifies a GetOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteNotificationConfigRequest.verify = function verify(message) { + GetOrganizationSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -7309,32 +9359,32 @@ }; /** - * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ - DeleteNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteNotificationConfigRequest.toObject = function toObject(message, options) { + GetOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -7346,37 +9396,37 @@ }; /** - * Converts this DeleteNotificationConfigRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance * @returns {Object.} JSON object */ - DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteNotificationConfigRequest; + return GetOrganizationSettingsRequest; })(); - v1.GetNotificationConfigRequest = (function() { + v1.GetSourceRequest = (function() { /** - * Properties of a GetNotificationConfigRequest. + * Properties of a GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGetNotificationConfigRequest - * @property {string|null} [name] GetNotificationConfigRequest name + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Constructs a new GetNotificationConfigRequest. + * Constructs a new GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetNotificationConfigRequest. - * @implements IGetNotificationConfigRequest + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set */ - function GetNotificationConfigRequest(properties) { + function GetSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7384,35 +9434,35 @@ } /** - * GetNotificationConfigRequest name. + * GetSourceRequest name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance */ - GetNotificationConfigRequest.prototype.name = ""; + GetSourceRequest.prototype.name = ""; /** - * Creates a new GetNotificationConfigRequest instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance */ - GetNotificationConfigRequest.create = function create(properties) { - return new GetNotificationConfigRequest(properties); + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); }; /** - * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationConfigRequest.encode = function encode(message, writer) { + GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -7421,33 +9471,33 @@ }; /** - * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationConfigRequest.decode = function decode(reader, length) { + GetSourceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -7463,30 +9513,30 @@ }; /** - * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNotificationConfigRequest message. + * Verifies a GetSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNotificationConfigRequest.verify = function verify(message) { + GetSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -7496,32 +9546,32 @@ }; /** - * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest */ - GetNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest) + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.GetNotificationConfigRequest} message GetNotificationConfigRequest + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNotificationConfigRequest.toObject = function toObject(message, options) { + GetSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -7533,37 +9583,43 @@ }; /** - * Converts this GetNotificationConfigRequest to JSON. + * Converts this GetSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance * @returns {Object.} JSON object */ - GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + GetSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetNotificationConfigRequest; + return GetSourceRequest; })(); - v1.GetOrganizationSettingsRequest = (function() { + v1.GroupAssetsRequest = (function() { /** - * Properties of a GetOrganizationSettingsRequest. + * Properties of a GroupAssetsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize */ /** - * Constructs a new GetOrganizationSettingsRequest. + * Constructs a new GroupAssetsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set */ - function GetOrganizationSettingsRequest(properties) { + function GroupAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7571,75 +9627,153 @@ } /** - * GetOrganizationSettingsRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance */ - GetOrganizationSettingsRequest.prototype.name = ""; + GroupAssetsRequest.prototype.parent = ""; /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { + GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decode = function decode(reader, length) { + GroupAssetsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7650,107 +9784,170 @@ }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetOrganizationSettingsRequest.verify = function verify(message) { + GroupAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationSettingsRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance * @returns {Object.} JSON object */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + GroupAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetOrganizationSettingsRequest; + return GroupAssetsRequest; })(); - v1.GetSourceRequest = (function() { + v1.GroupAssetsResponse = (function() { /** - * Properties of a GetSourceRequest. + * Properties of a GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize */ /** - * Constructs a new GetSourceRequest. + * Constructs a new GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set */ - function GetSourceRequest(properties) { + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7758,75 +9955,117 @@ } /** - * GetSourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - GetSourceRequest.prototype.name = ""; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * Creates a new GetSourceRequest instance using the specified properties. + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + GroupAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + GroupAssetsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7837,113 +10076,161 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + GroupAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + GroupAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this GroupAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + GroupAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; + return GroupAssetsResponse; })(); - v1.GroupAssetsRequest = (function() { + v1.GroupFindingsRequest = (function() { /** - * Properties of a GroupAssetsRequest. + * Properties of a GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize */ /** - * Constructs a new GroupAssetsRequest. + * Constructs a new GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set */ - function GroupAssetsRequest(properties) { + function GroupFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7951,83 +10238,83 @@ } /** - * GroupAssetsRequest parent. + * GroupFindingsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.parent = ""; + GroupFindingsRequest.prototype.parent = ""; /** - * GroupAssetsRequest filter. + * GroupFindingsRequest filter. * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.filter = ""; + GroupFindingsRequest.prototype.filter = ""; /** - * GroupAssetsRequest groupBy. + * GroupFindingsRequest groupBy. * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.groupBy = ""; + GroupFindingsRequest.prototype.groupBy = ""; /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.compareDuration = null; + GroupFindingsRequest.prototype.readTime = null; /** - * GroupAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.readTime = null; + GroupFindingsRequest.prototype.compareDuration = null; /** - * GroupAssetsRequest pageToken. + * GroupFindingsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.pageToken = ""; + GroupFindingsRequest.prototype.pageToken = ""; /** - * GroupAssetsRequest pageSize. + * GroupFindingsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.pageSize = 0; + GroupFindingsRequest.prototype.pageSize = 0; /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -8036,10 +10323,10 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -8048,33 +10335,33 @@ }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + GroupFindingsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8088,10 +10375,10 @@ message.groupBy = reader.string(); break; case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 7: message.pageToken = reader.string(); @@ -8108,30 +10395,30 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + GroupFindingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -8143,16 +10430,16 @@ if (message.groupBy != null && message.hasOwnProperty("groupBy")) if (!$util.isString(message.groupBy)) return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } if (message.readTime != null && message.hasOwnProperty("readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) return "readTime." + error; } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -8163,33 +10450,33 @@ }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.filter != null) message.filter = String(object.filter); if (object.groupBy != null) message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -8198,15 +10485,15 @@ }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -8214,8 +10501,8 @@ object.parent = ""; object.filter = ""; object.groupBy = ""; - object.compareDuration = null; object.readTime = null; + object.compareDuration = null; object.pageToken = ""; object.pageSize = 0; } @@ -8225,10 +10512,10 @@ object.filter = message.filter; if (message.groupBy != null && message.hasOwnProperty("groupBy")) object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -8237,40 +10524,40 @@ }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + return GroupFindingsRequest; })(); - v1.GroupAssetsResponse = (function() { + v1.GroupFindingsResponse = (function() { /** - * Properties of a GroupAssetsResponse. + * Properties of a GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken - * @property {number|null} [totalSize] GroupAssetsResponse totalSize + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize */ /** - * Constructs a new GroupAssetsResponse. + * Constructs a new GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { + function GroupFindingsResponse(properties) { this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -8279,59 +10566,59 @@ } /** - * GroupAssetsResponse groupByResults. + * GroupFindingsResponse groupByResults. * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; /** - * GroupAssetsResponse readTime. + * GroupFindingsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.readTime = null; + GroupFindingsResponse.prototype.readTime = null; /** - * GroupAssetsResponse nextPageToken. + * GroupFindingsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + GroupFindingsResponse.prototype.nextPageToken = ""; /** - * GroupAssetsResponse totalSize. + * GroupFindingsResponse totalSize. * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.totalSize = 0; + GroupFindingsResponse.prototype.totalSize = 0; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.groupByResults != null && message.groupByResults.length) @@ -8347,33 +10634,33 @@ }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + GroupFindingsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8400,30 +10687,30 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + GroupFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { @@ -8450,30 +10737,30 @@ }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); if (object.groupByResults) { if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); message.groupByResults = []; for (var i = 0; i < object.groupByResults.length; ++i) { if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.nextPageToken != null) @@ -8484,15 +10771,15 @@ }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + GroupFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -8518,43 +10805,39 @@ }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; + return GroupFindingsResponse; })(); - v1.GroupFindingsRequest = (function() { + v1.GroupResult = (function() { /** - * Properties of a GroupFindingsRequest. + * Properties of a GroupResult. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new GroupFindingsRequest. + * Constructs a new GroupResult. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set */ - function GroupFindingsRequest(properties) { + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8562,153 +10845,110 @@ } /** - * GroupFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; - - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; - - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; - - /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.readTime = null; - - /** - * GroupFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.compareDuration = null; - - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - GroupFindingsRequest.prototype.pageToken = ""; + GroupResult.prototype.properties = $util.emptyObject; /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - GroupFindingsRequest.prototype.pageSize = 0; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupFindingsRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encode = function encode(message, writer) { + GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decode = function decode(reader, length) { + GroupResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -8719,170 +10959,151 @@ }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsRequest message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsRequest.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsRequest.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.compareDuration = null; - object.pageToken = ""; - object.pageSize = 0; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this GroupResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance * @returns {Object.} JSON object */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsRequest; + return GroupResult; })(); - v1.GroupFindingsResponse = (function() { + v1.ListMuteConfigsRequest = (function() { /** - * Properties of a GroupFindingsResponse. + * Properties of a ListMuteConfigsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - * @property {number|null} [totalSize] GroupFindingsResponse totalSize + * @interface IListMuteConfigsRequest + * @property {string|null} [parent] ListMuteConfigsRequest parent + * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize + * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken */ /** - * Constructs a new GroupFindingsResponse. + * Constructs a new ListMuteConfigsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse + * @classdesc Represents a ListMuteConfigsRequest. + * @implements IListMuteConfigsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; + function ListMuteConfigsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8890,117 +11111,101 @@ } /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListMuteConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance */ - GroupFindingsResponse.prototype.readTime = null; + ListMuteConfigsRequest.prototype.parent = ""; /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListMuteConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance */ - GroupFindingsResponse.prototype.nextPageToken = ""; + ListMuteConfigsRequest.prototype.pageSize = 0; /** - * GroupFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListMuteConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance */ - GroupFindingsResponse.prototype.totalSize = 0; + ListMuteConfigsRequest.prototype.pageToken = ""; /** - * Creates a new GroupFindingsResponse instance using the specified properties. + * Creates a new ListMuteConfigsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest instance */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); + ListMuteConfigsRequest.create = function create(properties) { + return new ListMuteConfigsRequest(properties); }; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encode = function encode(message, writer) { + ListMuteConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decode = function decode(reader, length) { + ListMuteConfigsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9011,157 +11216,126 @@ }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsResponse message. + * Verifies a ListMuteConfigsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsResponse.verify = function verify(message) { + ListMuteConfigsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + ListMuteConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListMuteConfigsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {google.cloud.securitycenter.v1.ListMuteConfigsRequest} message ListMuteConfigsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsResponse.toObject = function toObject(message, options) { + ListMuteConfigsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GroupFindingsResponse to JSON. + * Converts this ListMuteConfigsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance * @returns {Object.} JSON object */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { + ListMuteConfigsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsResponse; + return ListMuteConfigsRequest; })(); - v1.GroupResult = (function() { + v1.ListMuteConfigsResponse = (function() { /** - * Properties of a GroupResult. + * Properties of a ListMuteConfigsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * @interface IListMuteConfigsResponse + * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs + * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken */ /** - * Constructs a new GroupResult. + * Constructs a new ListMuteConfigsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult + * @classdesc Represents a ListMuteConfigsResponse. + * @implements IListMuteConfigsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set */ - function GroupResult(properties) { - this.properties = {}; + function ListMuteConfigsResponse(properties) { + this.muteConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9169,110 +11343,91 @@ } /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListMuteConfigsResponse muteConfigs. + * @member {Array.} muteConfigs + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @instance */ - GroupResult.prototype.properties = $util.emptyObject; + ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListMuteConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @instance */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListMuteConfigsResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupResult instance using the specified properties. + * Creates a new ListMuteConfigsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse instance */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); + ListMuteConfigsResponse.create = function create(properties) { + return new ListMuteConfigsResponse(properties); }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encode = function encode(message, writer) { + ListMuteConfigsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.muteConfigs != null && message.muteConfigs.length) + for (var i = 0; i < message.muteConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupResult message from the specified reader or buffer. + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decode = function decode(reader, length) { + ListMuteConfigsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (message.properties === $util.emptyObject) - message.properties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.properties[key] = value; + if (!(message.muteConfigs && message.muteConfigs.length)) + message.muteConfigs = []; + message.muteConfigs.push($root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32())); break; case 2: - message.count = reader.int64(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9283,129 +11438,113 @@ }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { + ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupResult message. + * Verifies a ListMuteConfigsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupResult.verify = function verify(message) { + ListMuteConfigsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (message.muteConfigs != null && message.hasOwnProperty("muteConfigs")) { + if (!Array.isArray(message.muteConfigs)) + return "muteConfigs: array expected"; + for (var i = 0; i < message.muteConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfigs[i]); if (error) - return "properties." + error; + return "muteConfigs." + error; } } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + ListMuteConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse(); + if (object.muteConfigs) { + if (!Array.isArray(object.muteConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.ListMuteConfigsResponse.muteConfigs: array expected"); + message.muteConfigs = []; + for (var i = 0; i < object.muteConfigs.length; ++i) { + if (typeof object.muteConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListMuteConfigsResponse.muteConfigs: object expected"); + message.muteConfigs[i] = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfigs[i]); } } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} message ListMuteConfigsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupResult.toObject = function toObject(message, options) { + ListMuteConfigsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.properties = {}; + if (options.arrays || options.defaults) + object.muteConfigs = []; if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + object.nextPageToken = ""; + if (message.muteConfigs && message.muteConfigs.length) { + object.muteConfigs = []; + for (var j = 0; j < message.muteConfigs.length; ++j) + object.muteConfigs[j] = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfigs[j], options); } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GroupResult to JSON. + * Converts this ListMuteConfigsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @instance * @returns {Object.} JSON object */ - GroupResult.prototype.toJSON = function toJSON() { + ListMuteConfigsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupResult; + return ListMuteConfigsResponse; })(); v1.ListNotificationConfigsRequest = (function() { @@ -12517,29 +14656,283 @@ return ListFindingsResult; })(); - return ListFindingsResponse; + return ListFindingsResponse; + })(); + + v1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetFindingStateRequest; })(); - v1.SetFindingStateRequest = (function() { + v1.SetMuteRequest = (function() { /** - * Properties of a SetFindingStateRequest. + * Properties of a SetMuteRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state - * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + * @interface ISetMuteRequest + * @property {string|null} [name] SetMuteRequest name + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] SetMuteRequest mute */ /** - * Constructs a new SetFindingStateRequest. + * Constructs a new SetMuteRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest + * @classdesc Represents a SetMuteRequest. + * @implements ISetMuteRequest * @constructor - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set */ - function SetFindingStateRequest(properties) { + function SetMuteRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12547,90 +14940,80 @@ } /** - * SetFindingStateRequest name. + * SetMuteRequest name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.name = ""; - - /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @instance */ - SetFindingStateRequest.prototype.state = 0; + SetMuteRequest.prototype.name = ""; /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * SetMuteRequest mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @instance */ - SetFindingStateRequest.prototype.startTime = null; + SetMuteRequest.prototype.mute = 0; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new SetMuteRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest instance */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); + SetMuteRequest.create = function create(properties) { + return new SetMuteRequest(properties); }; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} message SetMuteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encode = function encode(message, writer) { + SetMuteRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); return writer; }; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} message SetMuteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a SetMuteRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decode = function decode(reader, length) { + SetMuteRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12638,10 +15021,7 @@ message.name = reader.string(); break; case 2: - message.state = reader.int32(); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.mute = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12652,127 +15032,119 @@ }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetFindingStateRequest message. + * Verifies a SetMuteRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetFindingStateRequest.verify = function verify(message) { + SetMuteRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { default: - return "state: enum value expected"; + return "mute: enum value expected"; case 0: case 1: case 2: + case 4: break; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } return null; }; /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + SetMuteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetMuteRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + var message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); if (object.name != null) message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": + switch (object.mute) { + case "MUTE_UNSPECIFIED": case 0: - message.state = 0; + message.mute = 0; break; - case "ACTIVE": + case "MUTED": case 1: - message.state = 1; + message.mute = 1; break; - case "INACTIVE": + case "UNMUTED": case 2: - message.state = 2; + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } return message; }; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {google.cloud.securitycenter.v1.SetMuteRequest} message SetMuteRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetFindingStateRequest.toObject = function toObject(message, options) { + SetMuteRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.startTime = null; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; return object; }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this SetMuteRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @instance * @returns {Object.} JSON object */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { + SetMuteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetFindingStateRequest; + return SetMuteRequest; })(); v1.RunAssetDiscoveryRequest = (function() { @@ -13182,6 +15554,226 @@ return UpdateFindingRequest; })(); + v1.UpdateMuteConfigRequest = (function() { + + /** + * Properties of an UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateMuteConfigRequest + * @property {google.cloud.securitycenter.v1.IMuteConfig|null} [muteConfig] UpdateMuteConfigRequest muteConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMuteConfigRequest updateMask + */ + + /** + * Constructs a new UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateMuteConfigRequest. + * @implements IUpdateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest=} [properties] Properties to set + */ + function UpdateMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.muteConfig = null; + + /** + * UpdateMuteConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest instance + */ + UpdateMuteConfigRequest.create = function create(properties) { + return new UpdateMuteConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} message UpdateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMuteConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} message UpdateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMuteConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfig); + if (error) + return "muteConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + */ + UpdateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest(); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateMuteConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} message UpdateMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.muteConfig = null; + object.updateMask = null; + } + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateMuteConfigRequest; + })(); + v1.UpdateNotificationConfigRequest = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index 5f68213c..7ab735d4 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -203,6 +203,10 @@ "type": "string", "id": 14 }, + "mute": { + "type": "Mute", + "id": 15 + }, "findingClass": { "type": "FindingClass", "id": 17 @@ -214,6 +218,17 @@ "vulnerability": { "type": "Vulnerability", "id": 20 + }, + "muteUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "muteInitiator": { + "type": "string", + "id": 28 } }, "nested": { @@ -233,6 +248,14 @@ "LOW": 4 } }, + "Mute": { + "values": { + "MUTE_UNSPECIFIED": 0, + "MUTED": 1, + "UNMUTED": 2, + "UNDEFINED": 4 + } + }, "FindingClass": { "values": { "FINDING_CLASS_UNSPECIFIED": 0, @@ -383,6 +406,57 @@ } } }, + "MuteConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", + "(google.api.resource).pattern": "projects/{project}/muteConfigs/{mute_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "description": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mostRecentEditor": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "NotificationConfig": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", @@ -574,6 +648,46 @@ "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { + "BulkMuteFindings": { + "requestType": "BulkMuteFindingsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/findings:bulkMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/findings:bulkMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1.BulkMuteFindingsResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/findings:bulkMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/findings:bulkMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1.BulkMuteFindingsResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, "CreateSource": { "requestType": "CreateSourceRequest", "responseType": "Source", @@ -614,6 +728,41 @@ } ] }, + "CreateMuteConfig": { + "requestType": "CreateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/muteConfigs", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/muteConfigs", + "body": "mute_config", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=projects/*}/muteConfigs", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,mute_config" + }, + { + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + } + ] + }, "CreateNotificationConfig": { "requestType": "CreateNotificationConfigRequest", "responseType": "NotificationConfig", @@ -637,6 +786,33 @@ } ] }, + "DeleteMuteConfig": { + "requestType": "DeleteMuteConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/muteConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/muteConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "DeleteNotificationConfig": { "requestType": "DeleteNotificationConfigRequest", "responseType": "google.protobuf.Empty", @@ -675,6 +851,33 @@ } ] }, + "GetMuteConfig": { + "requestType": "GetMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/muteConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/muteConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "GetNotificationConfig": { "requestType": "GetNotificationConfigRequest", "responseType": "NotificationConfig", @@ -835,6 +1038,33 @@ } ] }, + "ListMuteConfigs": { + "requestType": "ListMuteConfigsRequest", + "responseType": "ListMuteConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/muteConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/muteConfigs", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/muteConfigs" + }, + { + "get": "/v1/{parent=projects/*}/muteConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, "ListNotificationConfigs": { "requestType": "ListNotificationConfigsRequest", "responseType": "ListNotificationConfigsResponse", @@ -940,6 +1170,38 @@ } ] }, + "SetMute": { + "requestType": "SetMuteRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/sources/*/findings/*}:setMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,mute" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=organizations/*/sources/*/findings/*}:setMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,mute" + } + ] + }, "SetIamPolicy": { "requestType": "google.iam.v1.SetIamPolicyRequest", "responseType": "google.iam.v1.Policy", @@ -1012,6 +1274,38 @@ } ] }, + "UpdateMuteConfig": { + "requestType": "UpdateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).patch": "/v1/{mute_config.name=organizations/*/muteConfigs/*}", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.patch": "/v1/{mute_config.name=projects/*/muteConfigs/*}", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.method_signature)": "mute_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mute_config.name=organizations/*/muteConfigs/*}", + "body": "mute_config", + "additional_bindings": [ + { + "patch": "/v1/{mute_config.name=folders/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v1/{mute_config.name=projects/*/muteConfigs/*}", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "mute_config,update_mask" + } + ] + }, "UpdateNotificationConfig": { "requestType": "UpdateNotificationConfigRequest", "responseType": "NotificationConfig", @@ -1121,6 +1415,32 @@ } } }, + "BulkMuteFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "muteAnnotation": { + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "BulkMuteFindingsResponse": { + "fields": {} + }, "CreateFindingRequest": { "fields": { "parent": { @@ -1147,6 +1467,32 @@ } } }, + "CreateMuteConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/MuteConfig" + } + }, + "muteConfig": { + "type": "MuteConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "muteConfigId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "CreateNotificationConfigRequest": { "fields": { "parent": { @@ -1192,6 +1538,18 @@ } } }, + "DeleteMuteConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, "DeleteNotificationConfigRequest": { "fields": { "name": { @@ -1204,6 +1562,18 @@ } } }, + "GetMuteConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, "GetNotificationConfigRequest": { "fields": { "name": { @@ -1373,6 +1743,39 @@ } } }, + "ListMuteConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/MuteConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListMuteConfigsResponse": { + "fields": { + "muteConfigs": { + "rule": "repeated", + "type": "MuteConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "ListNotificationConfigsRequest": { "fields": { "parent": { @@ -1680,6 +2083,25 @@ } } }, + "SetMuteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "mute": { + "type": "Finding.Mute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "RunAssetDiscoveryRequest": { "fields": { "parent": { @@ -1707,6 +2129,21 @@ } } }, + "UpdateMuteConfigRequest": { + "fields": { + "muteConfig": { + "type": "MuteConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, "UpdateNotificationConfigRequest": { "fields": { "notificationConfig": { diff --git a/samples/generated/v1/security_center.bulk_mute_findings.js b/samples/generated/v1/security_center.bulk_mute_findings.js new file mode 100644 index 00000000..e54076f7 --- /dev/null +++ b/samples/generated/v1/security_center.bulk_mute_findings.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, at which bulk action needs to be applied. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that identifies findings that should be updated. + * The expression is a list of zero or more restrictions combined + * via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + * has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a + * `-` character in front of them to indicate negation. The fields map to + * those defined in the corresponding resource. + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + */ + // const filter = 'abc123' + /** + * This can be a mute configuration name or any identifier for mute/unmute + * of findings based on the filter. + */ + // const muteAnnotation = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callBulkMuteFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.bulkMuteFindings(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBulkMuteFindings(); + // [END securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/security_center.create_mute_config.js b/samples/generated/v1/security_center.create_mute_config.js new file mode 100644 index 00000000..b92956f5 --- /dev/null +++ b/samples/generated/v1/security_center.create_mute_config.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, muteConfig, muteConfigId) { + // [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new mute configs's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Required. The mute config being created. + */ + // const muteConfig = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + */ + // const muteConfigId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateMuteConfig() { + // Construct request + const request = { + parent, + muteConfig, + muteConfigId, + }; + + // Run request + const response = await securitycenterClient.createMuteConfig(request); + console.log(response); + } + + callCreateMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/security_center.delete_mute_config.js b/samples/generated/v1/security_center.delete_mute_config.js new file mode 100644 index 00000000..e04240aa --- /dev/null +++ b/samples/generated/v1/security_center.delete_mute_config.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the mute config to delete. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteMuteConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteMuteConfig(request); + console.log(response); + } + + callDeleteMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/security_center.get_mute_config.js b/samples/generated/v1/security_center.get_mute_config.js new file mode 100644 index 00000000..d012524c --- /dev/null +++ b/samples/generated/v1/security_center.get_mute_config.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the mute config to retrieve. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetMuteConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getMuteConfig(request); + console.log(response); + } + + callGetMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/security_center.list_mute_configs.js b/samples/generated/v1/security_center.list_mute_configs.js new file mode 100644 index 00000000..60cc9d97 --- /dev/null +++ b/samples/generated/v1/security_center.list_mute_configs.js @@ -0,0 +1,70 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListMuteConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listMuteConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMuteConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/security_center.set_mute.js b/samples/generated/v1/security_center.set_mute.js new file mode 100644 index 00000000..16c225bc --- /dev/null +++ b/samples/generated/v1/security_center.set_mute.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, mute) { + // [START securitycenter_v1_generated_SecurityCenter_SetMute_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", + * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired state of the Mute. + */ + // const mute = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetMute() { + // Construct request + const request = { + name, + mute, + }; + + // Run request + const response = await securitycenterClient.setMute(request); + console.log(response); + } + + callSetMute(); + // [END securitycenter_v1_generated_SecurityCenter_SetMute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/security_center.update_mute_config.js b/samples/generated/v1/security_center.update_mute_config.js new file mode 100644 index 00000000..6744511b --- /dev/null +++ b/samples/generated/v1/security_center.update_mute_config.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(muteConfig) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The mute config being updated. + */ + // const muteConfig = {} + /** + * The list of fields to be updated. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateMuteConfig() { + // Construct request + const request = { + muteConfig, + }; + + // Run request + const response = await securitycenterClient.updateMuteConfig(request); + console.log(response); + } + + callUpdateMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json index 3280f72a..53654b4a 100644 --- a/src/v1/gapic_metadata.json +++ b/src/v1/gapic_metadata.json @@ -20,11 +20,21 @@ "createFinding" ] }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, "CreateNotificationConfig": { "methods": [ "createNotificationConfig" ] }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, "DeleteNotificationConfig": { "methods": [ "deleteNotificationConfig" @@ -35,6 +45,11 @@ "getIamPolicy" ] }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, "GetNotificationConfig": { "methods": [ "getNotificationConfig" @@ -55,6 +70,11 @@ "setFindingState" ] }, + "SetMute": { + "methods": [ + "setMute" + ] + }, "SetIamPolicy": { "methods": [ "setIamPolicy" @@ -70,6 +90,11 @@ "updateFinding" ] }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, "UpdateNotificationConfig": { "methods": [ "updateNotificationConfig" @@ -90,6 +115,11 @@ "updateSecurityMarks" ] }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, "RunAssetDiscovery": { "methods": [ "runAssetDiscovery" @@ -123,6 +153,13 @@ "listFindingsAsync" ] }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, "ListNotificationConfigs": { "methods": [ "listNotificationConfigs", @@ -152,11 +189,21 @@ "createFinding" ] }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, "CreateNotificationConfig": { "methods": [ "createNotificationConfig" ] }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, "DeleteNotificationConfig": { "methods": [ "deleteNotificationConfig" @@ -167,6 +214,11 @@ "getIamPolicy" ] }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, "GetNotificationConfig": { "methods": [ "getNotificationConfig" @@ -187,6 +239,11 @@ "setFindingState" ] }, + "SetMute": { + "methods": [ + "setMute" + ] + }, "SetIamPolicy": { "methods": [ "setIamPolicy" @@ -202,6 +259,11 @@ "updateFinding" ] }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, "UpdateNotificationConfig": { "methods": [ "updateNotificationConfig" @@ -222,6 +284,11 @@ "updateSecurityMarks" ] }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, "RunAssetDiscovery": { "methods": [ "runAssetDiscovery" @@ -255,6 +322,13 @@ "listFindingsAsync" ] }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, "ListNotificationConfigs": { "methods": [ "listNotificationConfigs", diff --git a/src/v1/security_center_client.ts b/src/v1/security_center_client.ts index 62af5bfd..517cb9d6 100644 --- a/src/v1/security_center_client.ts +++ b/src/v1/security_center_client.ts @@ -172,6 +172,9 @@ export class SecurityCenterClient { folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/assets/{asset}/securityMarks' ), + folderMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/muteConfigs/{mute_config}' + ), folderSourcePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}' ), @@ -195,6 +198,9 @@ export class SecurityCenterClient { new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), + organizationMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/muteConfigs/{mute_config}' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), @@ -214,6 +220,9 @@ export class SecurityCenterClient { projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assets/{asset}/securityMarks' ), + projectMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/muteConfigs/{mute_config}' + ), projectSourcePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sources/{source}' ), @@ -250,6 +259,11 @@ export class SecurityCenterClient { 'nextPageToken', 'listFindingsResults' ), + listMuteConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'muteConfigs' + ), listNotificationConfigs: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -274,6 +288,12 @@ export class SecurityCenterClient { grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); + const bulkMuteFindingsResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v1.BulkMuteFindingsResponse' + ) as gax.protobuf.Type; + const bulkMuteFindingsMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; const runAssetDiscoveryResponse = protoFilesRoot.lookup( '.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse' ) as gax.protobuf.Type; @@ -282,6 +302,11 @@ export class SecurityCenterClient { ) as gax.protobuf.Type; this.descriptors.longrunning = { + bulkMuteFindings: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + bulkMuteFindingsResponse.decode.bind(bulkMuteFindingsResponse), + bulkMuteFindingsMetadata.decode.bind(bulkMuteFindingsMetadata) + ), runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), @@ -339,11 +364,15 @@ export class SecurityCenterClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const securityCenterStubMethods = [ + 'bulkMuteFindings', 'createSource', 'createFinding', + 'createMuteConfig', 'createNotificationConfig', + 'deleteMuteConfig', 'deleteNotificationConfig', 'getIamPolicy', + 'getMuteConfig', 'getNotificationConfig', 'getOrganizationSettings', 'getSource', @@ -351,13 +380,16 @@ export class SecurityCenterClient { 'groupFindings', 'listAssets', 'listFindings', + 'listMuteConfigs', 'listNotificationConfigs', 'listSources', 'runAssetDiscovery', 'setFindingState', + 'setMute', 'setIamPolicy', 'testIamPermissions', 'updateFinding', + 'updateMuteConfig', 'updateNotificationConfig', 'updateOrganizationSettings', 'updateSource', @@ -642,6 +674,112 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } + /** + * Creates a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new mute configs's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {google.cloud.securitycenter.v1.MuteConfig} request.muteConfig + * Required. The mute config being created. + * @param {string} request.muteConfigId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async + */ + createMuteConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + createMuteConfig( + request: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createMuteConfig( + request: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createMuteConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMuteConfig(request, options, callback); + } /** * Creates a notification config. * @@ -752,6 +890,106 @@ export class SecurityCenterClient { callback ); } + /** + * Deletes an existing mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to delete. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async + */ + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteMuteConfig(request, options, callback); + } /** * Deletes a notification config. * @@ -941,6 +1179,100 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } + /** + * Gets a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to retrieve. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async + */ + getMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest | undefined, + {} | undefined + ] + >; + getMuteConfig( + request: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMuteConfig( + request: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMuteConfig(request, options, callback); + } /** * Gets a notification config. * @@ -1331,6 +1663,98 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } + /** + * Updates the mute state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", + * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1.Finding.Mute} request.mute + * Required. The desired state of the Mute. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.set_mute.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetMute_async + */ + setMute( + request?: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | undefined, + {} | undefined + ] + >; + setMute( + request: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): void; + setMute( + request: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): void; + setMute( + request?: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetMuteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.setMute(request, options, callback); + } /** * Sets the access control policy on the specified Source. * @@ -1614,6 +2038,106 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } + /** + * Updates a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.MuteConfig} request.muteConfig + * Required. The mute config being updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async + */ + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'mute_config.name': request.muteConfig!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateMuteConfig(request, options, callback); + } /** * * Updates a notification config. The following update @@ -1987,26 +2511,158 @@ export class SecurityCenterClient { optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest - | null - | undefined, + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); + } + + /** + * Kicks off an LRO to bulk mute findings for a parent based on a filter. The + * parent can be either an organization, folder or project. The findings + * matched by the filter will be muted after the LRO is done. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, at which bulk action needs to be applied. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {string} request.filter + * Expression that identifies findings that should be updated. + * The expression is a list of zero or more restrictions combined + * via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + * has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a + * `-` character in front of them to indicate negation. The fields map to + * those defined in the corresponding resource. + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * @param {string} request.muteAnnotation + * This can be a mute configuration name or any identifier for mute/unmute + * of findings based on the filter. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async + */ + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest - | null - | undefined, + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.securitycenter.v1.ISecurityMarks, - ( - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest - | undefined - ), + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -2023,12 +2679,45 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', + parent: request.parent || '', }); this.initialize(); - return this.innerApiCalls.updateSecurityMarks(request, options, callback); + return this.innerApiCalls.bulkMuteFindings(request, options, callback); + } + /** + * Check the status of the long running operation returned by `bulkMuteFindings()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async + */ + async checkBulkMuteFindingsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, + protos.google.protobuf.Empty + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.bulkMuteFindings, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, + protos.google.protobuf.Empty + >; } - /** * Runs asset discovery. The discovery is tracked with a long-running * operation. @@ -4426,6 +5115,222 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists mute configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMuteConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ] + >; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): void; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): void; + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMuteConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMuteConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMuteConfigsStream( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMuteConfigs.createStream( + this.innerApiCalls.listMuteConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMuteConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_mute_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async + */ + listMuteConfigsAsync( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMuteConfigs.asyncIterate( + this.innerApiCalls['listMuteConfigs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } /** * Lists notification configs. * @@ -4921,6 +5826,46 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified folderMuteConfig resource name string. + * + * @param {string} folder + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderMuteConfigPath(folder: string, muteConfig: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.render({ + folder: folder, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderMuteConfig resource. + * + * @param {string} folderMuteConfigName + * A fully-qualified path representing folder_mute_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMuteConfigName(folderMuteConfigName: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.match( + folderMuteConfigName + ).folder; + } + + /** + * Parse the mute_config from FolderMuteConfig resource. + * + * @param {string} folderMuteConfigName + * A fully-qualified path representing folder_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderMuteConfigName(folderMuteConfigName: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.match( + folderMuteConfigName + ).mute_config; + } + /** * Return a fully-qualified folderSource resource name string. * @@ -5233,6 +6178,50 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified organizationMuteConfig resource name string. + * + * @param {string} organization + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationMuteConfigPath(organization: string, muteConfig: string) { + return this.pathTemplates.organizationMuteConfigPathTemplate.render({ + organization: organization, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationMuteConfig resource. + * + * @param {string} organizationMuteConfigName + * A fully-qualified path representing organization_mute_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMuteConfigName( + organizationMuteConfigName: string + ) { + return this.pathTemplates.organizationMuteConfigPathTemplate.match( + organizationMuteConfigName + ).organization; + } + + /** + * Parse the mute_config from OrganizationMuteConfig resource. + * + * @param {string} organizationMuteConfigName + * A fully-qualified path representing organization_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationMuteConfigName( + organizationMuteConfigName: string + ) { + return this.pathTemplates.organizationMuteConfigPathTemplate.match( + organizationMuteConfigName + ).mute_config; + } + /** * Return a fully-qualified organizationSettings resource name string. * @@ -5514,6 +6503,46 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified projectMuteConfig resource name string. + * + * @param {string} project + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectMuteConfigPath(project: string, muteConfig: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.render({ + project: project, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectMuteConfig resource. + * + * @param {string} projectMuteConfigName + * A fully-qualified path representing project_mute_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMuteConfigName(projectMuteConfigName: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.match( + projectMuteConfigName + ).project; + } + + /** + * Parse the mute_config from ProjectMuteConfig resource. + * + * @param {string} projectMuteConfigName + * A fully-qualified path representing project_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectMuteConfigName(projectMuteConfigName: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.match( + projectMuteConfigName + ).mute_config; + } + /** * Return a fully-qualified projectSource resource name string. * diff --git a/src/v1/security_center_client_config.json b/src/v1/security_center_client_config.json index dbb23072..f42e8c7d 100644 --- a/src/v1/security_center_client_config.json +++ b/src/v1/security_center_client_config.json @@ -20,6 +20,10 @@ } }, "methods": { + "BulkMuteFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateSource": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -30,11 +34,19 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CreateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "DeleteMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -45,6 +57,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "GetMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -80,6 +96,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "ListMuteConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListNotificationConfigs": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -100,6 +120,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "SetMute": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "SetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -115,6 +139,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "UpdateNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/src/v1/security_center_proto_list.json b/src/v1/security_center_proto_list.json index dbee8391..a32f4658 100644 --- a/src/v1/security_center_proto_list.json +++ b/src/v1/security_center_proto_list.json @@ -3,6 +3,7 @@ "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", + "../../protos/google/cloud/securitycenter/v1/mute_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", diff --git a/test/gapic_security_center_v1.ts b/test/gapic_security_center_v1.ts index 0b3e41f4..080ff5d2 100644 --- a/test/gapic_security_center_v1.ts +++ b/test/gapic_security_center_v1.ts @@ -449,15 +449,15 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', async () => { + describe('createMuteConfig', () => { + it('invokes createMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -469,27 +469,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.createNotificationConfig = - stubSimpleCall(expectedResponse); - const [response] = await client.createNotificationConfig(request); + client.innerApiCalls.createMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) + (client.innerApiCalls.createMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createNotificationConfig without error using callback', async () => { + it('invokes createMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -501,16 +500,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.createNotificationConfig = + client.innerApiCalls.createMuteConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createNotificationConfig( + client.createMuteConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null ) => { if (err) { reject(err); @@ -523,20 +522,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) + (client.innerApiCalls.createMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes createNotificationConfig with error', async () => { + it('invokes createMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -548,34 +547,31 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.createNotificationConfig = stubSimpleCall( + client.innerApiCalls.createMuteConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.createNotificationConfig(request), - expectedError - ); + await assert.rejects(client.createMuteConfig(request), expectedError); assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) + (client.innerApiCalls.createMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', async () => { + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -584,30 +580,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.deleteNotificationConfig = + client.innerApiCalls.createNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNotificationConfig(request); + const [response] = await client.createNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) + (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes deleteNotificationConfig without error using callback', async () => { + it('invokes createNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -616,16 +612,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.deleteNotificationConfig = + client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteNotificationConfig( + client.createNotificationConfig( request, ( err?: Error | null, - result?: protos.google.protobuf.IEmpty | null + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null ) => { if (err) { reject(err); @@ -638,23 +634,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) + (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes deleteNotificationConfig with error', async () => { + it('invokes createNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -663,34 +659,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + client.innerApiCalls.createNotificationConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.deleteNotificationConfig(request), + client.createNotificationConfig(request), expectedError ); assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) + (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { + describe('deleteMuteConfig', () => { + it('invokes deleteMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -699,29 +695,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); + client.innerApiCalls.deleteMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getIamPolicy as SinonStub) + (client.innerApiCalls.deleteMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getIamPolicy without error using callback', async () => { + it('invokes deleteMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -730,16 +726,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getIamPolicy = + client.innerApiCalls.deleteMuteConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getIamPolicy( + client.deleteMuteConfig( request, ( err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null + result?: protos.google.protobuf.IEmpty | null ) => { if (err) { reject(err); @@ -752,23 +748,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getIamPolicy as SinonStub) + (client.innerApiCalls.deleteMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getIamPolicy with error', async () => { + it('invokes deleteMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -777,28 +773,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall( + client.innerApiCalls.deleteMuteConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getIamPolicy(request), expectedError); + await assert.rejects(client.deleteMuteConfig(request), expectedError); assert( - (client.innerApiCalls.getIamPolicy as SinonStub) + (client.innerApiCalls.deleteMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', async () => { + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -810,27 +806,27 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getNotificationConfig = + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getNotificationConfig(request); + const [response] = await client.deleteNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) + (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getNotificationConfig without error using callback', async () => { + it('invokes deleteNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -842,16 +838,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getNotificationConfig = + client.innerApiCalls.deleteNotificationConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getNotificationConfig( + client.deleteNotificationConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + result?: protos.google.protobuf.IEmpty | null ) => { if (err) { reject(err); @@ -864,20 +860,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) + (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getNotificationConfig with error', async () => { + it('invokes deleteNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -889,34 +885,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getNotificationConfig = stubSimpleCall( + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.getNotificationConfig(request), + client.deleteNotificationConfig(request), expectedError ); assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) + (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', async () => { + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + new protos.google.iam.v1.GetIamPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -925,30 +921,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getOrganizationSettings = - stubSimpleCall(expectedResponse); - const [response] = await client.getOrganizationSettings(request); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) + (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getOrganizationSettings without error using callback', async () => { + it('invokes getIamPolicy without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + new protos.google.iam.v1.GetIamPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -957,16 +952,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getOrganizationSettings = + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getOrganizationSettings( + client.getIamPolicy( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + result?: protos.google.iam.v1.IPolicy | null ) => { if (err) { reject(err); @@ -979,23 +974,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) + (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getOrganizationSettings with error', async () => { + it('invokes getIamPolicy with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + new protos.google.iam.v1.GetIamPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1004,31 +999,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.getOrganizationSettings(request), - expectedError - ); + await assert.rejects(client.getIamPolicy(request), expectedError); assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) + (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getSource', () => { - it('invokes getSource without error', async () => { + describe('getMuteConfig', () => { + it('invokes getMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1040,26 +1032,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); - const [response] = await client.getSource(request); + client.innerApiCalls.getMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getSource as SinonStub) + (client.innerApiCalls.getMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getSource without error using callback', async () => { + it('invokes getMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1071,16 +1063,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.getSource = + client.innerApiCalls.getMuteConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getSource( + client.getMuteConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISource | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null ) => { if (err) { reject(err); @@ -1093,20 +1085,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getSource as SinonStub) + (client.innerApiCalls.getMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getSource with error', async () => { + it('invokes getMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1118,25 +1110,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSource(request), expectedError); + client.innerApiCalls.getMuteConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMuteConfig(request), expectedError); assert( - (client.innerApiCalls.getSource as SinonStub) + (client.innerApiCalls.getMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('setFindingState', () => { - it('invokes setFindingState without error', async () => { + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1148,26 +1143,27 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Finding() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); - const [response] = await client.setFindingState(request); + client.innerApiCalls.getNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setFindingState as SinonStub) + (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes setFindingState without error using callback', async () => { + it('invokes getNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1179,16 +1175,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Finding() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.setFindingState = + client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.setFindingState( + client.getNotificationConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IFinding | null + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null ) => { if (err) { reject(err); @@ -1201,20 +1197,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setFindingState as SinonStub) + (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes setFindingState with error', async () => { + it('invokes getNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1226,31 +1222,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.setFindingState = stubSimpleCall( + client.innerApiCalls.getNotificationConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.setFindingState(request), expectedError); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); assert( - (client.innerApiCalls.setFindingState as SinonStub) + (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1259,29 +1258,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setIamPolicy as SinonStub) + (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes setIamPolicy without error using callback', async () => { + it('invokes getOrganizationSettings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1290,16 +1290,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.setIamPolicy = + client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.setIamPolicy( + client.getOrganizationSettings( request, ( err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null ) => { if (err) { reject(err); @@ -1312,23 +1312,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setIamPolicy as SinonStub) + (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes setIamPolicy with error', async () => { + it('invokes getOrganizationSettings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1337,31 +1337,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall( + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.setIamPolicy(request), expectedError); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); assert( - (client.innerApiCalls.setIamPolicy as SinonStub) + (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { + describe('getSource', () => { + it('invokes getSource without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1370,30 +1373,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.testIamPermissions = - stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.testIamPermissions as SinonStub) + (client.innerApiCalls.getSource as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes testIamPermissions without error using callback', async () => { + it('invokes getSource without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1402,16 +1404,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.testIamPermissions = + client.innerApiCalls.getSource = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.testIamPermissions( + client.getSource( request, ( err?: Error | null, - result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + result?: protos.google.cloud.securitycenter.v1.ISource | null ) => { if (err) { reject(err); @@ -1424,23 +1426,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.testIamPermissions as SinonStub) + (client.innerApiCalls.getSource as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes testIamPermissions with error', async () => { + it('invokes getSource with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1449,32 +1451,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.testIamPermissions(request), expectedError); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSource(request), expectedError); assert( - (client.innerApiCalls.testIamPermissions as SinonStub) + (client.innerApiCalls.getSource as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateFinding', () => { - it('invokes updateFinding without error', async () => { + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1485,28 +1483,27 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); - const [response] = await client.updateFinding(request); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateFinding as SinonStub) + (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateFinding without error using callback', async () => { + it('invokes setFindingState without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1517,10 +1514,10 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateFinding = + client.innerApiCalls.setFindingState = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateFinding( + client.setFindingState( request, ( err?: Error | null, @@ -1537,24 +1534,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateFinding as SinonStub) + (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateFinding with error', async () => { + it('invokes setFindingState with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1563,32 +1559,31 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateFinding = stubSimpleCall( + client.innerApiCalls.setFindingState = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateFinding(request), expectedError); + await assert.rejects(client.setFindingState(request), expectedError); assert( - (client.innerApiCalls.updateFinding as SinonStub) + (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', async () => { + describe('setMute', () => { + it('invokes setMute without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1597,31 +1592,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateNotificationConfig = - stubSimpleCall(expectedResponse); - const [response] = await client.updateNotificationConfig(request); + client.innerApiCalls.setMute = stubSimpleCall(expectedResponse); + const [response] = await client.setMute(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) + (client.innerApiCalls.setMute as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateNotificationConfig without error using callback', async () => { + it('invokes setMute without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1630,16 +1623,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateNotificationConfig = + client.innerApiCalls.setMute = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateNotificationConfig( + client.setMute( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + result?: protos.google.cloud.securitycenter.v1.IFinding | null ) => { if (err) { reject(err); @@ -1652,24 +1645,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) + (client.innerApiCalls.setMute as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateNotificationConfig with error', async () => { + it('invokes setMute with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1678,35 +1670,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.updateNotificationConfig(request), - expectedError - ); + client.innerApiCalls.setMute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMute(request), expectedError); assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) + (client.innerApiCalls.setMute as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', async () => { + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + new protos.google.iam.v1.SetIamPolicyRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1715,31 +1700,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.updateOrganizationSettings = - stubSimpleCall(expectedResponse); - const [response] = await client.updateOrganizationSettings(request); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) + (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateOrganizationSettings without error using callback', async () => { + it('invokes setIamPolicy without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + new protos.google.iam.v1.SetIamPolicyRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1748,16 +1731,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.updateOrganizationSettings = + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateOrganizationSettings( + client.setIamPolicy( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + result?: protos.google.iam.v1.IPolicy | null ) => { if (err) { reject(err); @@ -1770,24 +1753,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) + (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateOrganizationSettings with error', async () => { + it('invokes setIamPolicy with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + new protos.google.iam.v1.SetIamPolicyRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1796,35 +1778,31 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.updateOrganizationSettings(request), - expectedError - ); + await assert.rejects(client.setIamPolicy(request), expectedError); assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) + (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateSource', () => { - it('invokes updateSource without error', async () => { + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1833,30 +1811,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); - const [response] = await client.updateSource(request); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSource as SinonStub) + (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateSource without error using callback', async () => { + it('invokes testIamPermissions without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1865,16 +1843,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.updateSource = + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateSource( + client.testIamPermissions( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISource | null + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null ) => { if (err) { reject(err); @@ -1887,24 +1865,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSource as SinonStub) + (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateSource with error', async () => { + it('invokes testIamPermissions with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1913,32 +1890,32 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateSource = stubSimpleCall( + client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateSource(request), expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); assert( - (client.innerApiCalls.updateSource as SinonStub) + (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', async () => { + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; const expectedOptions = { otherArgs: { headers: { @@ -1947,31 +1924,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityMarks() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateSecurityMarks = - stubSimpleCall(expectedResponse); - const [response] = await client.updateSecurityMarks(request); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) + (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateSecurityMarks without error using callback', async () => { + it('invokes updateFinding without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; const expectedOptions = { otherArgs: { headers: { @@ -1980,16 +1956,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityMarks() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateSecurityMarks = + client.innerApiCalls.updateFinding = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateSecurityMarks( + client.updateFinding( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISecurityMarks | null + result?: protos.google.cloud.securitycenter.v1.IFinding | null ) => { if (err) { reject(err); @@ -2002,24 +1978,24 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) + (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateSecurityMarks with error', async () => { + it('invokes updateFinding with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; const expectedOptions = { otherArgs: { headers: { @@ -2028,31 +2004,32 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + client.innerApiCalls.updateFinding = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateSecurityMarks(request), expectedError); + await assert.rejects(client.updateFinding(request), expectedError); assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) + (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', async () => { + describe('updateMuteConfig', () => { + it('invokes updateMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2061,31 +2038,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.runAssetDiscovery = - stubLongRunningCall(expectedResponse); - const [operation] = await client.runAssetDiscovery(request); - const [response] = await operation.promise(); + client.innerApiCalls.updateMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes runAssetDiscovery without error using callback', async () => { + it('invokes updateMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2094,19 +2070,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.runAssetDiscovery = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateMuteConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.runAssetDiscovery( + client.updateMuteConfig( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protos.google.protobuf.IEmpty - > | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null ) => { if (err) { reject(err); @@ -2116,30 +2089,27 @@ describe('v1.SecurityCenterClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protos.google.protobuf.IEmpty - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes runAssetDiscovery with call error', async () => { + it('invokes updateMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2148,29 +2118,32 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + client.innerApiCalls.updateMuteConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.runAssetDiscovery(request), expectedError); + await assert.rejects(client.updateMuteConfig(request), expectedError); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + }); - it('invokes runAssetDiscovery with LRO error', async () => { + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2178,63 +2151,839 @@ describe('v1.SecurityCenterClient', () => { }, }, }; - const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( - undefined, - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(operation.promise(), expectedError); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes checkRunAssetDiscoveryProgress without error', async () => { + it('invokes updateNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunAssetDiscoveryProgress( - expectedResponse.name + client.innerApiCalls.updateNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRunAssetDiscoveryProgress with error', async () => { + it('invokes updateNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.checkRunAssetDiscoveryProgress(''), + client.updateNotificationConfig(request), expectedError ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSource(request), expectedError); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('bulkMuteFindings', () => { + it('invokes bulkMuteFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCall(expectedResponse); + const [operation] = await client.bulkMuteFindings(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkMuteFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkMuteFindings( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes bulkMuteFindings with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.bulkMuteFindings(request), expectedError); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkMuteFindings with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.bulkMuteFindings(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkBulkMuteFindingsProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBulkMuteFindingsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBulkMuteFindingsProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBulkMuteFindingsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runAssetDiscovery(request), expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('groupAssets', () => { it('invokes groupAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -2265,24 +3014,337 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); - const [response] = await client.groupAssets(request); + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupAssets(request), expectedError); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupAssets without error using callback', async () => { + it('invokes groupFindings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2304,10 +3366,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.groupAssets( + client.groupFindings( request, ( err?: Error | null, @@ -2324,20 +3386,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes groupAssets with error', async () => { + it('invokes groupFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2349,26 +3411,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.groupAssets = stubSimpleCall( + client.innerApiCalls.groupFindings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.groupAssets(request), expectedError); + await assert.rejects(client.groupFindings(request), expectedError); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupAssetsStream without error', async () => { + it('invokes groupFindingsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2383,9 +3445,9 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.createStream = + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.groupAssetsStream(request); + const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; @@ -2405,35 +3467,33 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) + (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupAssets, request) + .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes groupAssetsStream with error', async () => { + it('invokes groupFindingsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.groupAssetsStream(request); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; @@ -2452,26 +3512,26 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) + (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupAssets, request) + .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupAssets without error', async () => { + it('uses async iteration with groupFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2486,46 +3546,44 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.asyncIterate = + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; - const iterable = client.groupAssetsAsync(request); + const iterable = client.groupFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupAssets with error', async () => { + it('uses async iteration with groupFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.groupAssetsAsync(request); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; @@ -2534,29 +3592,29 @@ describe('v1.SecurityCenterClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('groupFindings', () => { - it('invokes groupFindings without error', async () => { + describe('listAssets', () => { + it('invokes listAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2569,33 +3627,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); - const [response] = await client.groupFindings(request); + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupFindings without error using callback', async () => { + it('invokes listAssets without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2608,23 +3666,25 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.groupFindings = + client.innerApiCalls.listAssets = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.groupFindings( + client.listAssets( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + result?: + | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | null ) => { if (err) { reject(err); @@ -2637,20 +3697,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes groupFindings with error', async () => { + it('invokes listAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2662,49 +3722,51 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.groupFindings = stubSimpleCall( + client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.groupFindings(request), expectedError); + await assert.rejects(client.listAssets(request), expectedError); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupFindingsStream without error', async () => { + it('invokes listAssetsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.groupFindings.createStream = + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.groupFindingsStream(request); + const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { responses.push(response); } ); @@ -2718,39 +3780,43 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) + (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupFindings, request) + .calledWith(client.innerApiCalls.listAssets, request) ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes groupFindingsStream with error', async () => { + it('invokes listAssetsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.groupFindingsStream(request); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { responses.push(response); } ); @@ -2763,109 +3829,111 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) + (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupFindings, request) + .calledWith(client.innerApiCalls.listAssets, request) ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupFindings without error', async () => { + it('uses async iteration with listAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.groupFindings.asyncIterate = + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; - const iterable = client.groupFindingsAsync(request); + const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupFindings with error', async () => { + it('uses async iteration with listAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.groupFindingsAsync(request); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listAssets', () => { - it('invokes listAssets without error', async () => { + describe('listFindings', () => { + it('invokes listFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2878,33 +3946,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); - const [response] = await client.listAssets(request); + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssets without error using callback', async () => { + it('invokes listFindings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2917,24 +3985,24 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listAssets = + client.innerApiCalls.listFindings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listAssets( + client.listFindings( request, ( err?: Error | null, result?: - | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] | null ) => { if (err) { @@ -2948,20 +4016,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listAssets with error', async () => { + it('invokes listFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2973,50 +4041,50 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listAssets = stubSimpleCall( + client.innerApiCalls.listFindings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listAssets(request), expectedError); + await assert.rejects(client.listFindings(request), expectedError); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssetsStream without error', async () => { + it('invokes listFindingsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listAssets.createStream = + client.descriptors.page.listFindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAssetsStream(request); + const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; stream.on( 'data', ( - response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult ) => { responses.push(response); } @@ -3031,42 +4099,42 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listAssetsStream with error', async () => { + it('invokes listFindingsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( undefined, expectedError ); - const stream = client.listAssetsStream(request); + const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; stream.on( 'data', ( - response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult ) => { responses.push(response); } @@ -3080,111 +4148,109 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets without error', async () => { + it('uses async iteration with listFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listAssets.asyncIterate = + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; - const iterable = client.listAssetsAsync(request); + const iterable = client.listFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets with error', async () => { + it('uses async iteration with listFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listAssetsAsync(request); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listFindings', () => { - it('invokes listFindings without error', async () => { + describe('listMuteConfigs', () => { + it('invokes listMuteConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3197,33 +4263,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); - const [response] = await client.listFindings(request); + client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listMuteConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listFindings without error using callback', async () => { + it('invokes listMuteConfigs without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3236,25 +4302,23 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.innerApiCalls.listFindings = + client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listFindings( + client.listMuteConfigs( request, ( err?: Error | null, - result?: - | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] - | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig[] | null ) => { if (err) { reject(err); @@ -3267,20 +4331,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listFindings with error', async () => { + it('invokes listMuteConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3292,51 +4356,49 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listFindings = stubSimpleCall( + client.innerApiCalls.listMuteConfigs = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listFindings(request), expectedError); + await assert.rejects(client.listMuteConfigs(request), expectedError); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listFindingsStream without error', async () => { + it('invokes listMuteConfigsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.descriptors.page.listFindings.createStream = + client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFindingsStream(request); + const stream = client.listMuteConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - ) => { + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { responses.push(response); } ); @@ -3350,43 +4412,39 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listFindings.createStream as SinonStub) + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listFindings, request) + .calledWith(client.innerApiCalls.listMuteConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listFindings.createStream as SinonStub + client.descriptors.page.listMuteConfigs.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listFindingsStream with error', async () => { + it('invokes listMuteConfigsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listFindingsStream(request); + client.descriptors.page.listMuteConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMuteConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - ) => { + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { responses.push(response); } ); @@ -3399,80 +4457,79 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listFindings.createStream as SinonStub) + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listFindings, request) + .calledWith(client.innerApiCalls.listMuteConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listFindings.createStream as SinonStub + client.descriptors.page.listMuteConfigs.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listFindings without error', async () => { + it('uses async iteration with listMuteConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.descriptors.page.listFindings.asyncIterate = + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = - []; - const iterable = client.listFindingsAsync(request); + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; + const iterable = client.listMuteConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listFindings with error', async () => { + it('uses async iteration with listMuteConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFindingsAsync(request); + const iterable = client.listMuteConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3480,13 +4537,13 @@ describe('v1.SecurityCenterClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); @@ -4246,6 +5303,61 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('folderMuteConfig', () => { + const fakePath = '/rendered/path/folderMuteConfig'; + const expectedParameters = { + folder: 'folderValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderMuteConfigPath', () => { + const result = client.folderMuteConfigPath( + 'folderValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderMuteConfigName', () => { + const result = client.matchFolderFromFolderMuteConfigName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderMuteConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromFolderMuteConfigName', () => { + const result = client.matchMuteConfigFromFolderMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + (client.pathTemplates.folderMuteConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSource', () => { const fakePath = '/rendered/path/folderSource'; const expectedParameters = { @@ -4674,6 +5786,69 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationMuteConfig', () => { + const fakePath = '/rendered/path/organizationMuteConfig'; + const expectedParameters = { + organization: 'organizationValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationMuteConfigPath', () => { + const result = client.organizationMuteConfigPath( + 'organizationValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationMuteConfigName', () => { + const result = + client.matchOrganizationFromOrganizationMuteConfigName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromOrganizationMuteConfigName', () => { + const result = + client.matchMuteConfigFromOrganizationMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSettings', () => { const fakePath = '/rendered/path/organizationSettings'; const expectedParameters = { @@ -5059,6 +6234,68 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('projectMuteConfig', () => { + const fakePath = '/rendered/path/projectMuteConfig'; + const expectedParameters = { + project: 'projectValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectMuteConfigPath', () => { + const result = client.projectMuteConfigPath( + 'projectValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectMuteConfigName', () => { + const result = client.matchProjectFromProjectMuteConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromProjectMuteConfigName', () => { + const result = + client.matchMuteConfigFromProjectMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSource', () => { const fakePath = '/rendered/path/projectSource'; const expectedParameters = {