From 22478d6fd89ec40aa281aa47daf14cfd96392341 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:48:21 +0000 Subject: [PATCH] fix: allow passing gax instance to client constructor (#506) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 feat: serviceAccountKeyName, serviceAccountDelegationInfo, and principalSubject attributes added to the existing access attribute. These new attributes provide additional context about the principals that are associated with the finding PiperOrigin-RevId: 469787268 Source-Link: https://github.com/googleapis/googleapis/commit/c7a52f4e986a72015aa4ba430bfb5e7508282516 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4e235765c3f09662143bc0a2b08f12bc0fe0c93f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGUyMzU3NjVjM2YwOTY2MjE0M2JjMGEyYjA4ZjEyYmMwZmUwYzkzZiJ9 feat: Adding database access information, such as queries field to a finding. A database may be a sub-resource of an instance (as in the case of CloudSQL instances or Cloud Spanner instances), or the database instance itself PiperOrigin-RevId: 469544940 Source-Link: https://github.com/googleapis/googleapis/commit/a887434dd3a1c3b2aa78f142f11d21b5825ffa3e Source-Link: https://github.com/googleapis/googleapis-gen/commit/ca12635e1b065de9efcaa551669648fcbde1a944 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2ExMjYzNWUxYjA2NWRlOWVmY2FhNTUxNjY5NjQ4ZmNiZGUxYTk0NCJ9 --- .../cloud/securitycenter/v1/access.proto | 46 ++ .../cloud/securitycenter/v1/database.proto | 52 ++ .../cloud/securitycenter/v1/finding.proto | 23 +- protos/protos.d.ts | 248 +++++++ protos/protos.js | 659 ++++++++++++++++++ protos/protos.json | 54 ++ src/v1/security_center_client.ts | 151 ++-- src/v1/security_center_proto_list.json | 1 + src/v1beta1/security_center_client.ts | 92 +-- src/v1p1beta1/security_center_client.ts | 106 +-- 10 files changed, 1271 insertions(+), 161 deletions(-) create mode 100644 protos/google/cloud/securitycenter/v1/database.proto diff --git a/protos/google/cloud/securitycenter/v1/access.proto b/protos/google/cloud/securitycenter/v1/access.proto index e1b57247..799b84fc 100644 --- a/protos/google/cloud/securitycenter/v1/access.proto +++ b/protos/google/cloud/securitycenter/v1/access.proto @@ -27,6 +27,13 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Represents an access event. message Access { // Associated email, such as "foo@google.com". + // + // The email address of the authenticated user (or service account on behalf + // of third party principal) making the request. For third party identity + // callers, the `principal_subject` field is populated instead of this field. + // For privacy reasons, the principal email address is sometimes redacted. + // For more information, see [Caller identities in audit + // logs](https://cloud.google.com/logging/docs/audit#user-id). string principal_email = 1; // Caller's IP address, such as "1.1.1.1". @@ -45,6 +52,45 @@ message Access { // The method that the service account called, e.g. "SetIamPolicy". string method_name = 6; + + // A string representing the principal_subject associated with the identity. + // As compared to `principal_email`, supports principals that aren't + // associated with email addresses, such as third party principals. For most + // identities, the format will be `principal://iam.googleapis.com/{identity + // pool name}/subjects/{subject}` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + // format `serviceAccount:{identity pool name}[{subject}]` + string principal_subject = 7; + + // The name of the service account key used to create or exchange + // credentials for authenticating the service account making the request. + // This is a scheme-less URI full resource name. For example: + // + // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" + // + string service_account_key_name = 8; + + // Identity delegation history of an authenticated service account that makes + // the request. It contains information on the real authorities that try to + // access GCP resources by delegating on a service account. When multiple + // authorities are present, they are guaranteed to be sorted based on the + // original ordering of the identity delegation events. + repeated ServiceAccountDelegationInfo service_account_delegation_info = 9; +} + +// Identity delegation history of an authenticated service account. +message ServiceAccountDelegationInfo { + // The email address of a Google account. + string principal_email = 1; + + // A string representing the principal_subject associated with the identity. + // As compared to `principal_email`, supports principals that aren't + // associated with email addresses, such as third party principals. For most + // identities, the format will be `principal://iam.googleapis.com/{identity + // pool name}/subjects/{subject}` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + // format `serviceAccount:{identity pool name}[{subject}]` + string principal_subject = 2; } // Represents a geographical location for a given access. diff --git a/protos/google/cloud/securitycenter/v1/database.proto b/protos/google/cloud/securitycenter/v1/database.proto new file mode 100644 index 00000000..276b3100 --- /dev/null +++ b/protos/google/cloud/securitycenter/v1/database.proto @@ -0,0 +1,52 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "DatabaseProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents database access information, such as queries. +// A database may be a sub-resource of an instance (as in the case of CloudSQL +// instances or Cloud Spanner instances), or the database instance itself. +// Some database resources may not have the full resource name populated +// because these resource types are not yet supported by Cloud Asset Inventory +// (e.g. CloudSQL databases). In these cases only the display name will be +// provided. +message Database { + // The full resource name of the database the user connected to, if it is + // supported by CAI. (https://google.aip.dev/122#full-resource-names) + string name = 1; + + // The human readable name of the database the user connected to. + string display_name = 2; + + // The username used to connect to the DB. This may not necessarily be an IAM + // principal, and has no required format. + string user_name = 3; + + // The SQL statement associated with the relevant access. + string query = 4; + + // The target usernames/roles/groups of a SQL privilege grant (not an IAM + // policy change). + repeated string grantees = 5; +} diff --git a/protos/google/cloud/securitycenter/v1/finding.proto b/protos/google/cloud/securitycenter/v1/finding.proto index 6c6043b5..8fbd9421 100644 --- a/protos/google/cloud/securitycenter/v1/finding.proto +++ b/protos/google/cloud/securitycenter/v1/finding.proto @@ -23,6 +23,7 @@ import "google/cloud/securitycenter/v1/compliance.proto"; import "google/cloud/securitycenter/v1/connection.proto"; import "google/cloud/securitycenter/v1/contact_details.proto"; import "google/cloud/securitycenter/v1/container.proto"; +import "google/cloud/securitycenter/v1/database.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; @@ -257,11 +258,13 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external system - // information and external system finding fields. - map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external + // system information and external system finding fields. + map external_systems = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; // MITRE ATT&CK tactics and techniques related to this finding. // See: https://attack.mitre.org @@ -283,9 +286,9 @@ message Finding { // Represents operating system processes associated with the Finding. repeated Process processes = 30; - // Output only. Map containing the point of contacts for the given finding. The key - // represents the type of contact, while the value contains a list of all the - // contacts that pertain. Please refer to: + // Output only. Map containing the point of contacts for the given finding. + // The key represents the type of contact, while the value contains a list of + // all the contacts that pertain. Please refer to: // https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories // // { @@ -300,7 +303,8 @@ message Finding { // ] // } // } - map contacts = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + map contacts = 33 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Contains compliance information for security standards associated to the // finding. @@ -324,4 +328,7 @@ message Finding { // Kubernetes resources associated with the finding. Kubernetes kubernetes = 43; + + // Database associated with the finding. + Database database = 44; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 52014e5b..333fe7c6 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -46,6 +46,15 @@ export namespace google { /** Access methodName */ methodName?: (string|null); + + /** Access principalSubject */ + principalSubject?: (string|null); + + /** Access serviceAccountKeyName */ + serviceAccountKeyName?: (string|null); + + /** Access serviceAccountDelegationInfo */ + serviceAccountDelegationInfo?: (google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]|null); } /** Represents an Access. */ @@ -75,6 +84,15 @@ export namespace google { /** Access methodName. */ public methodName: string; + /** Access principalSubject. */ + public principalSubject: string; + + /** Access serviceAccountKeyName. */ + public serviceAccountKeyName: string; + + /** Access serviceAccountDelegationInfo. */ + public serviceAccountDelegationInfo: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]; + /** * Creates a new Access instance using the specified properties. * @param [properties] Properties to set @@ -153,6 +171,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ServiceAccountDelegationInfo. */ + interface IServiceAccountDelegationInfo { + + /** ServiceAccountDelegationInfo principalEmail */ + principalEmail?: (string|null); + + /** ServiceAccountDelegationInfo principalSubject */ + principalSubject?: (string|null); + } + + /** Represents a ServiceAccountDelegationInfo. */ + class ServiceAccountDelegationInfo implements IServiceAccountDelegationInfo { + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo); + + /** ServiceAccountDelegationInfo principalEmail. */ + public principalEmail: string; + + /** ServiceAccountDelegationInfo principalSubject. */ + public principalSubject: string; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountDelegationInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @param message ServiceAccountDelegationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @param message ServiceAccountDelegationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Verifies a ServiceAccountDelegationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccountDelegationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountDelegationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Creates a plain object from a ServiceAccountDelegationInfo message. Also converts values to other types if specified. + * @param message ServiceAccountDelegationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ServiceAccountDelegationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountDelegationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountDelegationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Geolocation. */ interface IGeolocation { @@ -1640,6 +1761,127 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database displayName */ + displayName?: (string|null); + + /** Database userName */ + userName?: (string|null); + + /** Database query */ + query?: (string|null); + + /** Database grantees */ + grantees?: (string[]|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDatabase); + + /** Database name. */ + public name: string; + + /** Database displayName. */ + public displayName: string; + + /** Database userName. */ + public userName: string; + + /** Database query. */ + public query: string; + + /** Database grantees. */ + public grantees: string[]; + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDatabase): google.cloud.securitycenter.v1.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Exfiltration. */ interface IExfiltration { @@ -2189,6 +2431,9 @@ export namespace google { /** Finding kubernetes */ kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + + /** Finding database */ + database?: (google.cloud.securitycenter.v1.IDatabase|null); } /** Represents a Finding. */ @@ -2293,6 +2538,9 @@ export namespace google { /** Finding kubernetes. */ public kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + /** Finding database. */ + public database?: (google.cloud.securitycenter.v1.IDatabase|null); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index 612c24cb..a1c63b3b 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -78,6 +78,9 @@ * @property {string|null} [userAgentFamily] Access userAgentFamily * @property {string|null} [serviceName] Access serviceName * @property {string|null} [methodName] Access methodName + * @property {string|null} [principalSubject] Access principalSubject + * @property {string|null} [serviceAccountKeyName] Access serviceAccountKeyName + * @property {Array.|null} [serviceAccountDelegationInfo] Access serviceAccountDelegationInfo */ /** @@ -89,6 +92,7 @@ * @param {google.cloud.securitycenter.v1.IAccess=} [properties] Properties to set */ function Access(properties) { + this.serviceAccountDelegationInfo = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -143,6 +147,30 @@ */ Access.prototype.methodName = ""; + /** + * Access principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.principalSubject = ""; + + /** + * Access serviceAccountKeyName. + * @member {string} serviceAccountKeyName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceAccountKeyName = ""; + + /** + * Access serviceAccountDelegationInfo. + * @member {Array.} serviceAccountDelegationInfo + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceAccountDelegationInfo = $util.emptyArray; + /** * Creates a new Access instance using the specified properties. * @function create @@ -179,6 +207,13 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceName); if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.methodName); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.principalSubject); + if (message.serviceAccountKeyName != null && Object.hasOwnProperty.call(message, "serviceAccountKeyName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccountKeyName); + if (message.serviceAccountDelegationInfo != null && message.serviceAccountDelegationInfo.length) + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) + $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.encode(message.serviceAccountDelegationInfo[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -237,6 +272,20 @@ message.methodName = reader.string(); break; } + case 7: { + message.principalSubject = reader.string(); + break; + } + case 8: { + message.serviceAccountKeyName = reader.string(); + break; + } + case 9: { + if (!(message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length)) + message.serviceAccountDelegationInfo = []; + message.serviceAccountDelegationInfo.push($root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -292,6 +341,21 @@ if (message.methodName != null && message.hasOwnProperty("methodName")) if (!$util.isString(message.methodName)) return "methodName: string expected"; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + if (message.serviceAccountKeyName != null && message.hasOwnProperty("serviceAccountKeyName")) + if (!$util.isString(message.serviceAccountKeyName)) + return "serviceAccountKeyName: string expected"; + if (message.serviceAccountDelegationInfo != null && message.hasOwnProperty("serviceAccountDelegationInfo")) { + if (!Array.isArray(message.serviceAccountDelegationInfo)) + return "serviceAccountDelegationInfo: array expected"; + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify(message.serviceAccountDelegationInfo[i]); + if (error) + return "serviceAccountDelegationInfo." + error; + } + } return null; }; @@ -322,6 +386,20 @@ message.serviceName = String(object.serviceName); if (object.methodName != null) message.methodName = String(object.methodName); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + if (object.serviceAccountKeyName != null) + message.serviceAccountKeyName = String(object.serviceAccountKeyName); + if (object.serviceAccountDelegationInfo) { + if (!Array.isArray(object.serviceAccountDelegationInfo)) + throw TypeError(".google.cloud.securitycenter.v1.Access.serviceAccountDelegationInfo: array expected"); + message.serviceAccountDelegationInfo = []; + for (var i = 0; i < object.serviceAccountDelegationInfo.length; ++i) { + if (typeof object.serviceAccountDelegationInfo[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Access.serviceAccountDelegationInfo: object expected"); + message.serviceAccountDelegationInfo[i] = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.fromObject(object.serviceAccountDelegationInfo[i]); + } + } return message; }; @@ -338,6 +416,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.serviceAccountDelegationInfo = []; if (options.defaults) { object.principalEmail = ""; object.callerIp = ""; @@ -345,6 +425,8 @@ object.userAgentFamily = ""; object.serviceName = ""; object.methodName = ""; + object.principalSubject = ""; + object.serviceAccountKeyName = ""; } if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) object.principalEmail = message.principalEmail; @@ -358,6 +440,15 @@ object.serviceName = message.serviceName; if (message.methodName != null && message.hasOwnProperty("methodName")) object.methodName = message.methodName; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + object.principalSubject = message.principalSubject; + if (message.serviceAccountKeyName != null && message.hasOwnProperty("serviceAccountKeyName")) + object.serviceAccountKeyName = message.serviceAccountKeyName; + if (message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length) { + object.serviceAccountDelegationInfo = []; + for (var j = 0; j < message.serviceAccountDelegationInfo.length; ++j) + object.serviceAccountDelegationInfo[j] = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.toObject(message.serviceAccountDelegationInfo[j], options); + } return object; }; @@ -390,6 +481,233 @@ return Access; })(); + v1.ServiceAccountDelegationInfo = (function() { + + /** + * Properties of a ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v1 + * @interface IServiceAccountDelegationInfo + * @property {string|null} [principalEmail] ServiceAccountDelegationInfo principalEmail + * @property {string|null} [principalSubject] ServiceAccountDelegationInfo principalSubject + */ + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ServiceAccountDelegationInfo. + * @implements IServiceAccountDelegationInfo + * @constructor + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo=} [properties] Properties to set + */ + function ServiceAccountDelegationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountDelegationInfo principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalEmail = ""; + + /** + * ServiceAccountDelegationInfo principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalSubject = ""; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo instance + */ + ServiceAccountDelegationInfo.create = function create(properties) { + return new ServiceAccountDelegationInfo(properties); + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo} message ServiceAccountDelegationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountDelegationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principalEmail); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalSubject); + return writer; + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo} message ServiceAccountDelegationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountDelegationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountDelegationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principalEmail = reader.string(); + break; + } + case 2: { + message.principalSubject = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountDelegationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountDelegationInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountDelegationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountDelegationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + */ + ServiceAccountDelegationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo) + return object; + var message = new $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo(); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountDelegationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} message ServiceAccountDelegationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountDelegationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principalEmail = ""; + object.principalSubject = ""; + } + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + object.principalSubject = message.principalSubject; + return object; + }; + + /** + * Converts this ServiceAccountDelegationInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountDelegationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountDelegationInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountDelegationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ServiceAccountDelegationInfo"; + }; + + return ServiceAccountDelegationInfo; + })(); + v1.Geolocation = (function() { /** @@ -4111,6 +4429,319 @@ return Label; })(); + v1.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.securitycenter.v1 + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {string|null} [displayName] Database displayName + * @property {string|null} [userName] Database userName + * @property {string|null} [query] Database query + * @property {Array.|null} [grantees] Database grantees + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.securitycenter.v1.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + this.grantees = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.displayName = ""; + + /** + * Database userName. + * @member {string} userName + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.userName = ""; + + /** + * Database query. + * @member {string} query + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.query = ""; + + /** + * Database grantees. + * @member {Array.} grantees + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.grantees = $util.emptyArray; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userName); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + if (message.grantees != null && message.grantees.length) + for (var i = 0; i < message.grantees.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.grantees[i]); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.userName = reader.string(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + case 5: { + if (!(message.grantees && message.grantees.length)) + message.grantees = []; + message.grantees.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.grantees != null && message.hasOwnProperty("grantees")) { + if (!Array.isArray(message.grantees)) + return "grantees: array expected"; + for (var i = 0; i < message.grantees.length; ++i) + if (!$util.isString(message.grantees[i])) + return "grantees: string[] expected"; + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Database) + return object; + var message = new $root.google.cloud.securitycenter.v1.Database(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.userName != null) + message.userName = String(object.userName); + if (object.query != null) + message.query = String(object.query); + if (object.grantees) { + if (!Array.isArray(object.grantees)) + throw TypeError(".google.cloud.securitycenter.v1.Database.grantees: array expected"); + message.grantees = []; + for (var i = 0; i < object.grantees.length; ++i) + message.grantees[i] = String(object.grantees[i]); + } + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.grantees = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.userName = ""; + object.query = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.grantees && message.grantees.length) { + object.grantees = []; + for (var j = 0; j < message.grantees.length; ++j) + object.grantees[j] = message.grantees[j]; + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Database"; + }; + + return Database; + })(); + v1.Exfiltration = (function() { /** @@ -5325,6 +5956,7 @@ * @property {string|null} [nextSteps] Finding nextSteps * @property {Array.|null} [containers] Finding containers * @property {google.cloud.securitycenter.v1.IKubernetes|null} [kubernetes] Finding kubernetes + * @property {google.cloud.securitycenter.v1.IDatabase|null} [database] Finding database */ /** @@ -5598,6 +6230,14 @@ */ Finding.prototype.kubernetes = null; + /** + * Finding database. + * @member {google.cloud.securitycenter.v1.IDatabase|null|undefined} database + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.database = null; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -5698,6 +6338,8 @@ $root.google.cloud.securitycenter.v1.Container.encode(message.containers[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); if (message.kubernetes != null && Object.hasOwnProperty.call(message, "kubernetes")) $root.google.cloud.securitycenter.v1.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.cloud.securitycenter.v1.Database.encode(message.database, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); return writer; }; @@ -5923,6 +6565,10 @@ message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.decode(reader, reader.uint32()); break; } + case 44: { + message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6152,6 +6798,11 @@ if (error) return "kubernetes." + error; } + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.securitycenter.v1.Database.verify(message.database); + if (error) + return "database." + error; + } return null; }; @@ -6395,6 +7046,11 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.kubernetes: object expected"); message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.fromObject(object.kubernetes); } + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.database: object expected"); + message.database = $root.google.cloud.securitycenter.v1.Database.fromObject(object.database); + } return message; }; @@ -6447,6 +7103,7 @@ object.exfiltration = null; object.nextSteps = ""; object.kubernetes = null; + object.database = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6535,6 +7192,8 @@ } if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) object.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.toObject(message.kubernetes, options); + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); return object; }; diff --git a/protos/protos.json b/protos/protos.json index 045161f0..cbf6d0da 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -44,6 +44,31 @@ "methodName": { "type": "string", "id": 6 + }, + "principalSubject": { + "type": "string", + "id": 7 + }, + "serviceAccountKeyName": { + "type": "string", + "id": 8 + }, + "serviceAccountDelegationInfo": { + "rule": "repeated", + "type": "ServiceAccountDelegationInfo", + "id": 9 + } + } + }, + "ServiceAccountDelegationInfo": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "principalSubject": { + "type": "string", + "id": 2 } } }, @@ -336,6 +361,31 @@ } } }, + "Database": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "userName": { + "type": "string", + "id": 3 + }, + "query": { + "type": "string", + "id": 4 + }, + "grantees": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, "Exfiltration": { "fields": { "sources": { @@ -569,6 +619,10 @@ "kubernetes": { "type": "Kubernetes", "id": 43 + }, + "database": { + "type": "Database", + "id": 44 } }, "nested": { diff --git a/src/v1/security_center_client.ts b/src/v1/security_center_client.ts index 25c60536..5246b763 100644 --- a/src/v1/security_center_client.ts +++ b/src/v1/security_center_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './security_center_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SecurityCenterClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - */ - constructor(opts?: ClientOptions) { + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SecurityCenterClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = @@ -120,8 +128,13 @@ export class SecurityCenterClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -373,7 +386,7 @@ export class SecurityCenterClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -620,7 +633,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -720,7 +733,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -826,7 +839,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -932,7 +945,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1036,7 +1049,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1134,7 +1147,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1238,7 +1251,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1325,7 +1338,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1419,7 +1432,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1517,7 +1530,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1615,7 +1628,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1711,7 +1724,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1809,7 +1822,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1901,7 +1914,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1996,7 +2009,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -2085,7 +2098,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -2186,7 +2199,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'external_system.name': request.externalSystem!.name || '', }); this.initialize(); @@ -2291,7 +2304,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); this.initialize(); @@ -2391,7 +2404,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'mute_config.name': request.muteConfig!.name || '', }); this.initialize(); @@ -2494,7 +2507,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'notification_config.name': request.notificationConfig!.name || '', }); this.initialize(); @@ -2599,7 +2612,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); @@ -2698,7 +2711,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); this.initialize(); @@ -2806,7 +2819,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); @@ -2912,7 +2925,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3012,7 +3025,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -3112,7 +3125,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'big_query_export.name': request.bigQueryExport!.name || '', }); this.initialize(); @@ -3244,7 +3257,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3270,11 +3283,12 @@ export class SecurityCenterClient { protos.google.protobuf.Empty > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.bulkMuteFindings, this._gaxModule.createDefaultBackoffSettings() @@ -3387,7 +3401,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3413,11 +3427,12 @@ export class SecurityCenterClient { protos.google.protobuf.Empty > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings() @@ -3640,7 +3655,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3798,7 +3813,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -3965,7 +3980,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -4198,7 +4213,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4359,7 +4374,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -4529,7 +4544,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -4757,7 +4772,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4919,7 +4934,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -5090,7 +5105,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -5326,7 +5341,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -5493,7 +5508,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -5669,7 +5684,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -5782,7 +5797,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -5829,7 +5844,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listMuteConfigs']; @@ -5885,7 +5900,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listMuteConfigs']; @@ -5993,7 +6008,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -6039,7 +6054,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -6090,7 +6105,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -6199,7 +6214,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -6242,7 +6257,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -6294,7 +6309,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -6410,7 +6425,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -6456,7 +6471,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listBigQueryExports']; @@ -6511,7 +6526,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listBigQueryExports']; diff --git a/src/v1/security_center_proto_list.json b/src/v1/security_center_proto_list.json index ab7c31b0..be5b8aea 100644 --- a/src/v1/security_center_proto_list.json +++ b/src/v1/security_center_proto_list.json @@ -6,6 +6,7 @@ "../../protos/google/cloud/securitycenter/v1/connection.proto", "../../protos/google/cloud/securitycenter/v1/contact_details.proto", "../../protos/google/cloud/securitycenter/v1/container.proto", + "../../protos/google/cloud/securitycenter/v1/database.proto", "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/file.proto", diff --git a/src/v1beta1/security_center_client.ts b/src/v1beta1/security_center_client.ts index 59678a4d..82a3b22e 100644 --- a/src/v1beta1/security_center_client.ts +++ b/src/v1beta1/security_center_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './security_center_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SecurityCenterClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SecurityCenterClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = @@ -120,8 +128,13 @@ export class SecurityCenterClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -283,7 +296,7 @@ export class SecurityCenterClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -519,7 +532,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -625,7 +638,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -712,7 +725,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -810,7 +823,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -906,7 +919,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1010,7 +1023,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1105,7 +1118,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1194,7 +1207,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1300,7 +1313,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); this.initialize(); @@ -1399,7 +1412,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); @@ -1502,7 +1515,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); this.initialize(); @@ -1603,7 +1616,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); @@ -1698,7 +1711,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1721,11 +1734,12 @@ export class SecurityCenterClient { ): Promise< LROperation > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings() @@ -1902,7 +1916,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2014,7 +2028,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2135,7 +2149,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2292,7 +2306,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2379,7 +2393,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -2475,7 +2489,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -2653,7 +2667,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2765,7 +2779,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -2886,7 +2900,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -3042,7 +3056,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3129,7 +3143,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -3225,7 +3239,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -3333,7 +3347,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3375,7 +3389,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -3426,7 +3440,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; diff --git a/src/v1p1beta1/security_center_client.ts b/src/v1p1beta1/security_center_client.ts index 8d140e08..58105fdb 100644 --- a/src/v1p1beta1/security_center_client.ts +++ b/src/v1p1beta1/security_center_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './security_center_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SecurityCenterClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SecurityCenterClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = @@ -120,8 +128,13 @@ export class SecurityCenterClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -323,7 +336,7 @@ export class SecurityCenterClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -564,7 +577,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -668,7 +681,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -773,7 +786,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -875,7 +888,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -966,7 +979,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1064,7 +1077,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1162,7 +1175,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1264,7 +1277,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1368,7 +1381,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1463,7 +1476,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1552,7 +1565,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1663,7 +1676,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); this.initialize(); @@ -1765,7 +1778,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'notification_config.name': request.notificationConfig!.name || '', }); this.initialize(); @@ -1870,7 +1883,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); @@ -1975,7 +1988,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); this.initialize(); @@ -2082,7 +2095,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); @@ -2192,7 +2205,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2218,11 +2231,12 @@ export class SecurityCenterClient { protos.google.protobuf.Empty > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings() @@ -2445,7 +2459,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2603,7 +2617,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2770,7 +2784,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2994,7 +3008,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3146,7 +3160,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -3307,7 +3321,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -3535,7 +3549,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3697,7 +3711,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -3868,7 +3882,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -4093,7 +4107,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4249,7 +4263,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -4414,7 +4428,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -4522,7 +4536,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4568,7 +4582,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -4619,7 +4633,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -4728,7 +4742,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4771,7 +4785,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -4823,7 +4837,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources'];