From a2328d88189081ce1d3342470d1ffcedfc0c78be Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:20:28 -0400 Subject: [PATCH 01/16] feat: [sql] A new field `max_chargeable_bytes` is added to message `.google.cloud.sql.v1.BackupRun` (#5631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: A new field `max_chargeable_bytes` is added to message `.google.cloud.sql.v1.BackupRun` feat: A new enum `CaMode` is added feat: A new field `server_ca_mode` is added to message `.google.cloud.sql.v1.ConnectSettings` feat: A new field `satisfies_pzi` is added to message `.google.cloud.sql.v1.DatabaseInstance` feat: A new field `switch_transaction_logs_to_cloud_storage_enabled` is added to message `.google.cloud.sql.v1.DatabaseInstance` feat: A new value `UNSUPPORTED_COLUMNS` is added to enum `SqlExternalSyncSettingErrorType` feat: A new enum `CaMode` is added feat: A new field `server_ca_mode` is added to message `.google.cloud.sql.v1.IpConfiguration` feat: A new value `MAJOR_VERSION_UPGRADE` is added to enum `SqlOperationType` docs: A comment for method `AddServerCa` in service `SqlInstancesService` is changed docs: A comment for method `RotateServerCa` in service `SqlInstancesService` is changed PiperOrigin-RevId: 665459194 Source-Link: https://github.com/googleapis/googleapis/commit/9f3335a0e878045695f831e91ec132ff9c57742d Source-Link: https://github.com/googleapis/googleapis-gen/commit/b05ca9128c2a352ce917733e5db19b6ad88818b0 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNxbC8uT3dsQm90LnlhbWwiLCJoIjoiYjA1Y2E5MTI4YzJhMzUyY2U5MTc3MzNlNWRiMTliNmFkODg4MThiMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../cloud/sql/v1/cloud_sql_backup_runs.proto | 4 + .../cloud/sql/v1/cloud_sql_connect.proto | 16 + .../cloud/sql/v1/cloud_sql_instances.proto | 24 +- .../cloud/sql/v1/cloud_sql_resources.proto | 19 ++ packages/google-cloud-sql/protos/protos.d.ts | 62 +++- packages/google-cloud-sql/protos/protos.js | 279 ++++++++++++++++++ packages/google-cloud-sql/protos/protos.json | 73 ++++- .../snippet_metadata_google.cloud.sql.v1.json | 4 +- .../src/v1/sql_instances_service_client.ts | 8 +- 9 files changed, 479 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_backup_runs.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_backup_runs.proto index 53e4ff19d8a..14097c2f6d3 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_backup_runs.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_backup_runs.proto @@ -187,6 +187,10 @@ message BackupRun { // Backup time zone to prevent restores to an instance with // a different time zone. Now relevant only for SQL Server. string time_zone = 23; + + // Output only. The maximum chargeable bytes for the backup. + optional int64 max_chargeable_bytes = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Backup run list results. diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_connect.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_connect.proto index 590e1cc8edc..3ee9b6afe12 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_connect.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_connect.proto @@ -73,6 +73,19 @@ message GetConnectSettingsRequest { // Connect settings retrieval response. message ConnectSettings { + // Various Certificate Authority (CA) modes for certificate signing. + enum CaMode { + // CA mode is unknown. + CA_MODE_UNSPECIFIED = 0; + + // Google-managed self-signed internal CA. + GOOGLE_MANAGED_INTERNAL_CA = 1; + + // Google-managed regional CA part of root CA hierarchy hosted on Google + // Cloud's Certificate Authority Service (CAS). + GOOGLE_MANAGED_CAS_CA = 2; + } + // This is always `sql#connectSettings`. string kind = 1; @@ -110,6 +123,9 @@ message ConnectSettings { // The dns name of the instance. string dns_name = 34; + + // Specify what type of CA is used for the server certificate. + CaMode server_ca_mode = 35; } // Ephemeral certificate creation request. diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto index d80a1367a74..3c4b6a1fe7e 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto @@ -40,7 +40,9 @@ service SqlInstancesService { // instance. Required to prepare for a certificate rotation. If a CA version // was previously added but never used in a certificate rotation, this // operation replaces that version. There cannot be more than one CA version - // waiting to be rotated in. + // waiting to be rotated in. For instances that have enabled Certificate + // Authority Service (CAS) based server CA, please use AddServerCertificate to + // add a new server certificate. rpc AddServerCa(SqlInstancesAddServerCaRequest) returns (Operation) { option (google.api.http) = { post: "/v1/projects/{project}/instances/{instance}/addServerCa" @@ -207,7 +209,9 @@ service SqlInstancesService { } // Rotates the server certificate to one signed by the Certificate Authority - // (CA) version previously added with the addServerCA method. + // (CA) version previously added with the addServerCA method. For instances + // that have enabled Certificate Authority Service (CAS) based server CA, + // please use RotateServerCertificate to rotate the server certificate. rpc RotateServerCa(SqlInstancesRotateServerCaRequest) returns (Operation) { option (google.api.http) = { post: "/v1/projects/{project}/instances/{instance}/rotateServerCa" @@ -1269,6 +1273,18 @@ message DatabaseInstance { // Gemini instance configuration. optional GeminiInstanceConfig gemini_config = 55; + + // Output only. This status indicates whether the instance satisfies PZI. + // + // The status is reserved for future use. + google.protobuf.BoolValue satisfies_pzi = 56 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Whether Cloud SQL is enabled to switch storing point-in-time + // recovery log files from a data disk to Cloud Storage. + optional google.protobuf.BoolValue + switch_transaction_logs_to_cloud_storage_enabled = 57 + [(google.api.field_behavior) = INPUT_ONLY]; } // Gemini instance configuration. @@ -1617,6 +1633,10 @@ message SqlExternalSyncSettingError { // data to the destination instance, you must enable the PGAudit extension // on the instance. EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48; + + // The source database has generated columns that can't be migrated. Please + // change them to regular columns before migration. + UNSUPPORTED_COLUMNS = 49; } // Can be `sql#externalSyncSettingError` or diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto index 2d58196e67c..87c55e5d2c1 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto @@ -636,6 +636,19 @@ message IpConfiguration { TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; } + // Various Certificate Authority (CA) modes for certificate signing. + enum CaMode { + // CA mode is unknown. + CA_MODE_UNSPECIFIED = 0; + + // Google-managed self-signed internal CA. + GOOGLE_MANAGED_INTERNAL_CA = 1; + + // Google-managed regional CA part of root CA hierarchy hosted on Google + // Cloud's Certificate Authority Service (CAS). + GOOGLE_MANAGED_CAS_CA = 2; + } + // Whether the instance is assigned a public IP address or not. google.protobuf.BoolValue ipv4_enabled = 1; @@ -699,6 +712,9 @@ message IpConfiguration { // PSC settings for this instance. optional PscConfig psc_config = 9; + + // Specify what type of CA is used for the server certificate. + optional CaMode server_ca_mode = 10; } // PSC settings for a Cloud SQL instance. @@ -1035,6 +1051,9 @@ message Operation { // Switches a primary instance to a replica. This operation runs as part of // a switchover operation to the original primary instance. SWITCHOVER_TO_REPLICA = 47; + + // Updates the major version of a Cloud SQL instance. + MAJOR_VERSION_UPGRADE = 48; } // The status of an operation. diff --git a/packages/google-cloud-sql/protos/protos.d.ts b/packages/google-cloud-sql/protos/protos.d.ts index c92fcf988eb..6f811bba9aa 100644 --- a/packages/google-cloud-sql/protos/protos.d.ts +++ b/packages/google-cloud-sql/protos/protos.d.ts @@ -650,6 +650,9 @@ export namespace google { /** BackupRun timeZone */ timeZone?: (string|null); + + /** BackupRun maxChargeableBytes */ + maxChargeableBytes?: (number|Long|string|null); } /** Represents a BackupRun. */ @@ -712,6 +715,12 @@ export namespace google { /** BackupRun timeZone. */ public timeZone: string; + /** BackupRun maxChargeableBytes. */ + public maxChargeableBytes?: (number|Long|string|null); + + /** BackupRun _maxChargeableBytes. */ + public _maxChargeableBytes?: "maxChargeableBytes"; + /** * Creates a new BackupRun instance using the specified properties. * @param [properties] Properties to set @@ -4019,6 +4028,9 @@ export namespace google { /** IpConfiguration pscConfig */ pscConfig?: (google.cloud.sql.v1.IPscConfig|null); + + /** IpConfiguration serverCaMode */ + serverCaMode?: (google.cloud.sql.v1.IpConfiguration.CaMode|keyof typeof google.cloud.sql.v1.IpConfiguration.CaMode|null); } /** Represents an IpConfiguration. */ @@ -4054,9 +4066,15 @@ export namespace google { /** IpConfiguration pscConfig. */ public pscConfig?: (google.cloud.sql.v1.IPscConfig|null); + /** IpConfiguration serverCaMode. */ + public serverCaMode?: (google.cloud.sql.v1.IpConfiguration.CaMode|keyof typeof google.cloud.sql.v1.IpConfiguration.CaMode|null); + /** IpConfiguration _pscConfig. */ public _pscConfig?: "pscConfig"; + /** IpConfiguration _serverCaMode. */ + public _serverCaMode?: "serverCaMode"; + /** * Creates a new IpConfiguration instance using the specified properties. * @param [properties] Properties to set @@ -4144,6 +4162,13 @@ export namespace google { ENCRYPTED_ONLY = 2, TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3 } + + /** CaMode enum. */ + enum CaMode { + CA_MODE_UNSPECIFIED = 0, + GOOGLE_MANAGED_INTERNAL_CA = 1, + GOOGLE_MANAGED_CAS_CA = 2 + } } /** Properties of a PscConfig. */ @@ -5431,7 +5456,8 @@ export namespace google { RECONFIGURE_OLD_PRIMARY = 44, CLUSTER_MAINTENANCE = 45, SELF_SERVICE_MAINTENANCE = 46, - SWITCHOVER_TO_REPLICA = 47 + SWITCHOVER_TO_REPLICA = 47, + MAJOR_VERSION_UPGRADE = 48 } /** SqlOperationStatus enum. */ @@ -7207,6 +7233,9 @@ export namespace google { /** ConnectSettings dnsName */ dnsName?: (string|null); + + /** ConnectSettings serverCaMode */ + serverCaMode?: (google.cloud.sql.v1.ConnectSettings.CaMode|keyof typeof google.cloud.sql.v1.ConnectSettings.CaMode|null); } /** Represents a ConnectSettings. */ @@ -7242,6 +7271,9 @@ export namespace google { /** ConnectSettings dnsName. */ public dnsName: string; + /** ConnectSettings serverCaMode. */ + public serverCaMode: (google.cloud.sql.v1.ConnectSettings.CaMode|keyof typeof google.cloud.sql.v1.ConnectSettings.CaMode); + /** * Creates a new ConnectSettings instance using the specified properties. * @param [properties] Properties to set @@ -7320,6 +7352,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace ConnectSettings { + + /** CaMode enum. */ + enum CaMode { + CA_MODE_UNSPECIFIED = 0, + GOOGLE_MANAGED_INTERNAL_CA = 1, + GOOGLE_MANAGED_CAS_CA = 2 + } + } + /** Properties of a GenerateEphemeralCertRequest. */ interface IGenerateEphemeralCertRequest { @@ -15280,6 +15322,12 @@ export namespace google { /** DatabaseInstance geminiConfig */ geminiConfig?: (google.cloud.sql.v1.IGeminiInstanceConfig|null); + + /** DatabaseInstance satisfiesPzi */ + satisfiesPzi?: (google.protobuf.IBoolValue|null); + + /** DatabaseInstance switchTransactionLogsToCloudStorageEnabled */ + switchTransactionLogsToCloudStorageEnabled?: (google.protobuf.IBoolValue|null); } /** Represents a DatabaseInstance. */ @@ -15423,6 +15471,12 @@ export namespace google { /** DatabaseInstance geminiConfig. */ public geminiConfig?: (google.cloud.sql.v1.IGeminiInstanceConfig|null); + /** DatabaseInstance satisfiesPzi. */ + public satisfiesPzi?: (google.protobuf.IBoolValue|null); + + /** DatabaseInstance switchTransactionLogsToCloudStorageEnabled. */ + public switchTransactionLogsToCloudStorageEnabled?: (google.protobuf.IBoolValue|null); + /** DatabaseInstance _outOfDiskReport. */ public _outOfDiskReport?: "outOfDiskReport"; @@ -15444,6 +15498,9 @@ export namespace google { /** DatabaseInstance _geminiConfig. */ public _geminiConfig?: "geminiConfig"; + /** DatabaseInstance _switchTransactionLogsToCloudStorageEnabled. */ + public _switchTransactionLogsToCloudStorageEnabled?: "switchTransactionLogsToCloudStorageEnabled"; + /** * Creates a new DatabaseInstance instance using the specified properties. * @param [properties] Properties to set @@ -17276,7 +17333,8 @@ export namespace google { UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45, EXTENSIONS_NOT_MIGRATED = 46, PG_CRON_FLAG_ENABLED_IN_REPLICA = 47, - EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48 + EXTENSIONS_NOT_ENABLED_IN_REPLICA = 48, + UNSUPPORTED_COLUMNS = 49 } } diff --git a/packages/google-cloud-sql/protos/protos.js b/packages/google-cloud-sql/protos/protos.js index e908f8feeb8..57244160d3d 100644 --- a/packages/google-cloud-sql/protos/protos.js +++ b/packages/google-cloud-sql/protos/protos.js @@ -1347,6 +1347,7 @@ * @property {google.cloud.sql.v1.IDiskEncryptionStatus|null} [diskEncryptionStatus] BackupRun diskEncryptionStatus * @property {google.cloud.sql.v1.SqlBackupKind|null} [backupKind] BackupRun backupKind * @property {string|null} [timeZone] BackupRun timeZone + * @property {number|Long|null} [maxChargeableBytes] BackupRun maxChargeableBytes */ /** @@ -1500,6 +1501,28 @@ */ BackupRun.prototype.timeZone = ""; + /** + * BackupRun maxChargeableBytes. + * @member {number|Long|null|undefined} maxChargeableBytes + * @memberof google.cloud.sql.v1.BackupRun + * @instance + */ + BackupRun.prototype.maxChargeableBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupRun _maxChargeableBytes. + * @member {"maxChargeableBytes"|undefined} _maxChargeableBytes + * @memberof google.cloud.sql.v1.BackupRun + * @instance + */ + Object.defineProperty(BackupRun.prototype, "_maxChargeableBytes", { + get: $util.oneOfGetter($oneOfFields = ["maxChargeableBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new BackupRun instance using the specified properties. * @function create @@ -1558,6 +1581,8 @@ writer.uint32(/* id 19, wireType 0 =*/152).int32(message.backupKind); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) writer.uint32(/* id 23, wireType 2 =*/186).string(message.timeZone); + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) + writer.uint32(/* id 24, wireType 0 =*/192).int64(message.maxChargeableBytes); return writer; }; @@ -1660,6 +1685,10 @@ message.timeZone = reader.string(); break; } + case 24: { + message.maxChargeableBytes = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -1695,6 +1724,7 @@ BackupRun.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.kind != null && message.hasOwnProperty("kind")) if (!$util.isString(message.kind)) return "kind: string expected"; @@ -1785,6 +1815,11 @@ if (message.timeZone != null && message.hasOwnProperty("timeZone")) if (!$util.isString(message.timeZone)) return "timeZone: string expected"; + if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { + properties._maxChargeableBytes = 1; + if (!$util.isInteger(message.maxChargeableBytes) && !(message.maxChargeableBytes && $util.isInteger(message.maxChargeableBytes.low) && $util.isInteger(message.maxChargeableBytes.high))) + return "maxChargeableBytes: integer|Long expected"; + } return null; }; @@ -1944,6 +1979,15 @@ } if (object.timeZone != null) message.timeZone = String(object.timeZone); + if (object.maxChargeableBytes != null) + if ($util.Long) + (message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes)).unsigned = false; + else if (typeof object.maxChargeableBytes === "string") + message.maxChargeableBytes = parseInt(object.maxChargeableBytes, 10); + else if (typeof object.maxChargeableBytes === "number") + message.maxChargeableBytes = object.maxChargeableBytes; + else if (typeof object.maxChargeableBytes === "object") + message.maxChargeableBytes = new $util.LongBits(object.maxChargeableBytes.low >>> 0, object.maxChargeableBytes.high >>> 0).toNumber(); return message; }; @@ -2020,6 +2064,14 @@ object.backupKind = options.enums === String ? $root.google.cloud.sql.v1.SqlBackupKind[message.backupKind] === undefined ? message.backupKind : $root.google.cloud.sql.v1.SqlBackupKind[message.backupKind] : message.backupKind; if (message.timeZone != null && message.hasOwnProperty("timeZone")) object.timeZone = message.timeZone; + if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { + if (typeof message.maxChargeableBytes === "number") + object.maxChargeableBytes = options.longs === String ? String(message.maxChargeableBytes) : message.maxChargeableBytes; + else + object.maxChargeableBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxChargeableBytes) : options.longs === Number ? new $util.LongBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0).toNumber() : message.maxChargeableBytes; + if (options.oneofs) + object._maxChargeableBytes = "maxChargeableBytes"; + } return object; }; @@ -10145,6 +10197,7 @@ * @property {google.protobuf.IBoolValue|null} [enablePrivatePathForGoogleCloudServices] IpConfiguration enablePrivatePathForGoogleCloudServices * @property {google.cloud.sql.v1.IpConfiguration.SslMode|null} [sslMode] IpConfiguration sslMode * @property {google.cloud.sql.v1.IPscConfig|null} [pscConfig] IpConfiguration pscConfig + * @property {google.cloud.sql.v1.IpConfiguration.CaMode|null} [serverCaMode] IpConfiguration serverCaMode */ /** @@ -10227,6 +10280,14 @@ */ IpConfiguration.prototype.pscConfig = null; + /** + * IpConfiguration serverCaMode. + * @member {google.cloud.sql.v1.IpConfiguration.CaMode|null|undefined} serverCaMode + * @memberof google.cloud.sql.v1.IpConfiguration + * @instance + */ + IpConfiguration.prototype.serverCaMode = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -10241,6 +10302,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * IpConfiguration _serverCaMode. + * @member {"serverCaMode"|undefined} _serverCaMode + * @memberof google.cloud.sql.v1.IpConfiguration + * @instance + */ + Object.defineProperty(IpConfiguration.prototype, "_serverCaMode", { + get: $util.oneOfGetter($oneOfFields = ["serverCaMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new IpConfiguration instance using the specified properties. * @function create @@ -10282,6 +10354,8 @@ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.sslMode); if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) $root.google.cloud.sql.v1.PscConfig.encode(message.pscConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.serverCaMode); return writer; }; @@ -10350,6 +10424,10 @@ message.pscConfig = $root.google.cloud.sql.v1.PscConfig.decode(reader, reader.uint32()); break; } + case 10: { + message.serverCaMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -10434,6 +10512,17 @@ return "pscConfig." + error; } } + if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) { + properties._serverCaMode = 1; + switch (message.serverCaMode) { + default: + return "serverCaMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } return null; }; @@ -10507,6 +10596,26 @@ throw TypeError(".google.cloud.sql.v1.IpConfiguration.pscConfig: object expected"); message.pscConfig = $root.google.cloud.sql.v1.PscConfig.fromObject(object.pscConfig); } + switch (object.serverCaMode) { + default: + if (typeof object.serverCaMode === "number") { + message.serverCaMode = object.serverCaMode; + break; + } + break; + case "CA_MODE_UNSPECIFIED": + case 0: + message.serverCaMode = 0; + break; + case "GOOGLE_MANAGED_INTERNAL_CA": + case 1: + message.serverCaMode = 1; + break; + case "GOOGLE_MANAGED_CAS_CA": + case 2: + message.serverCaMode = 2; + break; + } return message; }; @@ -10555,6 +10664,11 @@ if (options.oneofs) object._pscConfig = "pscConfig"; } + if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) { + object.serverCaMode = options.enums === String ? $root.google.cloud.sql.v1.IpConfiguration.CaMode[message.serverCaMode] === undefined ? message.serverCaMode : $root.google.cloud.sql.v1.IpConfiguration.CaMode[message.serverCaMode] : message.serverCaMode; + if (options.oneofs) + object._serverCaMode = "serverCaMode"; + } return object; }; @@ -10602,6 +10716,22 @@ return values; })(); + /** + * CaMode enum. + * @name google.cloud.sql.v1.IpConfiguration.CaMode + * @enum {number} + * @property {number} CA_MODE_UNSPECIFIED=0 CA_MODE_UNSPECIFIED value + * @property {number} GOOGLE_MANAGED_INTERNAL_CA=1 GOOGLE_MANAGED_INTERNAL_CA value + * @property {number} GOOGLE_MANAGED_CAS_CA=2 GOOGLE_MANAGED_CAS_CA value + */ + IpConfiguration.CaMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CA_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_MANAGED_INTERNAL_CA"] = 1; + values[valuesById[2] = "GOOGLE_MANAGED_CAS_CA"] = 2; + return values; + })(); + return IpConfiguration; })(); @@ -13678,6 +13808,7 @@ case 45: case 46: case 47: + case 48: break; } if (message.importContext != null && message.hasOwnProperty("importContext")) { @@ -13969,6 +14100,10 @@ case 47: message.operationType = 47; break; + case "MAJOR_VERSION_UPGRADE": + case 48: + message.operationType = 48; + break; } if (object.importContext != null) { if (typeof object.importContext !== "object") @@ -14148,6 +14283,7 @@ * @property {number} CLUSTER_MAINTENANCE=45 CLUSTER_MAINTENANCE value * @property {number} SELF_SERVICE_MAINTENANCE=46 SELF_SERVICE_MAINTENANCE value * @property {number} SWITCHOVER_TO_REPLICA=47 SWITCHOVER_TO_REPLICA value + * @property {number} MAJOR_VERSION_UPGRADE=48 MAJOR_VERSION_UPGRADE value */ Operation.SqlOperationType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -14196,6 +14332,7 @@ values[valuesById[45] = "CLUSTER_MAINTENANCE"] = 45; values[valuesById[46] = "SELF_SERVICE_MAINTENANCE"] = 46; values[valuesById[47] = "SWITCHOVER_TO_REPLICA"] = 47; + values[valuesById[48] = "MAJOR_VERSION_UPGRADE"] = 48; return values; })(); @@ -18982,6 +19119,7 @@ * @property {google.cloud.sql.v1.SqlBackendType|null} [backendType] ConnectSettings backendType * @property {boolean|null} [pscEnabled] ConnectSettings pscEnabled * @property {string|null} [dnsName] ConnectSettings dnsName + * @property {google.cloud.sql.v1.ConnectSettings.CaMode|null} [serverCaMode] ConnectSettings serverCaMode */ /** @@ -19064,6 +19202,14 @@ */ ConnectSettings.prototype.dnsName = ""; + /** + * ConnectSettings serverCaMode. + * @member {google.cloud.sql.v1.ConnectSettings.CaMode} serverCaMode + * @memberof google.cloud.sql.v1.ConnectSettings + * @instance + */ + ConnectSettings.prototype.serverCaMode = 0; + /** * Creates a new ConnectSettings instance using the specified properties. * @function create @@ -19105,6 +19251,8 @@ writer.uint32(/* id 33, wireType 0 =*/264).bool(message.pscEnabled); if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) writer.uint32(/* id 34, wireType 2 =*/274).string(message.dnsName); + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) + writer.uint32(/* id 35, wireType 0 =*/280).int32(message.serverCaMode); return writer; }; @@ -19173,6 +19321,10 @@ message.dnsName = reader.string(); break; } + case 35: { + message.serverCaMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -19294,6 +19446,15 @@ if (message.dnsName != null && message.hasOwnProperty("dnsName")) if (!$util.isString(message.dnsName)) return "dnsName: string expected"; + if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) + switch (message.serverCaMode) { + default: + return "serverCaMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -19540,6 +19701,26 @@ message.pscEnabled = Boolean(object.pscEnabled); if (object.dnsName != null) message.dnsName = String(object.dnsName); + switch (object.serverCaMode) { + default: + if (typeof object.serverCaMode === "number") { + message.serverCaMode = object.serverCaMode; + break; + } + break; + case "CA_MODE_UNSPECIFIED": + case 0: + message.serverCaMode = 0; + break; + case "GOOGLE_MANAGED_INTERNAL_CA": + case 1: + message.serverCaMode = 1; + break; + case "GOOGLE_MANAGED_CAS_CA": + case 2: + message.serverCaMode = 2; + break; + } return message; }; @@ -19566,6 +19747,7 @@ object.backendType = options.enums === String ? "SQL_BACKEND_TYPE_UNSPECIFIED" : 0; object.pscEnabled = false; object.dnsName = ""; + object.serverCaMode = options.enums === String ? "CA_MODE_UNSPECIFIED" : 0; } if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; @@ -19586,6 +19768,8 @@ object.pscEnabled = message.pscEnabled; if (message.dnsName != null && message.hasOwnProperty("dnsName")) object.dnsName = message.dnsName; + if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) + object.serverCaMode = options.enums === String ? $root.google.cloud.sql.v1.ConnectSettings.CaMode[message.serverCaMode] === undefined ? message.serverCaMode : $root.google.cloud.sql.v1.ConnectSettings.CaMode[message.serverCaMode] : message.serverCaMode; return object; }; @@ -19615,6 +19799,22 @@ return typeUrlPrefix + "/google.cloud.sql.v1.ConnectSettings"; }; + /** + * CaMode enum. + * @name google.cloud.sql.v1.ConnectSettings.CaMode + * @enum {number} + * @property {number} CA_MODE_UNSPECIFIED=0 CA_MODE_UNSPECIFIED value + * @property {number} GOOGLE_MANAGED_INTERNAL_CA=1 GOOGLE_MANAGED_INTERNAL_CA value + * @property {number} GOOGLE_MANAGED_CAS_CA=2 GOOGLE_MANAGED_CAS_CA value + */ + ConnectSettings.CaMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CA_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_MANAGED_INTERNAL_CA"] = 1; + values[valuesById[2] = "GOOGLE_MANAGED_CAS_CA"] = 2; + return values; + })(); + return ConnectSettings; })(); @@ -37731,6 +37931,8 @@ * @property {string|null} [writeEndpoint] DatabaseInstance writeEndpoint * @property {google.cloud.sql.v1.IReplicationCluster|null} [replicationCluster] DatabaseInstance replicationCluster * @property {google.cloud.sql.v1.IGeminiInstanceConfig|null} [geminiConfig] DatabaseInstance geminiConfig + * @property {google.protobuf.IBoolValue|null} [satisfiesPzi] DatabaseInstance satisfiesPzi + * @property {google.protobuf.IBoolValue|null} [switchTransactionLogsToCloudStorageEnabled] DatabaseInstance switchTransactionLogsToCloudStorageEnabled */ /** @@ -38105,6 +38307,22 @@ */ DatabaseInstance.prototype.geminiConfig = null; + /** + * DatabaseInstance satisfiesPzi. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzi + * @memberof google.cloud.sql.v1.DatabaseInstance + * @instance + */ + DatabaseInstance.prototype.satisfiesPzi = null; + + /** + * DatabaseInstance switchTransactionLogsToCloudStorageEnabled. + * @member {google.protobuf.IBoolValue|null|undefined} switchTransactionLogsToCloudStorageEnabled + * @memberof google.cloud.sql.v1.DatabaseInstance + * @instance + */ + DatabaseInstance.prototype.switchTransactionLogsToCloudStorageEnabled = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -38185,6 +38403,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * DatabaseInstance _switchTransactionLogsToCloudStorageEnabled. + * @member {"switchTransactionLogsToCloudStorageEnabled"|undefined} _switchTransactionLogsToCloudStorageEnabled + * @memberof google.cloud.sql.v1.DatabaseInstance + * @instance + */ + Object.defineProperty(DatabaseInstance.prototype, "_switchTransactionLogsToCloudStorageEnabled", { + get: $util.oneOfGetter($oneOfFields = ["switchTransactionLogsToCloudStorageEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new DatabaseInstance instance using the specified properties. * @function create @@ -38305,6 +38534,10 @@ $root.google.cloud.sql.v1.ReplicationCluster.encode(message.replicationCluster, writer.uint32(/* id 54, wireType 2 =*/434).fork()).ldelim(); if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) $root.google.cloud.sql.v1.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) + $root.google.protobuf.BoolValue.encode(message.switchTransactionLogsToCloudStorageEnabled, writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); return writer; }; @@ -38530,6 +38763,14 @@ message.geminiConfig = $root.google.cloud.sql.v1.GeminiInstanceConfig.decode(reader, reader.uint32()); break; } + case 56: { + message.satisfiesPzi = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 57: { + message.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -38854,6 +39095,19 @@ return "geminiConfig." + error; } } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzi); + if (error) + return "satisfiesPzi." + error; + } + if (message.switchTransactionLogsToCloudStorageEnabled != null && message.hasOwnProperty("switchTransactionLogsToCloudStorageEnabled")) { + properties._switchTransactionLogsToCloudStorageEnabled = 1; + { + var error = $root.google.protobuf.BoolValue.verify(message.switchTransactionLogsToCloudStorageEnabled); + if (error) + return "switchTransactionLogsToCloudStorageEnabled." + error; + } + } return null; }; @@ -39341,6 +39595,16 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.geminiConfig: object expected"); message.geminiConfig = $root.google.cloud.sql.v1.GeminiInstanceConfig.fromObject(object.geminiConfig); } + if (object.satisfiesPzi != null) { + if (typeof object.satisfiesPzi !== "object") + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.satisfiesPzi: object expected"); + message.satisfiesPzi = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzi); + } + if (object.switchTransactionLogsToCloudStorageEnabled != null) { + if (typeof object.switchTransactionLogsToCloudStorageEnabled !== "object") + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.switchTransactionLogsToCloudStorageEnabled: object expected"); + message.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.fromObject(object.switchTransactionLogsToCloudStorageEnabled); + } return message; }; @@ -39397,6 +39661,7 @@ object.databaseInstalledVersion = ""; object.maintenanceVersion = ""; object.replicationCluster = null; + object.satisfiesPzi = null; } if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; @@ -39522,6 +39787,13 @@ if (options.oneofs) object._geminiConfig = "geminiConfig"; } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options); + if (message.switchTransactionLogsToCloudStorageEnabled != null && message.hasOwnProperty("switchTransactionLogsToCloudStorageEnabled")) { + object.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.toObject(message.switchTransactionLogsToCloudStorageEnabled, options); + if (options.oneofs) + object._switchTransactionLogsToCloudStorageEnabled = "switchTransactionLogsToCloudStorageEnabled"; + } return object; }; @@ -43607,6 +43879,7 @@ case 46: case 47: case 48: + case 49: break; } if (message.detail != null && message.hasOwnProperty("detail")) @@ -43832,6 +44105,10 @@ case 48: message.type = 48; break; + case "UNSUPPORTED_COLUMNS": + case 49: + message.type = 49; + break; } if (object.detail != null) message.detail = String(object.detail); @@ -43944,6 +44221,7 @@ * @property {number} EXTENSIONS_NOT_MIGRATED=46 EXTENSIONS_NOT_MIGRATED value * @property {number} PG_CRON_FLAG_ENABLED_IN_REPLICA=47 PG_CRON_FLAG_ENABLED_IN_REPLICA value * @property {number} EXTENSIONS_NOT_ENABLED_IN_REPLICA=48 EXTENSIONS_NOT_ENABLED_IN_REPLICA value + * @property {number} UNSUPPORTED_COLUMNS=49 UNSUPPORTED_COLUMNS value */ SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -43996,6 +44274,7 @@ values[valuesById[46] = "EXTENSIONS_NOT_MIGRATED"] = 46; values[valuesById[47] = "PG_CRON_FLAG_ENABLED_IN_REPLICA"] = 47; values[valuesById[48] = "EXTENSIONS_NOT_ENABLED_IN_REPLICA"] = 48; + values[valuesById[49] = "UNSUPPORTED_COLUMNS"] = 49; return values; })(); diff --git a/packages/google-cloud-sql/protos/protos.json b/packages/google-cloud-sql/protos/protos.json index 10f3a401851..e4d2a26c7c8 100644 --- a/packages/google-cloud-sql/protos/protos.json +++ b/packages/google-cloud-sql/protos/protos.json @@ -155,6 +155,13 @@ } }, "BackupRun": { + "oneofs": { + "_maxChargeableBytes": { + "oneof": [ + "maxChargeableBytes" + ] + } + }, "fields": { "kind": { "type": "string", @@ -223,6 +230,14 @@ "timeZone": { "type": "string", "id": 23 + }, + "maxChargeableBytes": { + "type": "int64", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } } } }, @@ -924,6 +939,11 @@ "oneof": [ "pscConfig" ] + }, + "_serverCaMode": { + "oneof": [ + "serverCaMode" + ] } }, "fields": { @@ -962,6 +982,13 @@ "options": { "proto3_optional": true } + }, + "serverCaMode": { + "type": "CaMode", + "id": 10, + "options": { + "proto3_optional": true + } } }, "nested": { @@ -972,6 +999,13 @@ "ENCRYPTED_ONLY": 2, "TRUSTED_CLIENT_CERTIFICATE_REQUIRED": 3 } + }, + "CaMode": { + "values": { + "CA_MODE_UNSPECIFIED": 0, + "GOOGLE_MANAGED_INTERNAL_CA": 1, + "GOOGLE_MANAGED_CAS_CA": 2 + } } } }, @@ -1311,7 +1345,8 @@ "RECONFIGURE_OLD_PRIMARY": 44, "CLUSTER_MAINTENANCE": 45, "SELF_SERVICE_MAINTENANCE": 46, - "SWITCHOVER_TO_REPLICA": 47 + "SWITCHOVER_TO_REPLICA": 47, + "MAJOR_VERSION_UPGRADE": 48 } }, "SqlOperationStatus": { @@ -1955,6 +1990,19 @@ "dnsName": { "type": "string", "id": 34 + }, + "serverCaMode": { + "type": "CaMode", + "id": 35 + } + }, + "nested": { + "CaMode": { + "values": { + "CA_MODE_UNSPECIFIED": 0, + "GOOGLE_MANAGED_INTERNAL_CA": 1, + "GOOGLE_MANAGED_CAS_CA": 2 + } } } }, @@ -3747,6 +3795,11 @@ "oneof": [ "geminiConfig" ] + }, + "_switchTransactionLogsToCloudStorageEnabled": { + "oneof": [ + "switchTransactionLogsToCloudStorageEnabled" + ] } }, "fields": { @@ -3980,6 +4033,21 @@ "options": { "proto3_optional": true } + }, + "satisfiesPzi": { + "type": "google.protobuf.BoolValue", + "id": 56, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "switchTransactionLogsToCloudStorageEnabled": { + "type": "google.protobuf.BoolValue", + "id": 57, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY", + "proto3_optional": true + } } }, "nested": { @@ -4438,7 +4506,8 @@ "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED": 45, "EXTENSIONS_NOT_MIGRATED": 46, "PG_CRON_FLAG_ENABLED_IN_REPLICA": 47, - "EXTENSIONS_NOT_ENABLED_IN_REPLICA": 48 + "EXTENSIONS_NOT_ENABLED_IN_REPLICA": 48, + "UNSUPPORTED_COLUMNS": 49 } } } diff --git a/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json b/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json index 1bb3319f1e2..10c443ab3d4 100644 --- a/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json +++ b/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json @@ -651,7 +651,7 @@ "regionTag": "sqladmin_v1_generated_SqlInstancesService_AddServerCa_async", "title": "SqlAvailableDatabaseVersionsService addServerCa Sample", "origin": "API_DEFINITION", - "description": " Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.", + "description": " Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. For instances that have enabled Certificate Authority Service (CAS) based server CA, please use AddServerCertificate to add a new server certificate.", "canonical": true, "file": "sql_instances_service.add_server_ca.js", "language": "JAVASCRIPT", @@ -1539,7 +1539,7 @@ "regionTag": "sqladmin_v1_generated_SqlInstancesService_RotateServerCa_async", "title": "SqlAvailableDatabaseVersionsService rotateServerCa Sample", "origin": "API_DEFINITION", - "description": " Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.", + "description": " Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, please use RotateServerCertificate to rotate the server certificate.", "canonical": true, "file": "sql_instances_service.rotate_server_ca.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-sql/src/v1/sql_instances_service_client.ts b/packages/google-cloud-sql/src/v1/sql_instances_service_client.ts index d24d9dcd426..912b8e722f1 100644 --- a/packages/google-cloud-sql/src/v1/sql_instances_service_client.ts +++ b/packages/google-cloud-sql/src/v1/sql_instances_service_client.ts @@ -405,7 +405,9 @@ export class SqlInstancesServiceClient { * instance. Required to prepare for a certificate rotation. If a CA version * was previously added but never used in a certificate rotation, this * operation replaces that version. There cannot be more than one CA version - * waiting to be rotated in. + * waiting to be rotated in. For instances that have enabled Certificate + * Authority Service (CAS) based server CA, please use AddServerCertificate to + * add a new server certificate. * * @param {Object} request * The request object that will be sent. @@ -2171,7 +2173,9 @@ export class SqlInstancesServiceClient { } /** * Rotates the server certificate to one signed by the Certificate Authority - * (CA) version previously added with the addServerCA method. + * (CA) version previously added with the addServerCA method. For instances + * that have enabled Certificate Authority Service (CAS) based server CA, + * please use RotateServerCertificate to rotate the server certificate. * * @param {Object} request * The request object that will be sent. From 7ffa9f518a062c8e88d5c6c908bd00363fc0b683 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:21:09 -0400 Subject: [PATCH 02/16] docs: [css] update `Certification` field descriptions (#5630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update `Certification` field descriptions PiperOrigin-RevId: 665432329 Source-Link: https://github.com/googleapis/googleapis/commit/59883000df20846cf207008980d89ac35be91fb2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bc2954fd1ed5de040517ee07fb84d925cafb1b52 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLWNzcy8uT3dsQm90LnlhbWwiLCJoIjoiYmMyOTU0ZmQxZWQ1ZGUwNDA1MTdlZTA3ZmI4NGQ5MjVjYWZiMWI1MiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../shopping/css/v1/css_product_common.proto | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto b/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto index 574ba45191a..efe9a13ba2f 100644 --- a/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto +++ b/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto @@ -207,15 +207,22 @@ message Attributes { optional string custom_label_4 = 50; } -// The certification for the product. +// The certification for the product. Use the this attribute to describe +// certifications, such as energy efficiency ratings, associated with a product. message Certification { - // Name of the certification. + // The name of the certification. At this time, the most common value is + // "EPREL", which represents energy efficiency certifications in the EU + // European Registry for Energy Labeling (EPREL) database. string name = 1; - // Name of the certification body. + // The authority or certification body responsible for issuing the + // certification. At this time, the most common value is "EC" or + // “European_Commission” for energy labels in the EU. string authority = 2; - // A unique code to identify the certification. + // The code of the certification. For example, for the EPREL certificate with + // the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456 + // the code is 123456. The code is required for European Energy Labels. string code = 3; } From a211bb6ca388ef08b2ea819515d71399b0b51979 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:21:44 -0400 Subject: [PATCH 03/16] feat: [recaptchaenterprise] add AddIpOverride RPC (#5629) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add AddIpOverride RPC feat: add `express_settings` to `Key` docs: clarify `Event.express` field docs: fix billing, quota, and usecase links PiperOrigin-RevId: 665409132 Source-Link: https://github.com/googleapis/googleapis/commit/cc4e33a26333b45f5b9ef15d9286b0aaadb320ea Source-Link: https://github.com/googleapis/googleapis-gen/commit/2be7002e454160c4c43bcaa708fff3bd03ed38cf Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6IjJiZTcwMDJlNDU0MTYwYzRjNDNiY2FhNzA4ZmZmM2JkMDNlZDM4Y2YifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../README.md | 1 + .../v1/recaptchaenterprise.proto | 75 +- .../protos/protos.d.ts | 426 ++++++- .../protos/protos.js | 1100 +++++++++++++++-- .../protos/protos.json | 79 +- .../samples/README.md | 18 + ...tcha_enterprise_service.add_ip_override.js | 67 + ...ecaptcha_enterprise_service.migrate_key.js | 4 +- ...a_google.cloud.recaptchaenterprise.v1.json | 44 + .../src/v1/gapic_metadata.json | 10 + .../v1/recaptcha_enterprise_service_client.ts | 107 +- ...tcha_enterprise_service_client_config.json | 4 + .../gapic_recaptcha_enterprise_service_v1.ts | 142 +++ 13 files changed, 1970 insertions(+), 107 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 3645f34fd34..7afd918f1b2 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -112,6 +112,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Recaptcha_enterprise_service.add_ip_override | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js,packages/google-cloud-recaptchaenterprise/samples/README.md) | | Recaptcha_enterprise_service.annotate_assessment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js,packages/google-cloud-recaptchaenterprise/samples/README.md) | | Recaptcha_enterprise_service.create_assessment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js,packages/google-cloud-recaptchaenterprise/samples/README.md) | | Recaptcha_enterprise_service.create_firewall_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_firewall_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_firewall_policy.js,packages/google-cloud-recaptchaenterprise/samples/README.md) | diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index be727b9e944..11320f5311c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -127,6 +127,18 @@ service RecaptchaEnterpriseService { }; } + // Adds an IP override to a key. The following restrictions hold: + // * The maximum number of IP overrides per key is 100. + // * For any conflict (such as IP already exists or IP part of an existing + // IP range), an error will be returned. + rpc AddIpOverride(AddIpOverrideRequest) returns (AddIpOverrideResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/keys/*}:addIpOverride" + body: "*" + }; + option (google.api.method_signature) = "name,ip_override_data"; + } + // Get some aggregated metrics for a Key. This data can be used to build // dashboards. rpc GetMetrics(GetMetricsRequest) returns (Metrics) { @@ -708,8 +720,7 @@ message Event { [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. Flag for a reCAPTCHA express request for an assessment without a - // token. If enabled, `site_key` must reference a SCORE key with WAF feature - // set to EXPRESS. + // token. If enabled, `site_key` must reference an Express site key. bool express = 14 [(google.api.field_behavior) = OPTIONAL]; // Optional. The URI resource the user requested that triggered an assessment. @@ -1388,11 +1399,11 @@ message MigrateKeyRequest { // Optional. If true, skips the billing check. // A reCAPTCHA Enterprise key or migrated key behaves differently than a // reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - // https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + // https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid // any disruption of your usage, we check that a billing account is present. // If your usage of reCAPTCHA is under the free quota, you can safely skip the // billing check and proceed with the migration. See - // https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + // https://cloud.google.com/recaptcha/docs/billing-information. bool skip_billing_check = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -1475,10 +1486,13 @@ message Key { // Settings for keys that can be used by iOS apps. IOSKeySettings ios_settings = 5; + + // Settings for keys that can be used by reCAPTCHA Express. + ExpressKeySettings express_settings = 11; } // Optional. See [Creating and managing labels] - // (https://cloud.google.com/recaptcha-enterprise/docs/labels). + // (https://cloud.google.com/recaptcha/docs/labels). map labels = 6 [(google.api.field_behavior) = OPTIONAL]; // Output only. The timestamp corresponding to the creation of this key. @@ -1618,6 +1632,9 @@ message IOSKeySettings { [(google.api.field_behavior) = OPTIONAL]; } +// Settings specific to keys that can be used for reCAPTCHA Express. +message ExpressKeySettings {} + // Contains fields that are required to perform Apple-specific integrity checks. message AppleDeveloperId { // Required. Input only. A private key (downloaded as a text file with a .p8 @@ -1919,6 +1936,24 @@ message SearchRelatedAccountGroupMembershipsResponse { string next_page_token = 2; } +// The AddIpOverride request message. +message AddIpOverrideRequest { + // Required. The name of the key to which the IP override is added, in the + // format `projects/{project}/keys/{key}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; + + // Required. IP override added to the key. + IpOverrideData ip_override_data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for AddIpOverride. +message AddIpOverrideResponse {} + // A membership in a group of related accounts. message RelatedAccountGroupMembership { option (google.api.resource) = { @@ -1969,7 +2004,7 @@ message RelatedAccountGroup { // Firewall). message WafSettings { // Supported WAF features. For more information, see - // https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features. + // https://cloud.google.com/recaptcha/docs/usecase#comparison_of_features. enum WafFeature { // Undefined feature. WAF_FEATURE_UNSPECIFIED = 0; @@ -2010,3 +2045,31 @@ message WafSettings { // Required. The WAF feature for which this key is enabled. WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED]; } + +// Information about the IP or IP range override. +message IpOverrideData { + // Enum that represents the type of IP override. + enum OverrideType { + // Default override type that indicates this enum hasn't been specified. + OVERRIDE_TYPE_UNSPECIFIED = 0; + + // Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for + // all valid assessments. + ALLOW = 1; + } + + // Required. The IP address to override (can be IPv4, IPv6 or CIDR). + // The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + // The IP override must be a public IP address. + // Example of IPv4: 168.192.5.6 + // Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + // Example of IPv4 with CIDR: 168.192.5.0/24 + // Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + string ip = 1 [ + (google.api.field_info).format = IPV4_OR_IPV6, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Describes the type of IP override. + OverrideType override_type = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 23f7037090e..c287c5d182c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -172,6 +172,20 @@ export namespace google { */ public migrateKey(request: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest): Promise; + /** + * Calls AddIpOverride. + * @param request AddIpOverrideRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddIpOverrideResponse + */ + public addIpOverride(request: google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AddIpOverrideCallback): void; + + /** + * Calls AddIpOverride. + * @param request AddIpOverrideRequest message or plain object + * @returns Promise + */ + public addIpOverride(request: google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest): Promise; + /** * Calls GetMetrics. * @param request GetMetricsRequest message or plain object @@ -378,6 +392,13 @@ export namespace google { */ type MigrateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|addIpOverride}. + * @param error Error, if any + * @param [response] AddIpOverrideResponse + */ + type AddIpOverrideCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) => void; + /** * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getMetrics}. * @param error Error, if any @@ -5795,6 +5816,9 @@ export namespace google { /** Key iosSettings */ iosSettings?: (google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null); + /** Key expressSettings */ + expressSettings?: (google.cloud.recaptchaenterprise.v1.IExpressKeySettings|null); + /** Key labels */ labels?: ({ [k: string]: string }|null); @@ -5832,6 +5856,9 @@ export namespace google { /** Key iosSettings. */ public iosSettings?: (google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null); + /** Key expressSettings. */ + public expressSettings?: (google.cloud.recaptchaenterprise.v1.IExpressKeySettings|null); + /** Key labels. */ public labels: { [k: string]: string }; @@ -5845,7 +5872,7 @@ export namespace google { public wafSettings?: (google.cloud.recaptchaenterprise.v1.IWafSettings|null); /** Key platformSettings. */ - public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); + public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"|"expressSettings"); /** * Creates a new Key instance using the specified properties. @@ -6396,6 +6423,97 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ExpressKeySettings. */ + interface IExpressKeySettings { + } + + /** Represents an ExpressKeySettings. */ + class ExpressKeySettings implements IExpressKeySettings { + + /** + * Constructs a new ExpressKeySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IExpressKeySettings); + + /** + * Creates a new ExpressKeySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpressKeySettings instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IExpressKeySettings): google.cloud.recaptchaenterprise.v1.ExpressKeySettings; + + /** + * Encodes the specified ExpressKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ExpressKeySettings.verify|verify} messages. + * @param message ExpressKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IExpressKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpressKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ExpressKeySettings.verify|verify} messages. + * @param message ExpressKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IExpressKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpressKeySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpressKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ExpressKeySettings; + + /** + * Decodes an ExpressKeySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpressKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ExpressKeySettings; + + /** + * Verifies an ExpressKeySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpressKeySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpressKeySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ExpressKeySettings; + + /** + * Creates a plain object from an ExpressKeySettings message. Also converts values to other types if specified. + * @param message ExpressKeySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ExpressKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpressKeySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpressKeySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AppleDeveloperId. */ interface IAppleDeveloperId { @@ -8389,6 +8507,200 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AddIpOverrideRequest. */ + interface IAddIpOverrideRequest { + + /** AddIpOverrideRequest name */ + name?: (string|null); + + /** AddIpOverrideRequest ipOverrideData */ + ipOverrideData?: (google.cloud.recaptchaenterprise.v1.IIpOverrideData|null); + } + + /** Represents an AddIpOverrideRequest. */ + class AddIpOverrideRequest implements IAddIpOverrideRequest { + + /** + * Constructs a new AddIpOverrideRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest); + + /** AddIpOverrideRequest name. */ + public name: string; + + /** AddIpOverrideRequest ipOverrideData. */ + public ipOverrideData?: (google.cloud.recaptchaenterprise.v1.IIpOverrideData|null); + + /** + * Creates a new AddIpOverrideRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddIpOverrideRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest): google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest; + + /** + * Encodes the specified AddIpOverrideRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest.verify|verify} messages. + * @param message AddIpOverrideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddIpOverrideRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest.verify|verify} messages. + * @param message AddIpOverrideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddIpOverrideRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddIpOverrideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest; + + /** + * Decodes an AddIpOverrideRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddIpOverrideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest; + + /** + * Verifies an AddIpOverrideRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddIpOverrideRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddIpOverrideRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest; + + /** + * Creates a plain object from an AddIpOverrideRequest message. Also converts values to other types if specified. + * @param message AddIpOverrideRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddIpOverrideRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddIpOverrideRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddIpOverrideResponse. */ + interface IAddIpOverrideResponse { + } + + /** Represents an AddIpOverrideResponse. */ + class AddIpOverrideResponse implements IAddIpOverrideResponse { + + /** + * Constructs a new AddIpOverrideResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse); + + /** + * Creates a new AddIpOverrideResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddIpOverrideResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse): google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse; + + /** + * Encodes the specified AddIpOverrideResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse.verify|verify} messages. + * @param message AddIpOverrideResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddIpOverrideResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse.verify|verify} messages. + * @param message AddIpOverrideResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddIpOverrideResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddIpOverrideResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse; + + /** + * Decodes an AddIpOverrideResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddIpOverrideResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse; + + /** + * Verifies an AddIpOverrideResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddIpOverrideResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddIpOverrideResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse; + + /** + * Creates a plain object from an AddIpOverrideResponse message. Also converts values to other types if specified. + * @param message AddIpOverrideResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddIpOverrideResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddIpOverrideResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RelatedAccountGroupMembership. */ interface IRelatedAccountGroupMembership { @@ -8717,6 +9029,118 @@ export namespace google { CLOUDFLARE = 4 } } + + /** Properties of an IpOverrideData. */ + interface IIpOverrideData { + + /** IpOverrideData ip */ + ip?: (string|null); + + /** IpOverrideData overrideType */ + overrideType?: (google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType|keyof typeof google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType|null); + } + + /** Represents an IpOverrideData. */ + class IpOverrideData implements IIpOverrideData { + + /** + * Constructs a new IpOverrideData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IIpOverrideData); + + /** IpOverrideData ip. */ + public ip: string; + + /** IpOverrideData overrideType. */ + public overrideType: (google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType|keyof typeof google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType); + + /** + * Creates a new IpOverrideData instance using the specified properties. + * @param [properties] Properties to set + * @returns IpOverrideData instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IIpOverrideData): google.cloud.recaptchaenterprise.v1.IpOverrideData; + + /** + * Encodes the specified IpOverrideData message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IpOverrideData.verify|verify} messages. + * @param message IpOverrideData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IIpOverrideData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IpOverrideData message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IpOverrideData.verify|verify} messages. + * @param message IpOverrideData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IIpOverrideData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IpOverrideData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IpOverrideData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.IpOverrideData; + + /** + * Decodes an IpOverrideData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IpOverrideData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.IpOverrideData; + + /** + * Verifies an IpOverrideData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IpOverrideData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IpOverrideData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.IpOverrideData; + + /** + * Creates a plain object from an IpOverrideData message. Also converts values to other types if specified. + * @param message IpOverrideData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.IpOverrideData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IpOverrideData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IpOverrideData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IpOverrideData { + + /** OverrideType enum. */ + enum OverrideType { + OVERRIDE_TYPE_UNSPECIFIED = 0, + ALLOW = 1 + } + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index cf8429691ea..631e1b84814 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -395,6 +395,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|addIpOverride}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef AddIpOverrideCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} [response] AddIpOverrideResponse + */ + + /** + * Calls AddIpOverride. + * @function addIpOverride + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest} request AddIpOverrideRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AddIpOverrideCallback} callback Node-style callback called with the error, if any, and AddIpOverrideResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.addIpOverride = function addIpOverride(request, callback) { + return this.rpcCall(addIpOverride, $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest, $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse, request, callback); + }, "name", { value: "AddIpOverride" }); + + /** + * Calls AddIpOverride. + * @function addIpOverride + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest} request AddIpOverrideRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getMetrics}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService @@ -14064,6 +14097,7 @@ * @property {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null} [webSettings] Key webSettings * @property {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null} [androidSettings] Key androidSettings * @property {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null} [iosSettings] Key iosSettings + * @property {google.cloud.recaptchaenterprise.v1.IExpressKeySettings|null} [expressSettings] Key expressSettings * @property {Object.|null} [labels] Key labels * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime * @property {google.cloud.recaptchaenterprise.v1.ITestingOptions|null} [testingOptions] Key testingOptions @@ -14126,6 +14160,14 @@ */ Key.prototype.iosSettings = null; + /** + * Key expressSettings. + * @member {google.cloud.recaptchaenterprise.v1.IExpressKeySettings|null|undefined} expressSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.expressSettings = null; + /** * Key labels. * @member {Object.} labels @@ -14163,12 +14205,12 @@ /** * Key platformSettings. - * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings + * @member {"webSettings"|"androidSettings"|"iosSettings"|"expressSettings"|undefined} platformSettings * @memberof google.cloud.recaptchaenterprise.v1.Key * @instance */ Object.defineProperty(Key.prototype, "platformSettings", { - get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), + get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings", "expressSettings"]), set: $util.oneOfSetter($oneOfFields) }); @@ -14215,6 +14257,8 @@ $root.google.cloud.recaptchaenterprise.v1.TestingOptions.encode(message.testingOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.wafSettings != null && Object.hasOwnProperty.call(message, "wafSettings")) $root.google.cloud.recaptchaenterprise.v1.WafSettings.encode(message.wafSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.expressSettings != null && Object.hasOwnProperty.call(message, "expressSettings")) + $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings.encode(message.expressSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -14269,6 +14313,10 @@ message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); break; } + case 11: { + message.expressSettings = $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings.decode(reader, reader.uint32()); + break; + } case 6: { if (message.labels === $util.emptyObject) message.labels = {}; @@ -14374,6 +14422,16 @@ return "iosSettings." + error; } } + if (message.expressSettings != null && message.hasOwnProperty("expressSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings.verify(message.expressSettings); + if (error) + return "expressSettings." + error; + } + } if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; @@ -14431,6 +14489,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.iosSettings: object expected"); message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.fromObject(object.iosSettings); } + if (object.expressSettings != null) { + if (typeof object.expressSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.expressSettings: object expected"); + message.expressSettings = $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings.fromObject(object.expressSettings); + } if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.labels: object expected"); @@ -14509,6 +14572,11 @@ object.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.toObject(message.testingOptions, options); if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) object.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.toObject(message.wafSettings, options); + if (message.expressSettings != null && message.hasOwnProperty("expressSettings")) { + object.expressSettings = $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings.toObject(message.expressSettings, options); + if (options.oneofs) + object.platformSettings = "expressSettings"; + } return object; }; @@ -15754,6 +15822,181 @@ return IOSKeySettings; })(); + v1.ExpressKeySettings = (function() { + + /** + * Properties of an ExpressKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IExpressKeySettings + */ + + /** + * Constructs a new ExpressKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an ExpressKeySettings. + * @implements IExpressKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IExpressKeySettings=} [properties] Properties to set + */ + function ExpressKeySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExpressKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IExpressKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ExpressKeySettings} ExpressKeySettings instance + */ + ExpressKeySettings.create = function create(properties) { + return new ExpressKeySettings(properties); + }; + + /** + * Encodes the specified ExpressKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ExpressKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IExpressKeySettings} message ExpressKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExpressKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ExpressKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IExpressKeySettings} message ExpressKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpressKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ExpressKeySettings} ExpressKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpressKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ExpressKeySettings} ExpressKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpressKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpressKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ExpressKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ExpressKeySettings} ExpressKeySettings + */ + ExpressKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings) + return object; + return new $root.google.cloud.recaptchaenterprise.v1.ExpressKeySettings(); + }; + + /** + * Creates a plain object from an ExpressKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.ExpressKeySettings} message ExpressKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpressKeySettings.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExpressKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @instance + * @returns {Object.} JSON object + */ + ExpressKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpressKeySettings + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ExpressKeySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpressKeySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ExpressKeySettings"; + }; + + return ExpressKeySettings; + })(); + v1.AppleDeveloperId = (function() { /** @@ -20494,26 +20737,25 @@ return SearchRelatedAccountGroupMembershipsResponse; })(); - v1.RelatedAccountGroupMembership = (function() { + v1.AddIpOverrideRequest = (function() { /** - * Properties of a RelatedAccountGroupMembership. + * Properties of an AddIpOverrideRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IRelatedAccountGroupMembership - * @property {string|null} [name] RelatedAccountGroupMembership name - * @property {string|null} [accountId] RelatedAccountGroupMembership accountId - * @property {Uint8Array|null} [hashedAccountId] RelatedAccountGroupMembership hashedAccountId + * @interface IAddIpOverrideRequest + * @property {string|null} [name] AddIpOverrideRequest name + * @property {google.cloud.recaptchaenterprise.v1.IIpOverrideData|null} [ipOverrideData] AddIpOverrideRequest ipOverrideData */ /** - * Constructs a new RelatedAccountGroupMembership. + * Constructs a new AddIpOverrideRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a RelatedAccountGroupMembership. - * @implements IRelatedAccountGroupMembership + * @classdesc Represents an AddIpOverrideRequest. + * @implements IAddIpOverrideRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest=} [properties] Properties to set */ - function RelatedAccountGroupMembership(properties) { + function AddIpOverrideRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20521,90 +20763,80 @@ } /** - * RelatedAccountGroupMembership name. + * AddIpOverrideRequest name. * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership - * @instance - */ - RelatedAccountGroupMembership.prototype.name = ""; - - /** - * RelatedAccountGroupMembership accountId. - * @member {string} accountId - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @instance */ - RelatedAccountGroupMembership.prototype.accountId = ""; + AddIpOverrideRequest.prototype.name = ""; /** - * RelatedAccountGroupMembership hashedAccountId. - * @member {Uint8Array} hashedAccountId - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * AddIpOverrideRequest ipOverrideData. + * @member {google.cloud.recaptchaenterprise.v1.IIpOverrideData|null|undefined} ipOverrideData + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @instance */ - RelatedAccountGroupMembership.prototype.hashedAccountId = $util.newBuffer([]); + AddIpOverrideRequest.prototype.ipOverrideData = null; /** - * Creates a new RelatedAccountGroupMembership instance using the specified properties. + * Creates a new AddIpOverrideRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership instance + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} AddIpOverrideRequest instance */ - RelatedAccountGroupMembership.create = function create(properties) { - return new RelatedAccountGroupMembership(properties); + AddIpOverrideRequest.create = function create(properties) { + return new AddIpOverrideRequest(properties); }; /** - * Encodes the specified RelatedAccountGroupMembership message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * Encodes the specified AddIpOverrideRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership} message RelatedAccountGroupMembership message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest} message AddIpOverrideRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RelatedAccountGroupMembership.encode = function encode(message, writer) { + AddIpOverrideRequest.encode = function encode(message, writer) { 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.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hashedAccountId); - if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.accountId); + if (message.ipOverrideData != null && Object.hasOwnProperty.call(message, "ipOverrideData")) + $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.encode(message.ipOverrideData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RelatedAccountGroupMembership message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * Encodes the specified AddIpOverrideRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership} message RelatedAccountGroupMembership message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest} message AddIpOverrideRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RelatedAccountGroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + AddIpOverrideRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer. + * Decodes an AddIpOverrideRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} AddIpOverrideRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RelatedAccountGroupMembership.decode = function decode(reader, length) { + AddIpOverrideRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -20612,12 +20844,8 @@ message.name = reader.string(); break; } - case 4: { - message.accountId = reader.string(); - break; - } case 2: { - message.hashedAccountId = reader.bytes(); + message.ipOverrideData = $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.decode(reader, reader.uint32()); break; } default: @@ -20629,95 +20857,517 @@ }; /** - * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer, length delimited. + * Decodes an AddIpOverrideRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} AddIpOverrideRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RelatedAccountGroupMembership.decodeDelimited = function decodeDelimited(reader) { + AddIpOverrideRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RelatedAccountGroupMembership message. + * Verifies an AddIpOverrideRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RelatedAccountGroupMembership.verify = function verify(message) { + AddIpOverrideRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.accountId != null && message.hasOwnProperty("accountId")) - if (!$util.isString(message.accountId)) - return "accountId: string expected"; - if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) - if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) - return "hashedAccountId: buffer expected"; + if (message.ipOverrideData != null && message.hasOwnProperty("ipOverrideData")) { + var error = $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.verify(message.ipOverrideData); + if (error) + return "ipOverrideData." + error; + } return null; }; /** - * Creates a RelatedAccountGroupMembership message from a plain object. Also converts values to their respective internal types. + * Creates an AddIpOverrideRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} AddIpOverrideRequest */ - RelatedAccountGroupMembership.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership) + AddIpOverrideRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership(); + var message = new $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest(); if (object.name != null) message.name = String(object.name); - if (object.accountId != null) - message.accountId = String(object.accountId); - if (object.hashedAccountId != null) - if (typeof object.hashedAccountId === "string") - $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length >= 0) - message.hashedAccountId = object.hashedAccountId; + if (object.ipOverrideData != null) { + if (typeof object.ipOverrideData !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest.ipOverrideData: object expected"); + message.ipOverrideData = $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.fromObject(object.ipOverrideData); + } return message; }; /** - * Creates a plain object from a RelatedAccountGroupMembership message. Also converts values to other types if specified. + * Creates a plain object from an AddIpOverrideRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} message RelatedAccountGroupMembership + * @param {google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} message AddIpOverrideRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RelatedAccountGroupMembership.toObject = function toObject(message, options) { + AddIpOverrideRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - if (options.bytes === String) - object.hashedAccountId = ""; - else { - object.hashedAccountId = []; - if (options.bytes !== Array) - object.hashedAccountId = $util.newBuffer(object.hashedAccountId); - } - object.accountId = ""; + object.ipOverrideData = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (message.ipOverrideData != null && message.hasOwnProperty("ipOverrideData")) + object.ipOverrideData = $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.toObject(message.ipOverrideData, options); + return object; + }; + + /** + * Converts this AddIpOverrideRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest + * @instance + * @returns {Object.} JSON object + */ + AddIpOverrideRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddIpOverrideRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddIpOverrideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest"; + }; + + return AddIpOverrideRequest; + })(); + + v1.AddIpOverrideResponse = (function() { + + /** + * Properties of an AddIpOverrideResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAddIpOverrideResponse + */ + + /** + * Constructs a new AddIpOverrideResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AddIpOverrideResponse. + * @implements IAddIpOverrideResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse=} [properties] Properties to set + */ + function AddIpOverrideResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AddIpOverrideResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} AddIpOverrideResponse instance + */ + AddIpOverrideResponse.create = function create(properties) { + return new AddIpOverrideResponse(properties); + }; + + /** + * Encodes the specified AddIpOverrideResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse} message AddIpOverrideResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddIpOverrideResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddIpOverrideResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse} message AddIpOverrideResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddIpOverrideResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddIpOverrideResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} AddIpOverrideResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddIpOverrideResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddIpOverrideResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} AddIpOverrideResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddIpOverrideResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddIpOverrideResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddIpOverrideResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AddIpOverrideResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} AddIpOverrideResponse + */ + AddIpOverrideResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) + return object; + return new $root.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse(); + }; + + /** + * Creates a plain object from an AddIpOverrideResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} message AddIpOverrideResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddIpOverrideResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddIpOverrideResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @instance + * @returns {Object.} JSON object + */ + AddIpOverrideResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddIpOverrideResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddIpOverrideResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse"; + }; + + return AddIpOverrideResponse; + })(); + + v1.RelatedAccountGroupMembership = (function() { + + /** + * Properties of a RelatedAccountGroupMembership. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IRelatedAccountGroupMembership + * @property {string|null} [name] RelatedAccountGroupMembership name + * @property {string|null} [accountId] RelatedAccountGroupMembership accountId + * @property {Uint8Array|null} [hashedAccountId] RelatedAccountGroupMembership hashedAccountId + */ + + /** + * Constructs a new RelatedAccountGroupMembership. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a RelatedAccountGroupMembership. + * @implements IRelatedAccountGroupMembership + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership=} [properties] Properties to set + */ + function RelatedAccountGroupMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAccountGroupMembership name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @instance + */ + RelatedAccountGroupMembership.prototype.name = ""; + + /** + * RelatedAccountGroupMembership accountId. + * @member {string} accountId + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @instance + */ + RelatedAccountGroupMembership.prototype.accountId = ""; + + /** + * RelatedAccountGroupMembership hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @instance + */ + RelatedAccountGroupMembership.prototype.hashedAccountId = $util.newBuffer([]); + + /** + * Creates a new RelatedAccountGroupMembership instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership instance + */ + RelatedAccountGroupMembership.create = function create(properties) { + return new RelatedAccountGroupMembership(properties); + }; + + /** + * Encodes the specified RelatedAccountGroupMembership message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership} message RelatedAccountGroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAccountGroupMembership.encode = function encode(message, writer) { + 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.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hashedAccountId); + if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.accountId); + return writer; + }; + + /** + * Encodes the specified RelatedAccountGroupMembership message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership} message RelatedAccountGroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAccountGroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAccountGroupMembership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.accountId = reader.string(); + break; + } + case 2: { + message.hashedAccountId = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAccountGroupMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAccountGroupMembership message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAccountGroupMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.accountId != null && message.hasOwnProperty("accountId")) + if (!$util.isString(message.accountId)) + return "accountId: string expected"; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; + return null; + }; + + /** + * Creates a RelatedAccountGroupMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + */ + RelatedAccountGroupMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership(); + if (object.name != null) + message.name = String(object.name); + if (object.accountId != null) + message.accountId = String(object.accountId); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length >= 0) + message.hashedAccountId = object.hashedAccountId; + return message; + }; + + /** + * Creates a plain object from a RelatedAccountGroupMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} message RelatedAccountGroupMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAccountGroupMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } + object.accountId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; if (message.accountId != null && message.hasOwnProperty("accountId")) object.accountId = message.accountId; @@ -21284,6 +21934,266 @@ return WafSettings; })(); + v1.IpOverrideData = (function() { + + /** + * Properties of an IpOverrideData. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IIpOverrideData + * @property {string|null} [ip] IpOverrideData ip + * @property {google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType|null} [overrideType] IpOverrideData overrideType + */ + + /** + * Constructs a new IpOverrideData. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an IpOverrideData. + * @implements IIpOverrideData + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IIpOverrideData=} [properties] Properties to set + */ + function IpOverrideData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IpOverrideData ip. + * @member {string} ip + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @instance + */ + IpOverrideData.prototype.ip = ""; + + /** + * IpOverrideData overrideType. + * @member {google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType} overrideType + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @instance + */ + IpOverrideData.prototype.overrideType = 0; + + /** + * Creates a new IpOverrideData instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIpOverrideData=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.IpOverrideData} IpOverrideData instance + */ + IpOverrideData.create = function create(properties) { + return new IpOverrideData(properties); + }; + + /** + * Encodes the specified IpOverrideData message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IpOverrideData.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIpOverrideData} message IpOverrideData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpOverrideData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ip); + if (message.overrideType != null && Object.hasOwnProperty.call(message, "overrideType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.overrideType); + return writer; + }; + + /** + * Encodes the specified IpOverrideData message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IpOverrideData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIpOverrideData} message IpOverrideData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpOverrideData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IpOverrideData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.IpOverrideData} IpOverrideData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpOverrideData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.IpOverrideData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ip = reader.string(); + break; + } + case 3: { + message.overrideType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IpOverrideData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.IpOverrideData} IpOverrideData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpOverrideData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IpOverrideData message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IpOverrideData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.overrideType != null && message.hasOwnProperty("overrideType")) + switch (message.overrideType) { + default: + return "overrideType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an IpOverrideData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.IpOverrideData} IpOverrideData + */ + IpOverrideData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.IpOverrideData) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.IpOverrideData(); + if (object.ip != null) + message.ip = String(object.ip); + switch (object.overrideType) { + default: + if (typeof object.overrideType === "number") { + message.overrideType = object.overrideType; + break; + } + break; + case "OVERRIDE_TYPE_UNSPECIFIED": + case 0: + message.overrideType = 0; + break; + case "ALLOW": + case 1: + message.overrideType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an IpOverrideData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {google.cloud.recaptchaenterprise.v1.IpOverrideData} message IpOverrideData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IpOverrideData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ip = ""; + object.overrideType = options.enums === String ? "OVERRIDE_TYPE_UNSPECIFIED" : 0; + } + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.overrideType != null && message.hasOwnProperty("overrideType")) + object.overrideType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType[message.overrideType] === undefined ? message.overrideType : $root.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType[message.overrideType] : message.overrideType; + return object; + }; + + /** + * Converts this IpOverrideData to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @instance + * @returns {Object.} JSON object + */ + IpOverrideData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IpOverrideData + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.IpOverrideData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IpOverrideData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.IpOverrideData"; + }; + + /** + * OverrideType enum. + * @name google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType + * @enum {number} + * @property {number} OVERRIDE_TYPE_UNSPECIFIED=0 OVERRIDE_TYPE_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + */ + IpOverrideData.OverrideType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OVERRIDE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + return values; + })(); + + return IpOverrideData; + })(); + return v1; })(); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 431d82bd6d6..2a3441b7aba 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -192,6 +192,26 @@ } ] }, + "AddIpOverride": { + "requestType": "AddIpOverrideRequest", + "responseType": "AddIpOverrideResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/keys/*}:addIpOverride", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,ip_override_data" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/keys/*}:addIpOverride", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,ip_override_data" + } + ] + }, "GetMetrics": { "requestType": "GetMetricsRequest", "responseType": "Metrics", @@ -1807,7 +1827,8 @@ "oneof": [ "webSettings", "androidSettings", - "iosSettings" + "iosSettings", + "expressSettings" ] } }, @@ -1838,6 +1859,10 @@ "type": "IOSKeySettings", "id": 5 }, + "expressSettings": { + "type": "ExpressKeySettings", + "id": 11 + }, "labels": { "keyType": "string", "type": "string", @@ -2006,6 +2031,9 @@ } } }, + "ExpressKeySettings": { + "fields": {} + }, "AppleDeveloperId": { "fields": { "privateKey": { @@ -2352,6 +2380,28 @@ } } }, + "AddIpOverrideRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + }, + "ipOverrideData": { + "type": "IpOverrideData", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddIpOverrideResponse": { + "fields": {} + }, "RelatedAccountGroupMembership": { "options": { "(google.api.resource).type": "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership", @@ -2433,6 +2483,33 @@ } } } + }, + "IpOverrideData": { + "fields": { + "ip": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4_OR_IPV6", + "(google.api.field_behavior)": "REQUIRED" + } + }, + "overrideType": { + "type": "OverrideType", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OverrideType": { + "values": { + "OVERRIDE_TYPE_UNSPECIFIED": 0, + "ALLOW": 1 + } + } + } } } }, diff --git a/packages/google-cloud-recaptchaenterprise/samples/README.md b/packages/google-cloud-recaptchaenterprise/samples/README.md index f7f02343376..736d714e3c8 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/README.md +++ b/packages/google-cloud-recaptchaenterprise/samples/README.md @@ -12,6 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Recaptcha_enterprise_service.add_ip_override](#recaptcha_enterprise_service.add_ip_override) * [Recaptcha_enterprise_service.annotate_assessment](#recaptcha_enterprise_service.annotate_assessment) * [Recaptcha_enterprise_service.create_assessment](#recaptcha_enterprise_service.create_assessment) * [Recaptcha_enterprise_service.create_firewall_policy](#recaptcha_enterprise_service.create_firewall_policy) @@ -55,6 +56,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Recaptcha_enterprise_service.add_ip_override + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js` + + +----- + + + + ### Recaptcha_enterprise_service.annotate_assessment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js). diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js new file mode 100644 index 00000000000..91331a11282 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js @@ -0,0 +1,67 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, ipOverrideData) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + */ + // const name = 'abc123' + /** + * Required. IP override added to the key. + */ + // const ipOverrideData = {} + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function callAddIpOverride() { + // Construct request + const request = { + name, + ipOverrideData, + }; + + // Run request + const response = await recaptchaenterpriseClient.addIpOverride(request); + console.log(response); + } + + callAddIpOverride(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js index 26d3397cc8b..49e14ca0724 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js @@ -37,11 +37,11 @@ function main(name) { * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. */ // const skipBillingCheck = true diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json index 3fbca466727..9a00e4bbd2c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json @@ -415,6 +415,50 @@ } } }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async", + "title": "RecaptchaEnterpriseService addIpOverride Sample", + "origin": "API_DEFINITION", + "description": " Adds an IP override to a key. The following restrictions hold: * The maximum number of IP overrides per key is 100. * For any conflict (such as IP already exists or IP part of an existing IP range), an error will be returned.", + "canonical": true, + "file": "recaptcha_enterprise_service.add_ip_override.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddIpOverride", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AddIpOverride", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "ip_override_data", + "type": ".google.cloud.recaptchaenterprise.v1.IpOverrideData" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "AddIpOverride", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AddIpOverride", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, { "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async", "title": "RecaptchaEnterpriseService getMetrics Sample", diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json index dd2984fa96a..f6a2fb61815 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json @@ -50,6 +50,11 @@ "migrateKey" ] }, + "AddIpOverride": { + "methods": [ + "addIpOverride" + ] + }, "GetMetrics": { "methods": [ "getMetrics" @@ -160,6 +165,11 @@ "migrateKey" ] }, + "AddIpOverride": { + "methods": [ + "addIpOverride" + ] + }, "GetMetrics": { "methods": [ "getMetrics" diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index af2ecd75edc..147a307fb68 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -315,6 +315,7 @@ export class RecaptchaEnterpriseServiceClient { 'updateKey', 'deleteKey', 'migrateKey', + 'addIpOverride', 'getMetrics', 'createFirewallPolicy', 'listFirewallPolicies', @@ -1142,11 +1143,11 @@ export class RecaptchaEnterpriseServiceClient { * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1230,6 +1231,108 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.migrateKey(request, options, callback); } + /** + * Adds an IP override to a key. The following restrictions hold: + * * The maximum number of IP overrides per key is 100. + * * For any conflict (such as IP already exists or IP part of an existing + * IP range), an error will be returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to which the IP override is added, in the + * format `projects/{project}/keys/{key}`. + * @param {google.cloud.recaptchaenterprise.v1.IpOverrideData} request.ipOverrideData + * Required. IP override added to the key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse|AddIpOverrideResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async + */ + addIpOverride( + request?: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest + | undefined + ), + {} | undefined, + ] + >; + addIpOverride( + request: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addIpOverride( + request: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addIpOverride( + request?: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.addIpOverride(request, options, callback); + } /** * Get some aggregated metrics for a Key. This data can be used to build * dashboards. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json index 699e7c2e493..8cdf0517348 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json @@ -63,6 +63,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "AddIpOverride": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetMetrics": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 75580b96d39..155de8a6af4 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -1472,6 +1472,148 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); }); + describe('addIpOverride', () => { + it('invokes addIpOverride without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse() + ); + client.innerApiCalls.addIpOverride = stubSimpleCall(expectedResponse); + const [response] = await client.addIpOverride(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addIpOverride as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addIpOverride as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addIpOverride without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse() + ); + client.innerApiCalls.addIpOverride = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addIpOverride( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addIpOverride as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addIpOverride as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addIpOverride with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addIpOverride = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addIpOverride(request), expectedError); + const actualRequest = ( + client.innerApiCalls.addIpOverride as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addIpOverride as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addIpOverride with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addIpOverride(request), expectedError); + }); + }); + describe('getMetrics', () => { it('invokes getMetrics without error', async () => { const client = From 4a2ff18950898ae8661b1e8290f9c3d7469acd91 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:22:14 -0400 Subject: [PATCH 04/16] docs: [batch] clarify tasks success criteria for background runnable (#5628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: clarify tasks success criteria for background runnable PiperOrigin-RevId: 665192495 Source-Link: https://github.com/googleapis/googleapis/commit/d7f3478b9cf0b14e3658dfcb48e7f1e61a17d625 Source-Link: https://github.com/googleapis/googleapis-gen/commit/66d372d7c788bc91b22166eda632e210acf9866d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI2NmQzNzJkN2M3ODhiYzkxYjIyMTY2ZWRhNjMyZTIxMGFjZjk4NjZkIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: clarify tasks success criteria for background runnable PiperOrigin-RevId: 665192663 Source-Link: https://github.com/googleapis/googleapis/commit/07ede94493ac8cb9a38f2d248bedc557bca95dd8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d88a093b400e1ba1b7c2d666cef2de94152bb212 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJkODhhMDkzYjQwMGUxYmExYjdjMmQ2NjZjZWYyZGU5NDE1MmJiMjEyIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../protos/google/cloud/batch/v1/task.proto | 35 ++++++++++++------- .../google/cloud/batch/v1alpha/task.proto | 35 ++++++++++++------- 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto index 5aba9c8a509..f9edabb2b6a 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto @@ -304,13 +304,24 @@ message Runnable { // provided the index of the runnable will be used for outputs. string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - // Normally, a non-zero exit status causes the Task to fail. This flag allows - // execution of other Runnables to continue instead. + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. bool ignore_exit_status = 3; - // This flag allows a Runnable to continue running in the background while the - // Task executes subsequent Runnables. This is useful to provide services to - // other Runnables (or to provide debugging support tools like SSH servers). + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. bool background = 4; // By default, after a Runnable fails, no further Runnable are executed. This @@ -339,15 +350,13 @@ message TaskSpec { // Required. The sequence of one or more runnables (executable scripts, // executable containers, and/or barriers) for each task in this task group to // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must either exit with a zero - // status or enable the `ignore_exit_status` subfield and exit with any - // status. + // all of its script and container runnables each must meet at least one of + // the following conditions: // - // Background runnables are killed automatically (if they have not already - // exited) a short time after all foreground runnables have completed. Even - // though this is likely to result in a non-zero exit status for the - // background runnable, these automatic kills are not treated as Task - // failures. + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. repeated Runnable runnables = 8; // ComputeResource requirements. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto index 073e77e7142..08a20f499dd 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto @@ -323,13 +323,24 @@ message Runnable { // provided the index of the runnable will be used for outputs. string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - // Normally, a non-zero exit status causes the Task to fail. This flag allows - // execution of other Runnables to continue instead. + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. bool ignore_exit_status = 3; - // This flag allows a Runnable to continue running in the background while the - // Task executes subsequent Runnables. This is useful to provide services to - // other Runnables (or to provide debugging support tools like SSH servers). + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. bool background = 4; // By default, after a Runnable fails, no further Runnable are executed. This @@ -358,15 +369,13 @@ message TaskSpec { // Required. The sequence of one or more runnables (executable scripts, // executable containers, and/or barriers) for each task in this task group to // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must either exit with a zero - // status or enable the `ignore_exit_status` subfield and exit with any - // status. + // all of its script and container runnables each must meet at least one of + // the following conditions: // - // Background runnables are killed automatically (if they have not already - // exited) a short time after all foreground runnables have completed. Even - // though this is likely to result in a non-zero exit status for the - // background runnable, these automatic kills are not treated as Task - // failures. + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. repeated Runnable runnables = 8; // ComputeResource requirements. From 4808b4f62f2d5c7fff251b5394d38784a987d2a7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:26:05 -0400 Subject: [PATCH 05/16] docs: [bigquery-datatransfer] deprecate `authorization_code` (#5627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: deprecate `authorization_code` PiperOrigin-RevId: 664993498 Source-Link: https://github.com/googleapis/googleapis/commit/b678386866ca6ee40c84c9043beb70992309343e Source-Link: https://github.com/googleapis/googleapis-gen/commit/148188cb9e24793ca3f52eac441a74b8f543bb7a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWRhdGF0cmFuc2Zlci8uT3dsQm90LnlhbWwiLCJoIjoiMTQ4MTg4Y2I5ZTI0NzkzY2EzZjUyZWFjNDQxYTc0YjhmNTQzYmI3YSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../datatransfer/v1/datatransfer.proto | 30 ++++++++++++------- .../protos/protos.json | 10 +++++-- ...transfer_service.create_transfer_config.js | 23 +++----------- ...transfer_service.update_transfer_config.js | 23 +++----------- ...google.cloud.bigquery.datatransfer.v1.json | 4 +-- .../src/v1/data_transfer_service_client.ts | 26 +++++++++++----- 6 files changed, 56 insertions(+), 60 deletions(-) diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto index 217f7a7110c..4df7f8afc1d 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto @@ -512,6 +512,10 @@ message CreateTransferConfigRequest { // Required. Data transfer configuration to create. TransferConfig transfer_config = 2 [(google.api.field_behavior) = REQUIRED]; + // Deprecated: Authorization code was required when + // `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + // in any data sources. Use `version_info` instead. + // // Optional OAuth2 authorization code to use with this transfer configuration. // This is required only if `transferConfig.dataSourceId` is 'youtube_channel' // and new credentials are needed, as indicated by `CheckValidCreds`. In order @@ -519,23 +523,24 @@ message CreateTransferConfigRequest { //
   // https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
   // 
- // * The client_id is the OAuth client_id of the a data source as + // * The client_id is the OAuth client_id of the data source as // returned by ListDataSources method. // * data_source_scopes are the scopes returned by ListDataSources // method. // // Note that this should not be set when `service_account_name` is used to // create the transfer config. - string authorization_code = 3; + string authorization_code = 3 [deprecated = true]; - // Optional version info. This is required only if - // `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + // Optional version info. This parameter replaces `authorization_code` which + // is no longer used in any data sources. This is required only if + // `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials // are needed, as indicated by `CheckValidCreds`. In order to obtain version // info, make a request to the following URL: //
   // https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
   // 
- // * The client_id is the OAuth client_id of the a data source as + // * The client_id is the OAuth client_id of the data source as // returned by ListDataSources method. // * data_source_scopes are the scopes returned by ListDataSources // method. @@ -562,6 +567,10 @@ message UpdateTransferConfigRequest { // Required. Data transfer configuration to create. TransferConfig transfer_config = 1 [(google.api.field_behavior) = REQUIRED]; + // Deprecated: Authorization code was required when + // `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + // in any data sources. Use `version_info` instead. + // // Optional OAuth2 authorization code to use with this transfer configuration. // This is required only if `transferConfig.dataSourceId` is 'youtube_channel' // and new credentials are needed, as indicated by `CheckValidCreds`. In order @@ -569,27 +578,28 @@ message UpdateTransferConfigRequest { //
   // https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
   // 
- // * The client_id is the OAuth client_id of the a data source as + // * The client_id is the OAuth client_id of the data source as // returned by ListDataSources method. // * data_source_scopes are the scopes returned by ListDataSources // method. // // Note that this should not be set when `service_account_name` is used to // update the transfer config. - string authorization_code = 3; + string authorization_code = 3 [deprecated = true]; // Required. Required list of fields to be updated in this request. google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; - // Optional version info. This is required only if - // `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + // Optional version info. This parameter replaces `authorization_code` which + // is no longer used in any data sources. This is required only if + // `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials // are needed, as indicated by `CheckValidCreds`. In order to obtain version // info, make a request to the following URL: //
   // https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
   // 
- // * The client_id is the OAuth client_id of the a data source as + // * The client_id is the OAuth client_id of the data source as // returned by ListDataSources method. // * data_source_scopes are the scopes returned by ListDataSources // method. diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.json b/packages/google-cloud-bigquery-datatransfer/protos/protos.json index a2979f71dfd..6dd8cd51e08 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.json +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.json @@ -653,7 +653,10 @@ }, "authorizationCode": { "type": "string", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } }, "versionInfo": { "type": "string", @@ -676,7 +679,10 @@ }, "authorizationCode": { "type": "string", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } }, "updateMask": { "type": "google.protobuf.FieldMask", diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js index bbaaf5f9cd0..795e0631d24 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js @@ -41,30 +41,15 @@ function main(parent, transferConfig) { */ // const transferConfig = {} /** - * Optional OAuth2 authorization code to use with this transfer configuration. - * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' - * and new credentials are needed, as indicated by `CheckValidCreds`. In order - * to obtain authorization_code, make a request to the following URL: - *
-   *  https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
-   *  
- * * The client_id is the OAuth client_id of the a data source as - * returned by ListDataSources method. - * * data_source_scopes are the scopes returned by ListDataSources - * method. - * Note that this should not be set when `service_account_name` is used to - * create the transfer config. - */ - // const authorizationCode = 'abc123' - /** - * Optional version info. This is required only if - * `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
    *  https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
    *  
- * * The client_id is the OAuth client_id of the a data source as + * * The client_id is the OAuth client_id of the data source as * returned by ListDataSources method. * * data_source_scopes are the scopes returned by ListDataSources * method. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js index c1311d30186..8ffcc151e1a 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js @@ -32,35 +32,20 @@ function main(transferConfig, updateMask) { * Required. Data transfer configuration to create. */ // const transferConfig = {} - /** - * Optional OAuth2 authorization code to use with this transfer configuration. - * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' - * and new credentials are needed, as indicated by `CheckValidCreds`. In order - * to obtain authorization_code, make a request to the following URL: - *
-   *  https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
-   *  
- * * The client_id is the OAuth client_id of the a data source as - * returned by ListDataSources method. - * * data_source_scopes are the scopes returned by ListDataSources - * method. - * Note that this should not be set when `service_account_name` is used to - * update the transfer config. - */ - // const authorizationCode = 'abc123' /** * Required. Required list of fields to be updated in this request. */ // const updateMask = {} /** - * Optional version info. This is required only if - * `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
    *  https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
    *  
- * * The client_id is the OAuth client_id of the a data source as + * * The client_id is the OAuth client_id of the data source as * returned by ListDataSources method. * * data_source_scopes are the scopes returned by ListDataSources * method. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json index 82a8cab4df7..6c3b1801e9e 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json @@ -110,7 +110,7 @@ "segments": [ { "start": 25, - "end": 105, + "end": 90, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 101, + "end": 86, "type": "FULL" } ], diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts index 6e8d7328ba5..98f59894cc8 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts @@ -550,6 +550,10 @@ export class DataTransferServiceClient { * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} request.transferConfig * Required. Data transfer configuration to create. * @param {string} request.authorizationCode + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * * Optional OAuth2 authorization code to use with this transfer configuration. * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' * and new credentials are needed, as indicated by `CheckValidCreds`. In order @@ -557,7 +561,7 @@ export class DataTransferServiceClient { *
    *   https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
    *   
- * * The client_id is the OAuth client_id of the a data source as + * * The client_id is the OAuth client_id of the data source as * returned by ListDataSources method. * * data_source_scopes are the scopes returned by ListDataSources * method. @@ -565,14 +569,15 @@ export class DataTransferServiceClient { * Note that this should not be set when `service_account_name` is used to * create the transfer config. * @param {string} request.versionInfo - * Optional version info. This is required only if - * `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
    *   https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
    *   
- * * The client_id is the OAuth client_id of the a data source as + * * The client_id is the OAuth client_id of the data source as * returned by ListDataSources method. * * data_source_scopes are the scopes returned by ListDataSources * method. @@ -687,6 +692,10 @@ export class DataTransferServiceClient { * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} request.transferConfig * Required. Data transfer configuration to create. * @param {string} request.authorizationCode + * Deprecated: Authorization code was required when + * `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used + * in any data sources. Use `version_info` instead. + * * Optional OAuth2 authorization code to use with this transfer configuration. * This is required only if `transferConfig.dataSourceId` is 'youtube_channel' * and new credentials are needed, as indicated by `CheckValidCreds`. In order @@ -694,7 +703,7 @@ export class DataTransferServiceClient { *
    *   https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
    *   
- * * The client_id is the OAuth client_id of the a data source as + * * The client_id is the OAuth client_id of the data source as * returned by ListDataSources method. * * data_source_scopes are the scopes returned by ListDataSources * method. @@ -704,14 +713,15 @@ export class DataTransferServiceClient { * @param {google.protobuf.FieldMask} request.updateMask * Required. Required list of fields to be updated in this request. * @param {string} request.versionInfo - * Optional version info. This is required only if - * `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + * Optional version info. This parameter replaces `authorization_code` which + * is no longer used in any data sources. This is required only if + * `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials * are needed, as indicated by `CheckValidCreds`. In order to obtain version * info, make a request to the following URL: *
    *   https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
    *   
- * * The client_id is the OAuth client_id of the a data source as + * * The client_id is the OAuth client_id of the data source as * returned by ListDataSources method. * * data_source_scopes are the scopes returned by ListDataSources * method. From 12ee7d468fbca13c454dfd0f229dbe1b05db9be7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:17:36 -0700 Subject: [PATCH 06/16] docs: [texttospeech] update Long Audio capabilities to include SSML (#5626) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update Long Audio capabilities to include SSML PiperOrigin-RevId: 664823949 Source-Link: https://github.com/googleapis/googleapis/commit/d9eae9f029427bd9ed4379d8e3cd46ca69f1a33f Source-Link: https://github.com/googleapis/googleapis-gen/commit/68d27baaaca51c63ad17dd5b851679b649899634 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiNjhkMjdiYWFhY2E1MWM2M2FkMTdkZDViODUxNjc5YjY0OTg5OTYzNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: update Long Audio capabilities to include SSML PiperOrigin-RevId: 666797967 Source-Link: https://github.com/googleapis/googleapis/commit/818d9fd16dfa254048240ea045b94b6757b20091 Source-Link: https://github.com/googleapis/googleapis-gen/commit/983f7c82cf98b8a6a39bbb254717b0b5c484e15b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiOTgzZjdjODJjZjk4YjhhNmEzOWJiYjI1NDcxN2IwYjVjNDg0ZTE1YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto | 1 - .../google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto | 1 - .../v1/snippet_metadata_google.cloud.texttospeech.v1.json | 2 +- ...ext_to_speech_long_audio_synthesize.synthesize_long_audio.js | 1 - .../snippet_metadata_google.cloud.texttospeech.v1beta1.json | 2 +- ...ext_to_speech_long_audio_synthesize.synthesize_long_audio.js | 1 - .../src/v1/text_to_speech_long_audio_synthesize_client.ts | 1 - .../src/v1beta1/text_to_speech_long_audio_synthesize_client.ts | 1 - 8 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto index c8e6a7c54c7..8eb8605c24c 100644 --- a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto +++ b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto @@ -60,7 +60,6 @@ message SynthesizeLongAudioRequest { string parent = 1; // Required. The Synthesizer requires either plain text or SSML as input. - // While Long Audio is in preview, SSML is temporarily unsupported. SynthesisInput input = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The configuration of the synthesized audio. diff --git a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto index d6fa1b3df3d..969dfd99396 100644 --- a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto +++ b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto @@ -60,7 +60,6 @@ message SynthesizeLongAudioRequest { string parent = 1; // Required. The Synthesizer requires either plain text or SSML as input. - // While Long Audio is in preview, SSML is temporarily unsupported. SynthesisInput input = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The configuration of the synthesized audio. diff --git a/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata_google.cloud.texttospeech.v1.json b/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata_google.cloud.texttospeech.v1.json index 3247cba72f3..5a7df5d2d16 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata_google.cloud.texttospeech.v1.json +++ b/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata_google.cloud.texttospeech.v1.json @@ -154,7 +154,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 76, "type": "FULL" } ], diff --git a/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js b/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js index 7781ef7d98e..2564a9be100 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js +++ b/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js @@ -35,7 +35,6 @@ function main(input, audioConfig, outputGcsUri, voice) { // const parent = 'abc123' /** * Required. The Synthesizer requires either plain text or SSML as input. - * While Long Audio is in preview, SSML is temporarily unsupported. */ // const input = {} /** diff --git a/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata_google.cloud.texttospeech.v1beta1.json index 6ce363e36ea..fff03a24423 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ b/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 76, "type": "FULL" } ], diff --git a/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js b/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js index 4a47a3019d3..ddac548629a 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js +++ b/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js @@ -35,7 +35,6 @@ function main(input, audioConfig, outputGcsUri, voice) { // const parent = 'abc123' /** * Required. The Synthesizer requires either plain text or SSML as input. - * While Long Audio is in preview, SSML is temporarily unsupported. */ // const input = {} /** diff --git a/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts b/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts index 05e4794eeae..a5aa76f3eee 100644 --- a/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts +++ b/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts @@ -410,7 +410,6 @@ export class TextToSpeechLongAudioSynthesizeClient { * `projects/* /locations/*`. * @param {google.cloud.texttospeech.v1.SynthesisInput} request.input * Required. The Synthesizer requires either plain text or SSML as input. - * While Long Audio is in preview, SSML is temporarily unsupported. * @param {google.cloud.texttospeech.v1.AudioConfig} request.audioConfig * Required. The configuration of the synthesized audio. * @param {string} request.outputGcsUri diff --git a/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts index 01af7073237..2736e415908 100644 --- a/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts +++ b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts @@ -410,7 +410,6 @@ export class TextToSpeechLongAudioSynthesizeClient { * `projects/* /locations/*`. * @param {google.cloud.texttospeech.v1beta1.SynthesisInput} request.input * Required. The Synthesizer requires either plain text or SSML as input. - * While Long Audio is in preview, SSML is temporarily unsupported. * @param {google.cloud.texttospeech.v1beta1.AudioConfig} request.audioConfig * Required. The configuration of the synthesized audio. * @param {string} request.outputGcsUri From 9f202c3efa14d745889ab5a47267db4b4dd05001 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:03:23 -0700 Subject: [PATCH 07/16] docs: [generativelanguage] Many small fixes (#5624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Many small fixes feat: Add new PromptFeedback and FinishReason entries for https://github.com/google-gemini/generative-ai-python/issues/476 PiperOrigin-RevId: 663936518 Source-Link: https://github.com/googleapis/googleapis/commit/5157b5f45590d4695e99e9f4a76cdc5c54077472 Source-Link: https://github.com/googleapis/googleapis-gen/commit/740787c5eb4f2dcfb9094a1183e0314c725fb0ca Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFpLWdlbmVyYXRpdmVsYW5ndWFnZS8uT3dsQm90LnlhbWwiLCJoIjoiNzQwNzg3YzVlYjRmMmRjZmI5MDk0YTExODNlMDMxNGM3MjVmYjBjYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Many small fixes feat: Add new PromptFeedback and FinishReason entries feat: Add model max_temperature PiperOrigin-RevId: 663936564 Source-Link: https://github.com/googleapis/googleapis/commit/21c206f7370ed960b1c00418cb1edbdb81e3f999 Source-Link: https://github.com/googleapis/googleapis-gen/commit/97ac6dfcaa79ef76bb78f860e7986adcbe223081 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFpLWdlbmVyYXRpdmVsYW5ndWFnZS8uT3dsQm90LnlhbWwiLCJoIjoiOTdhYzZkZmNhYTc5ZWY3NmJiNzhmODYwZTc5ODZhZGNiZTIyMzA4MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update gapic_cache_service_v1beta.ts --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../v1/generative_service.proto | 159 +++++++---- .../ai/generativelanguage/v1/model.proto | 28 +- .../generativelanguage/v1/model_service.proto | 13 +- .../generativelanguage/v1beta/content.proto | 4 + .../v1beta/generative_service.proto | 246 +++++++++++------- .../ai/generativelanguage/v1beta/model.proto | 19 +- .../v1beta/model_service.proto | 21 +- .../v1beta/tuned_model.proto | 13 +- .../protos/protos.d.ts | 37 ++- .../protos/protos.js | 173 ++++++++++++ .../protos/protos.json | 41 ++- .../v1/generative_service.count_tokens.js | 10 +- .../v1/generative_service.embed_content.js | 4 +- .../v1/generative_service.generate_content.js | 13 +- ...erative_service.stream_generate_content.js | 13 +- .../generated/v1/model_service.list_models.js | 3 +- ...adata_google.ai.generativelanguage.v1.json | 22 +- .../v1beta/generative_service.count_tokens.js | 10 +- .../generative_service.embed_content.js | 4 +- .../generative_service.generate_answer.js | 9 +- .../generative_service.generate_content.js | 38 ++- ...erative_service.stream_generate_content.js | 38 ++- .../model_service.create_tuned_model.js | 2 +- .../v1beta/model_service.list_models.js | 3 +- ...a_google.ai.generativelanguage.v1beta.json | 28 +- .../src/v1/generative_service_client.ts | 72 +++-- .../src/v1/model_service_client.ts | 19 +- .../src/v1beta/generative_service_client.ts | 131 ++++++---- .../src/v1beta/model_service_client.ts | 27 +- 29 files changed, 840 insertions(+), 360 deletions(-) diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto index 67399d8b4e1..2ab0e71d2c7 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto @@ -34,13 +34,13 @@ option java_package = "com.google.ai.generativelanguage.v1"; service GenerativeService { option (google.api.default_host) = "generativelanguage.googleapis.com"; - // Generates a response from the model given an input - // `GenerateContentRequest`. - // - // Input capabilities differ between models, including tuned models. See the - // [model guide](https://ai.google.dev/models/gemini) and - // [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for - // details. + // Generates a model response given an input `GenerateContentRequest`. + // Refer to the [text generation + // guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed + // usage information. Input capabilities differ between models, including + // tuned models. Refer to the [model + // guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning + // guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. rpc GenerateContent(GenerateContentRequest) returns (GenerateContentResponse) { option (google.api.http) = { @@ -54,8 +54,9 @@ service GenerativeService { option (google.api.method_signature) = "model,contents"; } - // Generates a streamed response from the model given an input - // `GenerateContentRequest`. + // Generates a [streamed + // response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) + // from the model given an input `GenerateContentRequest`. rpc StreamGenerateContent(GenerateContentRequest) returns (stream GenerateContentResponse) { option (google.api.http) = { @@ -65,7 +66,9 @@ service GenerativeService { option (google.api.method_signature) = "model,contents"; } - // Generates an embedding from the model given an input `Content`. + // Generates a text embedding vector from the input `Content` using the + // specified [Gemini Embedding + // model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). rpc EmbedContent(EmbedContentRequest) returns (EmbedContentResponse) { option (google.api.http) = { post: "/v1/{model=models/*}:embedContent" @@ -74,8 +77,9 @@ service GenerativeService { option (google.api.method_signature) = "model,content"; } - // Generates multiple embeddings from the model given input text in a - // synchronous call. + // Generates multiple embedding vectors from the input `Content` which + // consists of a batch of strings represented as `EmbedContentRequest` + // objects. rpc BatchEmbedContents(BatchEmbedContentsRequest) returns (BatchEmbedContentsResponse) { option (google.api.http) = { @@ -85,7 +89,9 @@ service GenerativeService { option (google.api.method_signature) = "model,requests"; } - // Runs a model's tokenizer on input content and returns the token count. + // Runs a model's tokenizer on input `Content` and returns the token count. + // Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) + // to learn more about tokens. rpc CountTokens(CountTokensRequest) returns (CountTokensResponse) { option (google.api.http) = { post: "/v1/{model=models/*}:countTokens" @@ -136,9 +142,10 @@ message GenerateContentRequest { // Required. The content of the current conversation with the model. // - // For single-turn queries, this is a single instance. For multi-turn queries, - // this is a repeated field that contains conversation history + latest - // request. + // For single-turn queries, this is a single instance. For multi-turn queries + // like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + // this is a repeated field that contains the conversation history and the + // latest request. repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. A list of unique `SafetySetting` instances for blocking unsafe @@ -153,7 +160,11 @@ message GenerateContentRequest { // `SafetyCategory` provided in the list, the API will use the default safety // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - // HARM_CATEGORY_HARASSMENT are supported. + // HARM_CATEGORY_HARASSMENT are supported. Refer to the + // [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // for detailed information on available safety settings. Also refer to the + // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + // learn how to incorporate safety considerations in your AI applications. repeated SafetySetting safety_settings = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -163,7 +174,7 @@ message GenerateContentRequest { } // Configuration options for model generation and outputs. Not all parameters -// may be configurable for every model. +// are configurable for every model. message GenerationConfig { // Optional. Number of generated responses to return. // @@ -173,11 +184,11 @@ message GenerationConfig { // Optional. The set of character sequences (up to 5) that will stop output // generation. If specified, the API will stop at the first appearance of a - // stop sequence. The stop sequence will not be included as part of the + // `stop_sequence`. The stop sequence will not be included as part of the // response. repeated string stop_sequences = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of tokens to include in a candidate. + // Optional. The maximum number of tokens to include in a response candidate. // // Note: The default value varies by model, see the `Model.output_token_limit` // attribute of the `Model` returned from the `getModel` function. @@ -194,59 +205,68 @@ message GenerationConfig { // Optional. The maximum cumulative probability of tokens to consider when // sampling. // - // The model uses combined Top-k and nucleus sampling. + // The model uses combined Top-k and Top-p (nucleus) sampling. // // Tokens are sorted based on their assigned probabilities so that only the // most likely tokens are considered. Top-k sampling directly limits the - // maximum number of tokens to consider, while Nucleus sampling limits number - // of tokens based on the cumulative probability. + // maximum number of tokens to consider, while Nucleus sampling limits the + // number of tokens based on the cumulative probability. // - // Note: The default value varies by model, see the `Model.top_p` - // attribute of the `Model` returned from the `getModel` function. + // Note: The default value varies by `Model` and is specified by + // the`Model.top_p` attribute returned from the `getModel` function. An empty + // `top_k` attribute indicates that the model doesn't apply top-k sampling + // and doesn't allow setting `top_k` on requests. optional float top_p = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of tokens to consider when sampling. // - // Models use nucleus sampling or combined Top-k and nucleus sampling. - // Top-k sampling considers the set of `top_k` most probable tokens. - // Models running with nucleus sampling don't allow top_k setting. + // Gemini models use Top-p (nucleus) sampling or a combination of Top-k and + // nucleus sampling. Top-k sampling considers the set of `top_k` most probable + // tokens. Models running with nucleus sampling don't allow top_k setting. // - // Note: The default value varies by model, see the `Model.top_k` - // attribute of the `Model` returned from the `getModel` function. Empty - // `top_k` field in `Model` indicates the model doesn't apply top-k sampling + // Note: The default value varies by `Model` and is specified by + // the`Model.top_p` attribute returned from the `getModel` function. An empty + // `top_k` attribute indicates that the model doesn't apply top-k sampling // and doesn't allow setting `top_k` on requests. optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL]; } -// Response from the model supporting multiple candidates. +// Response from the model supporting multiple candidate responses. // -// Note on safety ratings and content filtering. They are reported for both +// Safety ratings and content filtering are reported for both // prompt in `GenerateContentResponse.prompt_feedback` and for each candidate -// in `finish_reason` and in `safety_ratings`. The API contract is that: -// - either all requested candidates are returned or no candidates at all -// - no candidates are returned only if there was something wrong with the -// prompt (see `prompt_feedback`) -// - feedback on each candidate is reported on `finish_reason` and +// in `finish_reason` and in `safety_ratings`. The API: +// - Returns either all requested candidates or none of them +// - Returns no candidates at all only if there was something wrong with the +// prompt (check `prompt_feedback`) +// - Reports feedback on each candidate in `finish_reason` and // `safety_ratings`. message GenerateContentResponse { // A set of the feedback metadata the prompt specified in // `GenerateContentRequest.content`. message PromptFeedback { - // Specifies what was the reason why prompt was blocked. + // Specifies the reason why the prompt was blocked. enum BlockReason { // Default value. This value is unused. BLOCK_REASON_UNSPECIFIED = 0; - // Prompt was blocked due to safety reasons. You can inspect - // `safety_ratings` to understand which safety category blocked it. + // Prompt was blocked due to safety reasons. Inspect `safety_ratings` + // to understand which safety category blocked it. SAFETY = 1; - // Prompt was blocked due to unknown reaasons. + // Prompt was blocked due to unknown reasons. OTHER = 2; + + // Prompt was blocked due to the terms which are included from the + // terminology blocklist. + BLOCKLIST = 3; + + // Prompt was blocked due to prohibited content. + PROHIBITED_CONTENT = 4; } // Optional. If set, the prompt was blocked and no candidates are returned. - // Rephrase your prompt. + // Rephrase the prompt. BlockReason block_reason = 1 [(google.api.field_behavior) = OPTIONAL]; // Ratings for safety of the prompt. @@ -256,13 +276,16 @@ message GenerateContentResponse { // Metadata on the generation request's token usage. message UsageMetadata { - // Number of tokens in the prompt. + // Number of tokens in the prompt. When `cached_content` is set, this is + // still the total effective prompt size meaning this includes the number of + // tokens in the cached content. int32 prompt_token_count = 1; - // Total number of tokens across the generated candidates. + // Total number of tokens across all the generated response candidates. int32 candidates_token_count = 2; - // Total token count for the generation request (prompt + candidates). + // Total token count for the generation request (prompt + response + // candidates). int32 total_token_count = 3; } @@ -289,17 +312,34 @@ message Candidate { // The maximum number of tokens as specified in the request was reached. MAX_TOKENS = 2; - // The candidate content was flagged for safety reasons. + // The response candidate content was flagged for safety reasons. SAFETY = 3; - // The candidate content was flagged for recitation reasons. + // The response candidate content was flagged for recitation reasons. RECITATION = 4; + // The response candidate content was flagged for using an unsupported + // language. + LANGUAGE = 6; + // Unknown reason. OTHER = 5; + + // Token generation stopped because the content contains forbidden terms. + BLOCKLIST = 7; + + // Token generation stopped for potentially containing prohibited content. + PROHIBITED_CONTENT = 8; + + // Token generation stopped because the content potentially contains + // Sensitive Personally Identifiable Information (SPII). + SPII = 9; + + // The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 10; } - // Output only. Index of the candidate in the list of candidates. + // Output only. Index of the candidate in the list of response candidates. optional int32 index = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Generated content returned from the model. @@ -307,7 +347,7 @@ message Candidate { // Optional. Output only. The reason why the model stopped generating tokens. // - // If empty, the model has not stopped generating the tokens. + // If empty, the model has not stopped generating tokens. FinishReason finish_reason = 2 [ (google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = OUTPUT_ONLY @@ -362,8 +402,8 @@ message EmbedContentRequest { // Optional. Optional reduced dimension for the output embedding. If set, // excessive values in the output embedding are truncated from the end. - // Supported by newer models since 2024, and the earlier model - // (`models/embedding-001`) cannot specify this value. + // Supported by newer models since 2024 only. You cannot set this value if + // using the earlier model (`models/embedding-001`). optional int32 output_dimensionality = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -431,8 +471,14 @@ message CountTokensRequest { // when `generate_content_request` is set. repeated Content contents = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The overall input given to the model. CountTokens will count - // prompt, function calling, etc. + // Optional. The overall input given to the `Model`. This includes the prompt + // as well as other model steering information like [system + // instructions](https://ai.google.dev/gemini-api/docs/system-instructions), + // and/or function declarations for [function + // calling](https://ai.google.dev/gemini-api/docs/function-calling). + // `Model`s/`Content`s and `generate_content_request`s are mutually + // exclusive. You can either send `Model` + `Content`s or a + // `generate_content_request`, but never both. GenerateContentRequest generate_content_request = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -441,8 +487,7 @@ message CountTokensRequest { // // It returns the model's `token_count` for the `prompt`. message CountTokensResponse { - // The number of tokens that the `model` tokenizes the `prompt` into. - // - // Always non-negative. + // The number of tokens that the `Model` tokenizes the `prompt` into. Always + // non-negative. int32 total_tokens = 1; } diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto index bb7945addab..702b00e0b91 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto @@ -31,7 +31,9 @@ message Model { pattern: "models/{model}" }; - // Required. The resource name of the `Model`. + // Required. The resource name of the `Model`. Refer to [Model + // variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) + // for all allowed values. // // Format: `models/{model}` with a `{model}` naming convention of: // @@ -39,22 +41,22 @@ message Model { // // Examples: // - // * `models/chat-bison-001` + // * `models/gemini-1.5-flash-001` string name = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The name of the base model, pass this to the generation request. // // Examples: // - // * `chat-bison` + // * `gemini-1.5-flash` string base_model_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The version number of the model. // - // This represents the major version + // This represents the major version (`1.0` or `1.5`) string version = 3 [(google.api.field_behavior) = REQUIRED]; - // The human-readable name of the model. E.g. "Chat Bison". + // The human-readable name of the model. E.g. "Gemini 1.5 Flash". // // The name can be up to 128 characters long and can consist of any UTF-8 // characters. @@ -71,20 +73,24 @@ message Model { // The model's supported generation methods. // - // The method names are defined as Pascal case - // strings, such as `generateMessage` which correspond to API methods. + // The corresponding API method names are defined as Pascal case + // strings, such as `generateMessage` and `generateContent`. repeated string supported_generation_methods = 8; // Controls the randomness of the output. // - // Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will - // produce responses that are more varied, while a value closer to `0.0` will - // typically result in less surprising responses from the model. + // Values can range over `[0.0,max_temperature]`, inclusive. A higher value + // will produce responses that are more varied, while a value closer to `0.0` + // will typically result in less surprising responses from the model. // This value specifies default to be used by the backend while making the // call to the model. optional float temperature = 9; - // For Nucleus sampling. + // The maximum temperature this model can use. + optional float max_temperature = 13; + + // For [Nucleus + // sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). // // Nucleus sampling considers the smallest set of tokens whose probability // sum is at least `top_p`. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto index 0e9162f421c..a67f97adae2 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto @@ -31,7 +31,12 @@ option java_package = "com.google.ai.generativelanguage.v1"; service ModelService { option (google.api.default_host) = "generativelanguage.googleapis.com"; - // Gets information about a specific Model. + // Gets information about a specific `Model` such as its version number, token + // limits, + // [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) + // and other metadata. Refer to the [Gemini models + // guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed + // model information. rpc GetModel(GetModelRequest) returns (Model) { option (google.api.http) = { get: "/v1/{name=models/*}" @@ -39,7 +44,8 @@ service ModelService { option (google.api.method_signature) = "name"; } - // Lists models available through the API. + // Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) + // available through the Gemini API. rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { option (google.api.http) = { get: "/v1/models" @@ -67,8 +73,7 @@ message GetModelRequest { message ListModelsRequest { // The maximum number of `Models` to return (per page). // - // The service may return fewer models. - // If unspecified, at most 50 models will be returned per page. + // If unspecified, 50 models will be returned per page. // This method returns at most 1000 models per page, even if you pass a larger // page_size. int32 page_size = 2; diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto index 6368fe0f749..af08768cefe 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto @@ -321,6 +321,7 @@ message Schema { // datatypes. Supported formats: // for NUMBER type: float, double // for INTEGER type: int32, int64 + // for STRING type: enum string format = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A brief description of the parameter. This could contain examples @@ -338,6 +339,9 @@ message Schema { // Optional. Schema of the elements of Type.ARRAY. optional Schema items = 6 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Maximum number of the elements for Type.ARRAY. + int64 max_items = 21 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Properties of Type.OBJECT. map properties = 7 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto index 93a530ddad7..c36ea47e2c9 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto @@ -35,13 +35,13 @@ option java_package = "com.google.ai.generativelanguage.v1beta"; service GenerativeService { option (google.api.default_host) = "generativelanguage.googleapis.com"; - // Generates a response from the model given an input - // `GenerateContentRequest`. - // - // Input capabilities differ between models, including tuned models. See the - // [model guide](https://ai.google.dev/models/gemini) and - // [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for - // details. + // Generates a model response given an input `GenerateContentRequest`. + // Refer to the [text generation + // guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed + // usage information. Input capabilities differ between models, including + // tuned models. Refer to the [model + // guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning + // guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. rpc GenerateContent(GenerateContentRequest) returns (GenerateContentResponse) { option (google.api.http) = { @@ -66,8 +66,9 @@ service GenerativeService { "model,contents,safety_settings,answer_style"; } - // Generates a streamed response from the model given an input - // `GenerateContentRequest`. + // Generates a [streamed + // response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) + // from the model given an input `GenerateContentRequest`. rpc StreamGenerateContent(GenerateContentRequest) returns (stream GenerateContentResponse) { option (google.api.http) = { @@ -77,7 +78,9 @@ service GenerativeService { option (google.api.method_signature) = "model,contents"; } - // Generates an embedding from the model given an input `Content`. + // Generates a text embedding vector from the input `Content` using the + // specified [Gemini Embedding + // model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). rpc EmbedContent(EmbedContentRequest) returns (EmbedContentResponse) { option (google.api.http) = { post: "/v1beta/{model=models/*}:embedContent" @@ -86,8 +89,9 @@ service GenerativeService { option (google.api.method_signature) = "model,content"; } - // Generates multiple embeddings from the model given input text in a - // synchronous call. + // Generates multiple embedding vectors from the input `Content` which + // consists of a batch of strings represented as `EmbedContentRequest` + // objects. rpc BatchEmbedContents(BatchEmbedContentsRequest) returns (BatchEmbedContentsResponse) { option (google.api.http) = { @@ -97,7 +101,9 @@ service GenerativeService { option (google.api.method_signature) = "model,requests"; } - // Runs a model's tokenizer on input content and returns the token count. + // Runs a model's tokenizer on input `Content` and returns the token count. + // Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) + // to learn more about tokens. rpc CountTokens(CountTokensRequest) returns (CountTokensResponse) { option (google.api.http) = { post: "/v1beta/{model=models/*}:countTokens" @@ -146,27 +152,36 @@ message GenerateContentRequest { } ]; - // Optional. Developer set system instruction. Currently, text only. + // Optional. Developer set [system + // instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). + // Currently, text only. optional Content system_instruction = 8 [(google.api.field_behavior) = OPTIONAL]; // Required. The content of the current conversation with the model. // - // For single-turn queries, this is a single instance. For multi-turn queries, - // this is a repeated field that contains conversation history + latest - // request. + // For single-turn queries, this is a single instance. For multi-turn queries + // like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + // this is a repeated field that contains the conversation history and the + // latest request. repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A list of `Tools` the model may use to generate the next + // Optional. A list of `Tools` the `Model` may use to generate the next // response. // // A `Tool` is a piece of code that enables the system to interact with // external systems to perform an action, or set of actions, outside of - // knowledge and scope of the model. The only supported tool is currently - // `Function`. + // knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + // `code_execution`. Refer to the [Function + // calling](https://ai.google.dev/gemini-api/docs/function-calling) and the + // [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) + // guides to learn more. repeated Tool tools = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Tool configuration for any `Tool` specified in the request. + // Optional. Tool configuration for any `Tool` specified in the request. Refer + // to the [Function calling + // guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + // for a usage example. ToolConfig tool_config = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. A list of unique `SafetySetting` instances for blocking unsafe @@ -181,7 +196,11 @@ message GenerateContentRequest { // `SafetyCategory` provided in the list, the API will use the default safety // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - // HARM_CATEGORY_HARASSMENT are supported. + // HARM_CATEGORY_HARASSMENT are supported. Refer to the + // [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // for detailed information on available safety settings. Also refer to the + // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + // learn how to incorporate safety considerations in your AI applications. repeated SafetySetting safety_settings = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -189,10 +208,9 @@ message GenerateContentRequest { optional GenerationConfig generation_config = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The name of the cached content used as context to serve the - // prediction. Note: only used in explicit caching, where users can have - // control over caching (e.g. what content to cache) and enjoy guaranteed cost - // savings. Format: `cachedContents/{cachedContent}` + // Optional. The name of the content + // [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context + // to serve the prediction. Format: `cachedContents/{cachedContent}` optional string cached_content = 9 [ (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { @@ -202,7 +220,7 @@ message GenerateContentRequest { } // Configuration options for model generation and outputs. Not all parameters -// may be configurable for every model. +// are configurable for every model. message GenerationConfig { // Optional. Number of generated responses to return. // @@ -212,11 +230,11 @@ message GenerationConfig { // Optional. The set of character sequences (up to 5) that will stop output // generation. If specified, the API will stop at the first appearance of a - // stop sequence. The stop sequence will not be included as part of the + // `stop_sequence`. The stop sequence will not be included as part of the // response. repeated string stop_sequences = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of tokens to include in a candidate. + // Optional. The maximum number of tokens to include in a response candidate. // // Note: The default value varies by model, see the `Model.output_token_limit` // attribute of the `Model` returned from the `getModel` function. @@ -233,55 +251,61 @@ message GenerationConfig { // Optional. The maximum cumulative probability of tokens to consider when // sampling. // - // The model uses combined Top-k and nucleus sampling. + // The model uses combined Top-k and Top-p (nucleus) sampling. // // Tokens are sorted based on their assigned probabilities so that only the // most likely tokens are considered. Top-k sampling directly limits the - // maximum number of tokens to consider, while Nucleus sampling limits number - // of tokens based on the cumulative probability. + // maximum number of tokens to consider, while Nucleus sampling limits the + // number of tokens based on the cumulative probability. // - // Note: The default value varies by model, see the `Model.top_p` - // attribute of the `Model` returned from the `getModel` function. + // Note: The default value varies by `Model` and is specified by + // the`Model.top_p` attribute returned from the `getModel` function. An empty + // `top_k` attribute indicates that the model doesn't apply top-k sampling + // and doesn't allow setting `top_k` on requests. optional float top_p = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of tokens to consider when sampling. // - // Models use nucleus sampling or combined Top-k and nucleus sampling. - // Top-k sampling considers the set of `top_k` most probable tokens. - // Models running with nucleus sampling don't allow top_k setting. + // Gemini models use Top-p (nucleus) sampling or a combination of Top-k and + // nucleus sampling. Top-k sampling considers the set of `top_k` most probable + // tokens. Models running with nucleus sampling don't allow top_k setting. // - // Note: The default value varies by model, see the `Model.top_k` - // attribute of the `Model` returned from the `getModel` function. Empty - // `top_k` field in `Model` indicates the model doesn't apply top-k sampling + // Note: The default value varies by `Model` and is specified by + // the`Model.top_p` attribute returned from the `getModel` function. An empty + // `top_k` attribute indicates that the model doesn't apply top-k sampling // and doesn't allow setting `top_k` on requests. optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Output response mimetype of the generated candidate text. - // Supported mimetype: + // Optional. MIME type of the generated candidate text. + // Supported MIME types are: // `text/plain`: (default) Text output. - // `application/json`: JSON response in the candidates. + // `application/json`: JSON response in the response candidates. + // Refer to the + // [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) + // for a list of all supported text MIME types. string response_mime_type = 13 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Output response schema of the generated candidate text when - // response mime type can have schema. Schema can be objects, primitives or - // arrays and is a subset of [OpenAPI - // schema](https://spec.openapis.org/oas/v3.0.3#schema). + // Optional. Output schema of the generated candidate text. Schemas must be a + // subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) + // and can be objects, primitives or arrays. // - // If set, a compatible response_mime_type must also be set. - // Compatible mimetypes: + // If set, a compatible `response_mime_type` must also be set. + // Compatible MIME types: // `application/json`: Schema for JSON response. + // Refer to the [JSON text generation + // guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details. Schema response_schema = 14 [(google.api.field_behavior) = OPTIONAL]; } // Configuration for retrieving grounding content from a `Corpus` or // `Document` created using the Semantic Retriever API. message SemanticRetrieverConfig { - // Required. Name of the resource for retrieval, e.g. corpora/123 or - // corpora/123/documents/abc. + // Required. Name of the resource for retrieval. Example: `corpora/123` or + // `corpora/123/documents/abc`. string source = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. Query to use for similarity matching `Chunk`s in the given - // resource. + // Required. Query to use for matching `Chunk`s in the given resource by + // similarity. Content query = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. Filters for selecting `Document`s and/or `Chunk`s from the @@ -297,35 +321,42 @@ message SemanticRetrieverConfig { [(google.api.field_behavior) = OPTIONAL]; } -// Response from the model supporting multiple candidates. +// Response from the model supporting multiple candidate responses. // -// Note on safety ratings and content filtering. They are reported for both +// Safety ratings and content filtering are reported for both // prompt in `GenerateContentResponse.prompt_feedback` and for each candidate -// in `finish_reason` and in `safety_ratings`. The API contract is that: -// - either all requested candidates are returned or no candidates at all -// - no candidates are returned only if there was something wrong with the -// prompt (see `prompt_feedback`) -// - feedback on each candidate is reported on `finish_reason` and +// in `finish_reason` and in `safety_ratings`. The API: +// - Returns either all requested candidates or none of them +// - Returns no candidates at all only if there was something wrong with the +// prompt (check `prompt_feedback`) +// - Reports feedback on each candidate in `finish_reason` and // `safety_ratings`. message GenerateContentResponse { // A set of the feedback metadata the prompt specified in // `GenerateContentRequest.content`. message PromptFeedback { - // Specifies what was the reason why prompt was blocked. + // Specifies the reason why the prompt was blocked. enum BlockReason { // Default value. This value is unused. BLOCK_REASON_UNSPECIFIED = 0; - // Prompt was blocked due to safety reasons. You can inspect - // `safety_ratings` to understand which safety category blocked it. + // Prompt was blocked due to safety reasons. Inspect `safety_ratings` + // to understand which safety category blocked it. SAFETY = 1; // Prompt was blocked due to unknown reasons. OTHER = 2; + + // Prompt was blocked due to the terms which are included from the + // terminology blocklist. + BLOCKLIST = 3; + + // Prompt was blocked due to prohibited content. + PROHIBITED_CONTENT = 4; } // Optional. If set, the prompt was blocked and no candidates are returned. - // Rephrase your prompt. + // Rephrase the prompt. BlockReason block_reason = 1 [(google.api.field_behavior) = OPTIONAL]; // Ratings for safety of the prompt. @@ -335,19 +366,19 @@ message GenerateContentResponse { // Metadata on the generation request's token usage. message UsageMetadata { - // Number of tokens in the prompt. When cached_content is set, this is still - // the total effective prompt size. I.e. this includes the number of tokens - // in the cached content. + // Number of tokens in the prompt. When `cached_content` is set, this is + // still the total effective prompt size meaning this includes the number of + // tokens in the cached content. int32 prompt_token_count = 1; - // Number of tokens in the cached part of the prompt, i.e. in the cached - // content. + // Number of tokens in the cached part of the prompt (the cached content) int32 cached_content_token_count = 4; - // Total number of tokens across the generated candidates. + // Total number of tokens across all the generated response candidates. int32 candidates_token_count = 2; - // Total token count for the generation request (prompt + candidates). + // Total token count for the generation request (prompt + response + // candidates). int32 total_token_count = 3; } @@ -374,17 +405,34 @@ message Candidate { // The maximum number of tokens as specified in the request was reached. MAX_TOKENS = 2; - // The candidate content was flagged for safety reasons. + // The response candidate content was flagged for safety reasons. SAFETY = 3; - // The candidate content was flagged for recitation reasons. + // The response candidate content was flagged for recitation reasons. RECITATION = 4; + // The response candidate content was flagged for using an unsupported + // language. + LANGUAGE = 6; + // Unknown reason. OTHER = 5; + + // Token generation stopped because the content contains forbidden terms. + BLOCKLIST = 7; + + // Token generation stopped for potentially containing prohibited content. + PROHIBITED_CONTENT = 8; + + // Token generation stopped because the content potentially contains + // Sensitive Personally Identifiable Information (SPII). + SPII = 9; + + // The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 10; } - // Output only. Index of the candidate in the list of candidates. + // Output only. Index of the candidate in the list of response candidates. optional int32 index = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Generated content returned from the model. @@ -392,7 +440,7 @@ message Candidate { // Optional. Output only. The reason why the model stopped generating tokens. // - // If empty, the model has not stopped generating the tokens. + // If empty, the model has not stopped generating tokens. FinishReason finish_reason = 2 [ (google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = OUTPUT_ONLY @@ -466,7 +514,7 @@ message GroundingAttribution { Content content = 2; } -// Request to generate a grounded answer from the model. +// Request to generate a grounded answer from the `Model`. message GenerateAnswerRequest { // Style for grounded answers. enum AnswerStyle { @@ -505,12 +553,12 @@ message GenerateAnswerRequest { } ]; - // Required. The content of the current conversation with the model. For + // Required. The content of the current conversation with the `Model`. For // single-turn queries, this is a single question to answer. For multi-turn // queries, this is a repeated field that contains conversation history and // the last `Content` in the list containing the question. // - // Note: GenerateAnswer currently only supports queries in English. + // Note: `GenerateAnswer` only supports queries in English. repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Style in which answers should be returned. @@ -529,6 +577,11 @@ message GenerateAnswerRequest { // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, // HARM_CATEGORY_HARASSMENT are supported. + // Refer to the + // [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // for detailed information on available safety settings. Also refer to the + // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + // learn how to incorporate safety considerations in your AI applications. repeated SafetySetting safety_settings = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -545,14 +598,14 @@ message GenerateAnswerRequest { // Response from the model for a grounded answer. message GenerateAnswerResponse { // Feedback related to the input data used to answer the question, as opposed - // to model-generated response to the question. + // to the model-generated response to the question. message InputFeedback { // Specifies what was the reason why input was blocked. enum BlockReason { // Default value. This value is unused. BLOCK_REASON_UNSPECIFIED = 0; - // Input was blocked due to safety reasons. You can inspect + // Input was blocked due to safety reasons. Inspect // `safety_ratings` to understand which safety category blocked it. SAFETY = 1; @@ -561,7 +614,7 @@ message GenerateAnswerResponse { } // Optional. If set, the input was blocked and no candidates are returned. - // Rephrase your input. + // Rephrase the input. optional BlockReason block_reason = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -581,23 +634,23 @@ message GenerateAnswerResponse { // Output only. The model's estimate of the probability that its answer is // correct and grounded in the input passages. // - // A low answerable_probability indicates that the answer might not be + // A low `answerable_probability` indicates that the answer might not be // grounded in the sources. // - // When `answerable_probability` is low, some clients may wish to: + // When `answerable_probability` is low, you may want to: // // * Display a message to the effect of "We couldn’t answer that question" to // the user. // * Fall back to a general-purpose LLM that answers the question from world // knowledge. The threshold and nature of such fallbacks will depend on - // individual clients’ use cases. 0.5 is a good starting threshold. + // individual use cases. `0.5` is a good starting threshold. optional float answerable_probability = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Feedback related to the input data used to answer the - // question, as opposed to model-generated response to the question. + // question, as opposed to the model-generated response to the question. // - // "Input data" can be one or more of the following: + // The input data can be one or more of the following: // // - Question specified by the last entry in `GenerateAnswerRequest.content` // - Conversation history specified by the other entries in @@ -640,8 +693,8 @@ message EmbedContentRequest { // Optional. Optional reduced dimension for the output embedding. If set, // excessive values in the output embedding are truncated from the end. - // Supported by newer models since 2024, and the earlier model - // (`models/embedding-001`) cannot specify this value. + // Supported by newer models since 2024 only. You cannot set this value if + // using the earlier model (`models/embedding-001`). optional int32 output_dimensionality = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -709,8 +762,14 @@ message CountTokensRequest { // when `generate_content_request` is set. repeated Content contents = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The overall input given to the model. CountTokens will count - // prompt, function calling, etc. + // Optional. The overall input given to the `Model`. This includes the prompt + // as well as other model steering information like [system + // instructions](https://ai.google.dev/gemini-api/docs/system-instructions), + // and/or function declarations for [function + // calling](https://ai.google.dev/gemini-api/docs/function-calling). + // `Model`s/`Content`s and `generate_content_request`s are mutually + // exclusive. You can either send `Model` + `Content`s or a + // `generate_content_request`, but never both. GenerateContentRequest generate_content_request = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -719,11 +778,8 @@ message CountTokensRequest { // // It returns the model's `token_count` for the `prompt`. message CountTokensResponse { - // The number of tokens that the `model` tokenizes the `prompt` into. - // - // Always non-negative. When cached_content is set, this is still the total - // effective prompt size. I.e. this includes the number of tokens in the - // cached content. + // The number of tokens that the `Model` tokenizes the `prompt` into. Always + // non-negative. int32 total_tokens = 1; // Number of tokens in the cached part of the prompt, i.e. in the cached diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto index 2fe19b36df1..adbffed612c 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto @@ -31,7 +31,9 @@ message Model { pattern: "models/{model}" }; - // Required. The resource name of the `Model`. + // Required. The resource name of the `Model`. Refer to [Model + // variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) + // for all allowed values. // // Format: `models/{model}` with a `{model}` naming convention of: // @@ -39,22 +41,22 @@ message Model { // // Examples: // - // * `models/chat-bison-001` + // * `models/gemini-1.5-flash-001` string name = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The name of the base model, pass this to the generation request. // // Examples: // - // * `chat-bison` + // * `gemini-1.5-flash` string base_model_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The version number of the model. // - // This represents the major version + // This represents the major version (`1.0` or `1.5`) string version = 3 [(google.api.field_behavior) = REQUIRED]; - // The human-readable name of the model. E.g. "Chat Bison". + // The human-readable name of the model. E.g. "Gemini 1.5 Flash". // // The name can be up to 128 characters long and can consist of any UTF-8 // characters. @@ -71,8 +73,8 @@ message Model { // The model's supported generation methods. // - // The method names are defined as Pascal case - // strings, such as `generateMessage` which correspond to API methods. + // The corresponding API method names are defined as Pascal case + // strings, such as `generateMessage` and `generateContent`. repeated string supported_generation_methods = 8; // Controls the randomness of the output. @@ -87,7 +89,8 @@ message Model { // The maximum temperature this model can use. optional float max_temperature = 13; - // For Nucleus sampling. + // For [Nucleus + // sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). // // Nucleus sampling considers the smallest set of tokens whose probability // sum is at least `top_p`. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto index 0c22e8e9da8..37ca4202bd7 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto @@ -35,7 +35,12 @@ option java_package = "com.google.ai.generativelanguage.v1beta"; service ModelService { option (google.api.default_host) = "generativelanguage.googleapis.com"; - // Gets information about a specific Model. + // Gets information about a specific `Model` such as its version number, token + // limits, + // [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) + // and other metadata. Refer to the [Gemini models + // guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed + // model information. rpc GetModel(GetModelRequest) returns (Model) { option (google.api.http) = { get: "/v1beta/{name=models/*}" @@ -43,7 +48,8 @@ service ModelService { option (google.api.method_signature) = "name"; } - // Lists models available through the API. + // Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) + // available through the Gemini API. rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { option (google.api.http) = { get: "/v1beta/models" @@ -59,7 +65,7 @@ service ModelService { option (google.api.method_signature) = "name"; } - // Lists tuned models owned by the user. + // Lists created tuned models. rpc ListTunedModels(ListTunedModelsRequest) returns (ListTunedModelsResponse) { option (google.api.http) = { @@ -69,10 +75,10 @@ service ModelService { } // Creates a tuned model. - // Intermediate tuning progress (if any) is accessed through the + // Check intermediate tuning progress (if any) through the // [google.longrunning.Operations] service. // - // Status and results can be accessed through the Operations service. + // Access status and results through the Operations service. // Example: // GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 rpc CreateTunedModel(CreateTunedModelRequest) @@ -127,8 +133,7 @@ message GetModelRequest { message ListModelsRequest { // The maximum number of `Models` to return (per page). // - // The service may return fewer models. - // If unspecified, at most 50 models will be returned per page. + // If unspecified, 50 models will be returned per page. // This method returns at most 1000 models per page, even if you pass a larger // page_size. int32 page_size = 2; @@ -219,7 +224,7 @@ message CreateTunedModelRequest { // Optional. The unique id for the tuned model if specified. // This value should be up to 40 characters, the first character must be a // letter, the last could be a letter or a number. The id must match the - // regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?. + // regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`. optional string tuned_model_id = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. The tuned model to create. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto index 73a2e57135b..48bb3db6d5f 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto @@ -57,7 +57,7 @@ message TunedModel { [(google.api.field_behavior) = OPTIONAL]; // Immutable. The name of the `Model` to tune. - // Example: `models/text-bison-001` + // Example: `models/gemini-1.5-flash-001` string base_model = 4 [ (google.api.field_behavior) = IMMUTABLE, (google.api.resource_reference) = { @@ -70,9 +70,12 @@ message TunedModel { // create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on // create, the id portion of the name will be set by concatenating the words // of the display_name with hyphens and adding a random portion for - // uniqueness. Example: - // display_name = "Sentence Translator" - // name = "tunedModels/sentence-translator-u3b7m" + // uniqueness. + // + // Example: + // + // * display_name = `Sentence Translator` + // * name = `tunedModels/sentence-translator-u3b7m` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. The name to display for this model in user interfaces. @@ -139,7 +142,7 @@ message TunedModelSource { ]; // Output only. The name of the base `Model` this `TunedModel` was tuned from. - // Example: `models/text-bison-001` + // Example: `models/gemini-1.5-flash-001` string base_model = 2 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { diff --git a/packages/google-ai-generativelanguage/protos/protos.d.ts b/packages/google-ai-generativelanguage/protos/protos.d.ts index e53f7f0f4de..e24d61cf93a 100644 --- a/packages/google-ai-generativelanguage/protos/protos.d.ts +++ b/packages/google-ai-generativelanguage/protos/protos.d.ts @@ -1183,7 +1183,9 @@ export namespace google { enum BlockReason { BLOCK_REASON_UNSPECIFIED = 0, SAFETY = 1, - OTHER = 2 + OTHER = 2, + BLOCKLIST = 3, + PROHIBITED_CONTENT = 4 } } @@ -1436,7 +1438,12 @@ export namespace google { MAX_TOKENS = 2, SAFETY = 3, RECITATION = 4, - OTHER = 5 + LANGUAGE = 6, + OTHER = 5, + BLOCKLIST = 7, + PROHIBITED_CONTENT = 8, + SPII = 9, + MALFORMED_FUNCTION_CALL = 10 } } @@ -2451,6 +2458,9 @@ export namespace google { /** Model temperature */ temperature?: (number|null); + /** Model maxTemperature */ + maxTemperature?: (number|null); + /** Model topP */ topP?: (number|null); @@ -2494,6 +2504,9 @@ export namespace google { /** Model temperature. */ public temperature?: (number|null); + /** Model maxTemperature. */ + public maxTemperature?: (number|null); + /** Model topP. */ public topP?: (number|null); @@ -2503,6 +2516,9 @@ export namespace google { /** Model _temperature. */ public _temperature?: "temperature"; + /** Model _maxTemperature. */ + public _maxTemperature?: "maxTemperature"; + /** Model _topP. */ public _topP?: "topP"; @@ -5399,6 +5415,9 @@ export namespace google { /** Schema items */ items?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** Schema maxItems */ + maxItems?: (number|Long|string|null); + /** Schema properties */ properties?: ({ [k: string]: google.ai.generativelanguage.v1beta.ISchema }|null); @@ -5433,6 +5452,9 @@ export namespace google { /** Schema items. */ public items?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** Schema maxItems. */ + public maxItems: (number|Long|string); + /** Schema properties. */ public properties: { [k: string]: google.ai.generativelanguage.v1beta.ISchema }; @@ -9039,7 +9061,9 @@ export namespace google { enum BlockReason { BLOCK_REASON_UNSPECIFIED = 0, SAFETY = 1, - OTHER = 2 + OTHER = 2, + BLOCKLIST = 3, + PROHIBITED_CONTENT = 4 } } @@ -9304,7 +9328,12 @@ export namespace google { MAX_TOKENS = 2, SAFETY = 3, RECITATION = 4, - OTHER = 5 + LANGUAGE = 6, + OTHER = 5, + BLOCKLIST = 7, + PROHIBITED_CONTENT = 8, + SPII = 9, + MALFORMED_FUNCTION_CALL = 10 } } diff --git a/packages/google-ai-generativelanguage/protos/protos.js b/packages/google-ai-generativelanguage/protos/protos.js index 2bd4927ce1c..059a44aec4c 100644 --- a/packages/google-ai-generativelanguage/protos/protos.js +++ b/packages/google-ai-generativelanguage/protos/protos.js @@ -2781,6 +2781,8 @@ case 0: case 1: case 2: + case 3: + case 4: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -2826,6 +2828,14 @@ case 2: message.blockReason = 2; break; + case "BLOCKLIST": + case 3: + message.blockReason = 3; + break; + case "PROHIBITED_CONTENT": + case 4: + message.blockReason = 4; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -2900,12 +2910,16 @@ * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value * @property {number} SAFETY=1 SAFETY value * @property {number} OTHER=2 OTHER value + * @property {number} BLOCKLIST=3 BLOCKLIST value + * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value */ PromptFeedback.BlockReason = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0; values[valuesById[1] = "SAFETY"] = 1; values[valuesById[2] = "OTHER"] = 2; + values[valuesById[3] = "BLOCKLIST"] = 3; + values[valuesById[4] = "PROHIBITED_CONTENT"] = 4; return values; })(); @@ -3409,7 +3423,12 @@ case 2: case 3: case 4: + case 6: case 5: + case 7: + case 8: + case 9: + case 10: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -3478,10 +3497,30 @@ case 4: message.finishReason = 4; break; + case "LANGUAGE": + case 6: + message.finishReason = 6; + break; case "OTHER": case 5: message.finishReason = 5; break; + case "BLOCKLIST": + case 7: + message.finishReason = 7; + break; + case "PROHIBITED_CONTENT": + case 8: + message.finishReason = 8; + break; + case "SPII": + case 9: + message.finishReason = 9; + break; + case "MALFORMED_FUNCTION_CALL": + case 10: + message.finishReason = 10; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -3580,7 +3619,12 @@ * @property {number} MAX_TOKENS=2 MAX_TOKENS value * @property {number} SAFETY=3 SAFETY value * @property {number} RECITATION=4 RECITATION value + * @property {number} LANGUAGE=6 LANGUAGE value * @property {number} OTHER=5 OTHER value + * @property {number} BLOCKLIST=7 BLOCKLIST value + * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value + * @property {number} SPII=9 SPII value + * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3589,7 +3633,12 @@ values[valuesById[2] = "MAX_TOKENS"] = 2; values[valuesById[3] = "SAFETY"] = 3; values[valuesById[4] = "RECITATION"] = 4; + values[valuesById[6] = "LANGUAGE"] = 6; values[valuesById[5] = "OTHER"] = 5; + values[valuesById[7] = "BLOCKLIST"] = 7; + values[valuesById[8] = "PROHIBITED_CONTENT"] = 8; + values[valuesById[9] = "SPII"] = 9; + values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; return values; })(); @@ -6142,6 +6191,7 @@ * @property {number|null} [outputTokenLimit] Model outputTokenLimit * @property {Array.|null} [supportedGenerationMethods] Model supportedGenerationMethods * @property {number|null} [temperature] Model temperature + * @property {number|null} [maxTemperature] Model maxTemperature * @property {number|null} [topP] Model topP * @property {number|null} [topK] Model topK */ @@ -6234,6 +6284,14 @@ */ Model.prototype.temperature = null; + /** + * Model maxTemperature. + * @member {number|null|undefined} maxTemperature + * @memberof google.ai.generativelanguage.v1.Model + * @instance + */ + Model.prototype.maxTemperature = null; + /** * Model topP. * @member {number|null|undefined} topP @@ -6264,6 +6322,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Model _maxTemperature. + * @member {"maxTemperature"|undefined} _maxTemperature + * @memberof google.ai.generativelanguage.v1.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_maxTemperature", { + get: $util.oneOfGetter($oneOfFields = ["maxTemperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Model _topP. * @member {"topP"|undefined} _topP @@ -6333,6 +6402,8 @@ writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP); if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK); + if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature")) + writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature); return writer; }; @@ -6405,6 +6476,10 @@ message.temperature = reader.float(); break; } + case 13: { + message.maxTemperature = reader.float(); + break; + } case 10: { message.topP = reader.float(); break; @@ -6482,6 +6557,11 @@ if (typeof message.temperature !== "number") return "temperature: number expected"; } + if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) { + properties._maxTemperature = 1; + if (typeof message.maxTemperature !== "number") + return "maxTemperature: number expected"; + } if (message.topP != null && message.hasOwnProperty("topP")) { properties._topP = 1; if (typeof message.topP !== "number") @@ -6530,6 +6610,8 @@ } if (object.temperature != null) message.temperature = Number(object.temperature); + if (object.maxTemperature != null) + message.maxTemperature = Number(object.maxTemperature); if (object.topP != null) message.topP = Number(object.topP); if (object.topK != null) @@ -6595,6 +6677,11 @@ if (options.oneofs) object._topK = "topK"; } + if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) { + object.maxTemperature = options.json && !isFinite(message.maxTemperature) ? String(message.maxTemperature) : message.maxTemperature; + if (options.oneofs) + object._maxTemperature = "maxTemperature"; + } return object; }; @@ -13183,6 +13270,7 @@ * @property {boolean|null} [nullable] Schema nullable * @property {Array.|null} ["enum"] Schema enum * @property {google.ai.generativelanguage.v1beta.ISchema|null} [items] Schema items + * @property {number|Long|null} [maxItems] Schema maxItems * @property {Object.|null} [properties] Schema properties * @property {Array.|null} [required] Schema required */ @@ -13253,6 +13341,14 @@ */ Schema.prototype.items = null; + /** + * Schema maxItems. + * @member {number|Long} maxItems + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** * Schema properties. * @member {Object.} properties @@ -13328,6 +13424,8 @@ if (message.required != null && message.required.length) for (var i = 0; i < message.required.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).string(message.required[i]); + if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) + writer.uint32(/* id 21, wireType 0 =*/168).int64(message.maxItems); return writer; }; @@ -13388,6 +13486,10 @@ message.items = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); break; } + case 21: { + message.maxItems = reader.int64(); + break; + } case 7: { if (message.properties === $util.emptyObject) message.properties = {}; @@ -13490,6 +13592,9 @@ return "items." + error; } } + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) + return "maxItems: integer|Long expected"; if (message.properties != null && message.hasOwnProperty("properties")) { if (!$util.isObject(message.properties)) return "properties: object expected"; @@ -13576,6 +13681,15 @@ throw TypeError(".google.ai.generativelanguage.v1beta.Schema.items: object expected"); message.items = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.items); } + if (object.maxItems != null) + if ($util.Long) + (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; + else if (typeof object.maxItems === "string") + message.maxItems = parseInt(object.maxItems, 10); + else if (typeof object.maxItems === "number") + message.maxItems = object.maxItems; + else if (typeof object.maxItems === "object") + message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); if (object.properties) { if (typeof object.properties !== "object") throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected"); @@ -13620,6 +13734,11 @@ object.format = ""; object.description = ""; object.nullable = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxItems = options.longs === String ? "0" : 0; } if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Type[message.type] === undefined ? message.type : $root.google.ai.generativelanguage.v1beta.Type[message.type] : message.type; @@ -13650,6 +13769,11 @@ for (var j = 0; j < message.required.length; ++j) object.required[j] = message.required[j]; } + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (typeof message.maxItems === "number") + object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; + else + object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; return object; }; @@ -22264,6 +22388,8 @@ case 0: case 1: case 2: + case 3: + case 4: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -22309,6 +22435,14 @@ case 2: message.blockReason = 2; break; + case "BLOCKLIST": + case 3: + message.blockReason = 3; + break; + case "PROHIBITED_CONTENT": + case 4: + message.blockReason = 4; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -22383,12 +22517,16 @@ * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value * @property {number} SAFETY=1 SAFETY value * @property {number} OTHER=2 OTHER value + * @property {number} BLOCKLIST=3 BLOCKLIST value + * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value */ PromptFeedback.BlockReason = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0; values[valuesById[1] = "SAFETY"] = 1; values[valuesById[2] = "OTHER"] = 2; + values[valuesById[3] = "BLOCKLIST"] = 3; + values[valuesById[4] = "PROHIBITED_CONTENT"] = 4; return values; })(); @@ -22934,7 +23072,12 @@ case 2: case 3: case 4: + case 6: case 5: + case 7: + case 8: + case 9: + case 10: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -23012,10 +23155,30 @@ case 4: message.finishReason = 4; break; + case "LANGUAGE": + case 6: + message.finishReason = 6; + break; case "OTHER": case 5: message.finishReason = 5; break; + case "BLOCKLIST": + case 7: + message.finishReason = 7; + break; + case "PROHIBITED_CONTENT": + case 8: + message.finishReason = 8; + break; + case "SPII": + case 9: + message.finishReason = 9; + break; + case "MALFORMED_FUNCTION_CALL": + case 10: + message.finishReason = 10; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -23131,7 +23294,12 @@ * @property {number} MAX_TOKENS=2 MAX_TOKENS value * @property {number} SAFETY=3 SAFETY value * @property {number} RECITATION=4 RECITATION value + * @property {number} LANGUAGE=6 LANGUAGE value * @property {number} OTHER=5 OTHER value + * @property {number} BLOCKLIST=7 BLOCKLIST value + * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value + * @property {number} SPII=9 SPII value + * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -23140,7 +23308,12 @@ values[valuesById[2] = "MAX_TOKENS"] = 2; values[valuesById[3] = "SAFETY"] = 3; values[valuesById[4] = "RECITATION"] = 4; + values[valuesById[6] = "LANGUAGE"] = 6; values[valuesById[5] = "OTHER"] = 5; + values[valuesById[7] = "BLOCKLIST"] = 7; + values[valuesById[8] = "PROHIBITED_CONTENT"] = 8; + values[valuesById[9] = "SPII"] = 9; + values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; return values; })(); diff --git a/packages/google-ai-generativelanguage/protos/protos.json b/packages/google-ai-generativelanguage/protos/protos.json index 8627a47ba22..9fd4748a231 100644 --- a/packages/google-ai-generativelanguage/protos/protos.json +++ b/packages/google-ai-generativelanguage/protos/protos.json @@ -417,7 +417,9 @@ "values": { "BLOCK_REASON_UNSPECIFIED": 0, "SAFETY": 1, - "OTHER": 2 + "OTHER": 2, + "BLOCKLIST": 3, + "PROHIBITED_CONTENT": 4 } } } @@ -499,7 +501,12 @@ "MAX_TOKENS": 2, "SAFETY": 3, "RECITATION": 4, - "OTHER": 5 + "LANGUAGE": 6, + "OTHER": 5, + "BLOCKLIST": 7, + "PROHIBITED_CONTENT": 8, + "SPII": 9, + "MALFORMED_FUNCTION_CALL": 10 } } } @@ -739,6 +746,11 @@ "temperature" ] }, + "_maxTemperature": { + "oneof": [ + "maxTemperature" + ] + }, "_topP": { "oneof": [ "topP" @@ -800,6 +812,13 @@ "proto3_optional": true } }, + "maxTemperature": { + "type": "float", + "id": 13, + "options": { + "proto3_optional": true + } + }, "topP": { "type": "float", "id": 10, @@ -1578,6 +1597,13 @@ "proto3_optional": true } }, + "maxItems": { + "type": "int64", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "properties": { "keyType": "string", "type": "Schema", @@ -2732,7 +2758,9 @@ "values": { "BLOCK_REASON_UNSPECIFIED": 0, "SAFETY": 1, - "OTHER": 2 + "OTHER": 2, + "BLOCKLIST": 3, + "PROHIBITED_CONTENT": 4 } } } @@ -2826,7 +2854,12 @@ "MAX_TOKENS": 2, "SAFETY": 3, "RECITATION": 4, - "OTHER": 5 + "LANGUAGE": 6, + "OTHER": 5, + "BLOCKLIST": 7, + "PROHIBITED_CONTENT": 8, + "SPII": 9, + "MALFORMED_FUNCTION_CALL": 10 } } } diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js index 6bcef9900a2..4a367152a9a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js @@ -41,8 +41,14 @@ function main(model) { */ // const contents = [1,2,3,4] /** - * Optional. The overall input given to the model. CountTokens will count - * prompt, function calling, etc. + * Optional. The overall input given to the `Model`. This includes the prompt + * as well as other model steering information like system + * instructions (https://ai.google.dev/gemini-api/docs/system-instructions), + * and/or function declarations for function + * calling (https://ai.google.dev/gemini-api/docs/function-calling). + * `Model`s/`Content`s and `generate_content_request`s are mutually + * exclusive. You can either send `Model` + `Content`s or a + * `generate_content_request`, but never both. */ // const generateContentRequest = {} diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js index 28e6cc7f1d8..fbfeefdd645 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js @@ -55,8 +55,8 @@ function main(model, content) { /** * Optional. Optional reduced dimension for the output embedding. If set, * excessive values in the output embedding are truncated from the end. - * Supported by newer models since 2024, and the earlier model - * (`models/embedding-001`) cannot specify this value. + * Supported by newer models since 2024 only. You cannot set this value if + * using the earlier model (`models/embedding-001`). */ // const outputDimensionality = 1234 diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js index f2f39e44ebf..aebc6b2cd94 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js @@ -35,9 +35,10 @@ function main(model, contents) { // const model = 'abc123' /** * Required. The content of the current conversation with the model. - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like chat (https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. */ // const contents = [1,2,3,4] /** @@ -52,7 +53,11 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. */ // const safetySettings = [1,2,3,4] /** diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js index 65d04e12502..76063a5f6cd 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js @@ -35,9 +35,10 @@ function main(model, contents) { // const model = 'abc123' /** * Required. The content of the current conversation with the model. - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like chat (https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. */ // const contents = [1,2,3,4] /** @@ -52,7 +53,11 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. */ // const safetySettings = [1,2,3,4] /** diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js index cbce8369557..acbcb017466 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js @@ -30,8 +30,7 @@ function main() { */ /** * The maximum number of `Models` to return (per page). - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. */ diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json b/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json index 2513a58c883..b5f984118e6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json @@ -15,14 +15,14 @@ "regionTag": "generativelanguage_v1_generated_GenerativeService_GenerateContent_async", "title": "GenerativeService generateContent Sample", "origin": "API_DEFINITION", - "description": " Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.", + "description": " Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", "canonical": true, "file": "generative_service.generate_content.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 81, + "end": 86, "type": "FULL" } ], @@ -67,14 +67,14 @@ "regionTag": "generativelanguage_v1_generated_GenerativeService_StreamGenerateContent_async", "title": "GenerativeService streamGenerateContent Sample", "origin": "API_DEFINITION", - "description": " Generates a streamed response from the model given an input `GenerateContentRequest`.", + "description": " Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", "canonical": true, "file": "generative_service.stream_generate_content.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 83, + "end": 88, "type": "FULL" } ], @@ -119,7 +119,7 @@ "regionTag": "generativelanguage_v1_generated_GenerativeService_EmbedContent_async", "title": "GenerativeService embedContent Sample", "origin": "API_DEFINITION", - "description": " Generates an embedding from the model given an input `Content`.", + "description": " Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", "canonical": true, "file": "generative_service.embed_content.js", "language": "JAVASCRIPT", @@ -175,7 +175,7 @@ "regionTag": "generativelanguage_v1_generated_GenerativeService_BatchEmbedContents_async", "title": "GenerativeService batchEmbedContents Sample", "origin": "API_DEFINITION", - "description": " Generates multiple embeddings from the model given input text in a synchronous call.", + "description": " Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", "canonical": true, "file": "generative_service.batch_embed_contents.js", "language": "JAVASCRIPT", @@ -219,14 +219,14 @@ "regionTag": "generativelanguage_v1_generated_GenerativeService_CountTokens_async", "title": "GenerativeService countTokens Sample", "origin": "API_DEFINITION", - "description": " Runs a model's tokenizer on input content and returns the token count.", + "description": " Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", "canonical": true, "file": "generative_service.count_tokens.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 66, + "end": 72, "type": "FULL" } ], @@ -267,7 +267,7 @@ "regionTag": "generativelanguage_v1_generated_ModelService_GetModel_async", "title": "GenerativeService getModel Sample", "origin": "API_DEFINITION", - "description": " Gets information about a specific Model.", + "description": " Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", "canonical": true, "file": "model_service.get_model.js", "language": "JAVASCRIPT", @@ -307,14 +307,14 @@ "regionTag": "generativelanguage_v1_generated_ModelService_ListModels_async", "title": "GenerativeService listModels Sample", "origin": "API_DEFINITION", - "description": " Lists models available through the API.", + "description": " Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", "canonical": true, "file": "model_service.list_models.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 66, + "end": 65, "type": "FULL" } ], diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js index 0c8c19dd7fd..730c13d5ed2 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js @@ -41,8 +41,14 @@ function main(model) { */ // const contents = [1,2,3,4] /** - * Optional. The overall input given to the model. CountTokens will count - * prompt, function calling, etc. + * Optional. The overall input given to the `Model`. This includes the prompt + * as well as other model steering information like system + * instructions (https://ai.google.dev/gemini-api/docs/system-instructions), + * and/or function declarations for function + * calling (https://ai.google.dev/gemini-api/docs/function-calling). + * `Model`s/`Content`s and `generate_content_request`s are mutually + * exclusive. You can either send `Model` + `Content`s or a + * `generate_content_request`, but never both. */ // const generateContentRequest = {} diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js index 6f98771b89c..c478864c469 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js @@ -55,8 +55,8 @@ function main(model, content) { /** * Optional. Optional reduced dimension for the output embedding. If set, * excessive values in the output embedding are truncated from the end. - * Supported by newer models since 2024, and the earlier model - * (`models/embedding-001`) cannot specify this value. + * Supported by newer models since 2024 only. You cannot set this value if + * using the earlier model (`models/embedding-001`). */ // const outputDimensionality = 1234 diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js index 1f4215ee0ac..3307d7aa5e3 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js @@ -44,11 +44,11 @@ function main(model, contents, answerStyle) { */ // const model = 'abc123' /** - * Required. The content of the current conversation with the model. For + * Required. The content of the current conversation with the `Model`. For * single-turn queries, this is a single question to answer. For multi-turn * queries, this is a repeated field that contains conversation history and * the last `Content` in the list containing the question. - * Note: GenerateAnswer currently only supports queries in English. + * Note: `GenerateAnswer` only supports queries in English. */ // const contents = [1,2,3,4] /** @@ -68,6 +68,11 @@ function main(model, contents, answerStyle) { * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, * HARM_CATEGORY_HARASSMENT are supported. + * Refer to the + * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. */ // const safetySettings = [1,2,3,4] /** diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js index 08e1ef7db2b..25cd328bdc8 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js @@ -34,27 +34,36 @@ function main(model, contents) { */ // const model = 'abc123' /** - * Optional. Developer set system instruction. Currently, text only. + * Optional. Developer set system + * instruction(s) (https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. */ // const systemInstruction = {} /** * Required. The content of the current conversation with the model. - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like chat (https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. */ // const contents = [1,2,3,4] /** - * Optional. A list of `Tools` the model may use to generate the next + * Optional. A list of `Tools` the `Model` may use to generate the next * response. * A `Tool` is a piece of code that enables the system to interact with * external systems to perform an action, or set of actions, outside of - * knowledge and scope of the model. The only supported tool is currently - * `Function`. + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the Function + * calling (https://ai.google.dev/gemini-api/docs/function-calling) and the + * Code execution (https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. */ // const tools = [1,2,3,4] /** - * Optional. Tool configuration for any `Tool` specified in the request. + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the Function calling + * guide (https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. */ // const toolConfig = {} /** @@ -69,7 +78,11 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. */ // const safetySettings = [1,2,3,4] /** @@ -77,10 +90,9 @@ function main(model, contents) { */ // const generationConfig = {} /** - * Optional. The name of the cached content used as context to serve the - * prediction. Note: only used in explicit caching, where users can have - * control over caching (e.g. what content to cache) and enjoy guaranteed cost - * savings. Format: `cachedContents/{cachedContent}` + * Optional. The name of the content + * cached (https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. Format: `cachedContents/{cachedContent}` */ // const cachedContent = 'abc123' diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js index 45d60f0e222..34922abbe6c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js @@ -34,27 +34,36 @@ function main(model, contents) { */ // const model = 'abc123' /** - * Optional. Developer set system instruction. Currently, text only. + * Optional. Developer set system + * instruction(s) (https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. */ // const systemInstruction = {} /** * Required. The content of the current conversation with the model. - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like chat (https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. */ // const contents = [1,2,3,4] /** - * Optional. A list of `Tools` the model may use to generate the next + * Optional. A list of `Tools` the `Model` may use to generate the next * response. * A `Tool` is a piece of code that enables the system to interact with * external systems to perform an action, or set of actions, outside of - * knowledge and scope of the model. The only supported tool is currently - * `Function`. + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the Function + * calling (https://ai.google.dev/gemini-api/docs/function-calling) and the + * Code execution (https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. */ // const tools = [1,2,3,4] /** - * Optional. Tool configuration for any `Tool` specified in the request. + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the Function calling + * guide (https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. */ // const toolConfig = {} /** @@ -69,7 +78,11 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. */ // const safetySettings = [1,2,3,4] /** @@ -77,10 +90,9 @@ function main(model, contents) { */ // const generationConfig = {} /** - * Optional. The name of the cached content used as context to serve the - * prediction. Note: only used in explicit caching, where users can have - * control over caching (e.g. what content to cache) and enjoy guaranteed cost - * savings. Format: `cachedContents/{cachedContent}` + * Optional. The name of the content + * cached (https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. Format: `cachedContents/{cachedContent}` */ // const cachedContent = 'abc123' diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js index 74508f18669..2a501ffb08f 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js @@ -32,7 +32,7 @@ function main(tunedModel) { * Optional. The unique id for the tuned model if specified. * This value should be up to 40 characters, the first character must be a * letter, the last could be a letter or a number. The id must match the - * regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?. + * regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`. */ // const tunedModelId = 'abc123' /** diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js index ec328391664..d407d406419 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js @@ -30,8 +30,7 @@ function main() { */ /** * The maximum number of `Models` to return (per page). - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. */ diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json b/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json index 89dde0e87c6..fb73b7dc5e3 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json @@ -491,14 +491,14 @@ "regionTag": "generativelanguage_v1beta_generated_GenerativeService_GenerateContent_async", "title": "CacheService generateContent Sample", "origin": "API_DEFINITION", - "description": " Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.", + "description": " Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", "canonical": true, "file": "generative_service.generate_content.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 105, + "end": 117, "type": "FULL" } ], @@ -566,7 +566,7 @@ "segments": [ { "start": 25, - "end": 102, + "end": 107, "type": "FULL" } ], @@ -623,14 +623,14 @@ "regionTag": "generativelanguage_v1beta_generated_GenerativeService_StreamGenerateContent_async", "title": "CacheService streamGenerateContent Sample", "origin": "API_DEFINITION", - "description": " Generates a streamed response from the model given an input `GenerateContentRequest`.", + "description": " Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", "canonical": true, "file": "generative_service.stream_generate_content.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 107, + "end": 119, "type": "FULL" } ], @@ -691,7 +691,7 @@ "regionTag": "generativelanguage_v1beta_generated_GenerativeService_EmbedContent_async", "title": "CacheService embedContent Sample", "origin": "API_DEFINITION", - "description": " Generates an embedding from the model given an input `Content`.", + "description": " Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", "canonical": true, "file": "generative_service.embed_content.js", "language": "JAVASCRIPT", @@ -747,7 +747,7 @@ "regionTag": "generativelanguage_v1beta_generated_GenerativeService_BatchEmbedContents_async", "title": "CacheService batchEmbedContents Sample", "origin": "API_DEFINITION", - "description": " Generates multiple embeddings from the model given input text in a synchronous call.", + "description": " Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", "canonical": true, "file": "generative_service.batch_embed_contents.js", "language": "JAVASCRIPT", @@ -791,14 +791,14 @@ "regionTag": "generativelanguage_v1beta_generated_GenerativeService_CountTokens_async", "title": "CacheService countTokens Sample", "origin": "API_DEFINITION", - "description": " Runs a model's tokenizer on input content and returns the token count.", + "description": " Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", "canonical": true, "file": "generative_service.count_tokens.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 66, + "end": 72, "type": "FULL" } ], @@ -839,7 +839,7 @@ "regionTag": "generativelanguage_v1beta_generated_ModelService_GetModel_async", "title": "CacheService getModel Sample", "origin": "API_DEFINITION", - "description": " Gets information about a specific Model.", + "description": " Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", "canonical": true, "file": "model_service.get_model.js", "language": "JAVASCRIPT", @@ -879,14 +879,14 @@ "regionTag": "generativelanguage_v1beta_generated_ModelService_ListModels_async", "title": "CacheService listModels Sample", "origin": "API_DEFINITION", - "description": " Lists models available through the API.", + "description": " Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", "canonical": true, "file": "model_service.list_models.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 66, + "end": 65, "type": "FULL" } ], @@ -963,7 +963,7 @@ "regionTag": "generativelanguage_v1beta_generated_ModelService_ListTunedModels_async", "title": "CacheService listTunedModels Sample", "origin": "API_DEFINITION", - "description": " Lists tuned models owned by the user.", + "description": " Lists created tuned models.", "canonical": true, "file": "model_service.list_tuned_models.js", "language": "JAVASCRIPT", @@ -1011,7 +1011,7 @@ "regionTag": "generativelanguage_v1beta_generated_ModelService_CreateTunedModel_async", "title": "CacheService createTunedModel Sample", "origin": "API_DEFINITION", - "description": " Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", + "description": " Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", "canonical": true, "file": "model_service.create_tuned_model.js", "language": "JAVASCRIPT", diff --git a/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts b/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts index 037626f7741..8409d0639d9 100644 --- a/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts @@ -394,13 +394,13 @@ export class GenerativeServiceClient { // -- Service calls -- // ------------------- /** - * Generates a response from the model given an input - * `GenerateContentRequest`. - * - * Input capabilities differ between models, including tuned models. See the - * [model guide](https://ai.google.dev/models/gemini) and - * [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for - * details. + * Generates a model response given an input `GenerateContentRequest`. + * Refer to the [text generation + * guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed + * usage information. Input capabilities differ between models, including + * tuned models. Refer to the [model + * guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning + * guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. * * @param {Object} request * The request object that will be sent. @@ -411,9 +411,10 @@ export class GenerativeServiceClient { * @param {number[]} request.contents * Required. The content of the current conversation with the model. * - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. * @param {number[]} [request.safetySettings] * Optional. A list of unique `SafetySetting` instances for blocking unsafe * content. @@ -427,7 +428,11 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. * @param {google.ai.generativelanguage.v1.GenerationConfig} [request.generationConfig] * Optional. Configuration options for model generation and outputs. * @param {object} [options] @@ -520,7 +525,9 @@ export class GenerativeServiceClient { return this.innerApiCalls.generateContent(request, options, callback); } /** - * Generates an embedding from the model given an input `Content`. + * Generates a text embedding vector from the input `Content` using the + * specified [Gemini Embedding + * model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). * * @param {Object} request * The request object that will be sent. @@ -546,8 +553,8 @@ export class GenerativeServiceClient { * @param {number} [request.outputDimensionality] * Optional. Optional reduced dimension for the output embedding. If set, * excessive values in the output embedding are truncated from the end. - * Supported by newer models since 2024, and the earlier model - * (`models/embedding-001`) cannot specify this value. + * Supported by newer models since 2024 only. You cannot set this value if + * using the earlier model (`models/embedding-001`). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -632,8 +639,9 @@ export class GenerativeServiceClient { return this.innerApiCalls.embedContent(request, options, callback); } /** - * Generates multiple embeddings from the model given input text in a - * synchronous call. + * Generates multiple embedding vectors from the input `Content` which + * consists of a batch of strings represented as `EmbedContentRequest` + * objects. * * @param {Object} request * The request object that will be sent. @@ -737,7 +745,9 @@ export class GenerativeServiceClient { return this.innerApiCalls.batchEmbedContents(request, options, callback); } /** - * Runs a model's tokenizer on input content and returns the token count. + * Runs a model's tokenizer on input `Content` and returns the token count. + * Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) + * to learn more about tokens. * * @param {Object} request * The request object that will be sent. @@ -752,8 +762,14 @@ export class GenerativeServiceClient { * Optional. The input given to the model as a prompt. This field is ignored * when `generate_content_request` is set. * @param {google.ai.generativelanguage.v1.GenerateContentRequest} [request.generateContentRequest] - * Optional. The overall input given to the model. CountTokens will count - * prompt, function calling, etc. + * Optional. The overall input given to the `Model`. This includes the prompt + * as well as other model steering information like [system + * instructions](https://ai.google.dev/gemini-api/docs/system-instructions), + * and/or function declarations for [function + * calling](https://ai.google.dev/gemini-api/docs/function-calling). + * `Model`s/`Content`s and `generate_content_request`s are mutually + * exclusive. You can either send `Model` + `Content`s or a + * `generate_content_request`, but never both. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -839,8 +855,9 @@ export class GenerativeServiceClient { } /** - * Generates a streamed response from the model given an input - * `GenerateContentRequest`. + * Generates a [streamed + * response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) + * from the model given an input `GenerateContentRequest`. * * @param {Object} request * The request object that will be sent. @@ -851,9 +868,10 @@ export class GenerativeServiceClient { * @param {number[]} request.contents * Required. The content of the current conversation with the model. * - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. * @param {number[]} [request.safetySettings] * Optional. A list of unique `SafetySetting` instances for blocking unsafe * content. @@ -867,7 +885,11 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. * @param {google.ai.generativelanguage.v1.GenerationConfig} [request.generationConfig] * Optional. Configuration options for model generation and outputs. * @param {object} [options] diff --git a/packages/google-ai-generativelanguage/src/v1/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1/model_service_client.ts index d4bbab760b4..f4ffa964640 100644 --- a/packages/google-ai-generativelanguage/src/v1/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1/model_service_client.ts @@ -377,7 +377,12 @@ export class ModelServiceClient { // -- Service calls -- // ------------------- /** - * Gets information about a specific Model. + * Gets information about a specific `Model` such as its version number, token + * limits, + * [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) + * and other metadata. Refer to the [Gemini models + * guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed + * model information. * * @param {Object} request * The request object that will be sent. @@ -472,15 +477,15 @@ export class ModelServiceClient { } /** - * Lists models available through the API. + * Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) + * available through the Gemini API. * * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize * The maximum number of `Models` to return (per page). * - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. * @param {string} request.pageToken @@ -581,8 +586,7 @@ export class ModelServiceClient { * @param {number} request.pageSize * The maximum number of `Models` to return (per page). * - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. * @param {string} request.pageToken @@ -631,8 +635,7 @@ export class ModelServiceClient { * @param {number} request.pageSize * The maximum number of `Models` to return (per page). * - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. * @param {string} request.pageToken diff --git a/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts index adc8f5c8a94..9f900b7f9c7 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts @@ -415,13 +415,13 @@ export class GenerativeServiceClient { // -- Service calls -- // ------------------- /** - * Generates a response from the model given an input - * `GenerateContentRequest`. - * - * Input capabilities differ between models, including tuned models. See the - * [model guide](https://ai.google.dev/models/gemini) and - * [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for - * details. + * Generates a model response given an input `GenerateContentRequest`. + * Refer to the [text generation + * guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed + * usage information. Input capabilities differ between models, including + * tuned models. Refer to the [model + * guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning + * guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. * * @param {Object} request * The request object that will be sent. @@ -430,23 +430,32 @@ export class GenerativeServiceClient { * * Format: `name=models/{model}`. * @param {google.ai.generativelanguage.v1beta.Content} [request.systemInstruction] - * Optional. Developer set system instruction. Currently, text only. + * Optional. Developer set [system + * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. * @param {number[]} request.contents * Required. The content of the current conversation with the model. * - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. * @param {number[]} [request.tools] - * Optional. A list of `Tools` the model may use to generate the next + * Optional. A list of `Tools` the `Model` may use to generate the next * response. * * A `Tool` is a piece of code that enables the system to interact with * external systems to perform an action, or set of actions, outside of - * knowledge and scope of the model. The only supported tool is currently - * `Function`. + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the [Function + * calling](https://ai.google.dev/gemini-api/docs/function-calling) and the + * [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. * @param {google.ai.generativelanguage.v1beta.ToolConfig} [request.toolConfig] - * Optional. Tool configuration for any `Tool` specified in the request. + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the [Function calling + * guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. * @param {number[]} [request.safetySettings] * Optional. A list of unique `SafetySetting` instances for blocking unsafe * content. @@ -460,14 +469,17 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. * @param {google.ai.generativelanguage.v1beta.GenerationConfig} [request.generationConfig] * Optional. Configuration options for model generation and outputs. * @param {string} [request.cachedContent] - * Optional. The name of the cached content used as context to serve the - * prediction. Note: only used in explicit caching, where users can have - * control over caching (e.g. what content to cache) and enjoy guaranteed cost - * savings. Format: `cachedContents/{cachedContent}` + * Optional. The name of the content + * [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. Format: `cachedContents/{cachedContent}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -574,12 +586,12 @@ export class GenerativeServiceClient { * * Format: `model=models/{model}`. * @param {number[]} request.contents - * Required. The content of the current conversation with the model. For + * Required. The content of the current conversation with the `Model`. For * single-turn queries, this is a single question to answer. For multi-turn * queries, this is a repeated field that contains conversation history and * the last `Content` in the list containing the question. * - * Note: GenerateAnswer currently only supports queries in English. + * Note: `GenerateAnswer` only supports queries in English. * @param {google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle} request.answerStyle * Required. Style in which answers should be returned. * @param {number[]} [request.safetySettings] @@ -596,6 +608,11 @@ export class GenerativeServiceClient { * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, * HARM_CATEGORY_HARASSMENT are supported. + * Refer to the + * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. * @param {number} [request.temperature] * Optional. Controls the randomness of the output. * @@ -694,7 +711,9 @@ export class GenerativeServiceClient { return this.innerApiCalls.generateAnswer(request, options, callback); } /** - * Generates an embedding from the model given an input `Content`. + * Generates a text embedding vector from the input `Content` using the + * specified [Gemini Embedding + * model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). * * @param {Object} request * The request object that will be sent. @@ -720,8 +739,8 @@ export class GenerativeServiceClient { * @param {number} [request.outputDimensionality] * Optional. Optional reduced dimension for the output embedding. If set, * excessive values in the output embedding are truncated from the end. - * Supported by newer models since 2024, and the earlier model - * (`models/embedding-001`) cannot specify this value. + * Supported by newer models since 2024 only. You cannot set this value if + * using the earlier model (`models/embedding-001`). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -812,8 +831,9 @@ export class GenerativeServiceClient { return this.innerApiCalls.embedContent(request, options, callback); } /** - * Generates multiple embeddings from the model given input text in a - * synchronous call. + * Generates multiple embedding vectors from the input `Content` which + * consists of a batch of strings represented as `EmbedContentRequest` + * objects. * * @param {Object} request * The request object that will be sent. @@ -917,7 +937,9 @@ export class GenerativeServiceClient { return this.innerApiCalls.batchEmbedContents(request, options, callback); } /** - * Runs a model's tokenizer on input content and returns the token count. + * Runs a model's tokenizer on input `Content` and returns the token count. + * Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) + * to learn more about tokens. * * @param {Object} request * The request object that will be sent. @@ -932,8 +954,14 @@ export class GenerativeServiceClient { * Optional. The input given to the model as a prompt. This field is ignored * when `generate_content_request` is set. * @param {google.ai.generativelanguage.v1beta.GenerateContentRequest} [request.generateContentRequest] - * Optional. The overall input given to the model. CountTokens will count - * prompt, function calling, etc. + * Optional. The overall input given to the `Model`. This includes the prompt + * as well as other model steering information like [system + * instructions](https://ai.google.dev/gemini-api/docs/system-instructions), + * and/or function declarations for [function + * calling](https://ai.google.dev/gemini-api/docs/function-calling). + * `Model`s/`Content`s and `generate_content_request`s are mutually + * exclusive. You can either send `Model` + `Content`s or a + * `generate_content_request`, but never both. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1025,8 +1053,9 @@ export class GenerativeServiceClient { } /** - * Generates a streamed response from the model given an input - * `GenerateContentRequest`. + * Generates a [streamed + * response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) + * from the model given an input `GenerateContentRequest`. * * @param {Object} request * The request object that will be sent. @@ -1035,23 +1064,32 @@ export class GenerativeServiceClient { * * Format: `name=models/{model}`. * @param {google.ai.generativelanguage.v1beta.Content} [request.systemInstruction] - * Optional. Developer set system instruction. Currently, text only. + * Optional. Developer set [system + * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. * @param {number[]} request.contents * Required. The content of the current conversation with the model. * - * For single-turn queries, this is a single instance. For multi-turn queries, - * this is a repeated field that contains conversation history + latest - * request. + * For single-turn queries, this is a single instance. For multi-turn queries + * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. * @param {number[]} [request.tools] - * Optional. A list of `Tools` the model may use to generate the next + * Optional. A list of `Tools` the `Model` may use to generate the next * response. * * A `Tool` is a piece of code that enables the system to interact with * external systems to perform an action, or set of actions, outside of - * knowledge and scope of the model. The only supported tool is currently - * `Function`. + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the [Function + * calling](https://ai.google.dev/gemini-api/docs/function-calling) and the + * [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. * @param {google.ai.generativelanguage.v1beta.ToolConfig} [request.toolConfig] - * Optional. Tool configuration for any `Tool` specified in the request. + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the [Function calling + * guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. * @param {number[]} [request.safetySettings] * Optional. A list of unique `SafetySetting` instances for blocking unsafe * content. @@ -1065,14 +1103,17 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. + * HARM_CATEGORY_HARASSMENT are supported. Refer to the + * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. * @param {google.ai.generativelanguage.v1beta.GenerationConfig} [request.generationConfig] * Optional. Configuration options for model generation and outputs. * @param {string} [request.cachedContent] - * Optional. The name of the cached content used as context to serve the - * prediction. Note: only used in explicit caching, where users can have - * control over caching (e.g. what content to cache) and enjoy guaranteed cost - * savings. Format: `cachedContents/{cachedContent}` + * Optional. The name of the content + * [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. Format: `cachedContents/{cachedContent}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} diff --git a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts index 9de69ffaafc..3591bde3366 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts @@ -447,7 +447,12 @@ export class ModelServiceClient { // -- Service calls -- // ------------------- /** - * Gets information about a specific Model. + * Gets information about a specific `Model` such as its version number, token + * limits, + * [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) + * and other metadata. Refer to the [Gemini models + * guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed + * model information. * * @param {Object} request * The request object that will be sent. @@ -836,10 +841,10 @@ export class ModelServiceClient { /** * Creates a tuned model. - * Intermediate tuning progress (if any) is accessed through the + * Check intermediate tuning progress (if any) through the * [google.longrunning.Operations] service. * - * Status and results can be accessed through the Operations service. + * Access status and results through the Operations service. * Example: * GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 * @@ -849,7 +854,7 @@ export class ModelServiceClient { * Optional. The unique id for the tuned model if specified. * This value should be up to 40 characters, the first character must be a * letter, the last could be a letter or a number. The id must match the - * regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?. + * regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`. * @param {google.ai.generativelanguage.v1beta.TunedModel} request.tunedModel * Required. The tuned model to create. * @param {object} [options] @@ -978,15 +983,15 @@ export class ModelServiceClient { >; } /** - * Lists models available through the API. + * Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) + * available through the Gemini API. * * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize * The maximum number of `Models` to return (per page). * - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. * @param {string} request.pageToken @@ -1087,8 +1092,7 @@ export class ModelServiceClient { * @param {number} request.pageSize * The maximum number of `Models` to return (per page). * - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. * @param {string} request.pageToken @@ -1137,8 +1141,7 @@ export class ModelServiceClient { * @param {number} request.pageSize * The maximum number of `Models` to return (per page). * - * The service may return fewer models. - * If unspecified, at most 50 models will be returned per page. + * If unspecified, 50 models will be returned per page. * This method returns at most 1000 models per page, even if you pass a larger * page_size. * @param {string} request.pageToken @@ -1179,7 +1182,7 @@ export class ModelServiceClient { ) as AsyncIterable; } /** - * Lists tuned models owned by the user. + * Lists created tuned models. * * @param {Object} request * The request object that will be sent. From 11554e0847734bff0b1c68007fd5227ae2008b87 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:04:23 -0700 Subject: [PATCH 08/16] feat: [alloydb] support for enabling outbound public IP on an instance (#5638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support for enabling outbound public IP on an instance feat: support for getting outbound public IP addresses of an instance feat: support for setting maintenance update policy on a cluster feat: support for getting maintenance schedule of a cluster PiperOrigin-RevId: 667707701 Source-Link: https://github.com/googleapis/googleapis/commit/a1185ce21454c5e5dbcf56098bb430d7f209633b Source-Link: https://github.com/googleapis/googleapis-gen/commit/6ca9eb3a69c2c33fca86b8f4150aba846924f9cb Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6IjZjYTllYjNhNjljMmMzM2ZjYTg2YjhmNDE1MGFiYTg0NjkyNGY5Y2IifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../cloud/alloydb/v1beta/resources.proto | 56 +- .../google-cloud-alloydb/protos/protos.d.ts | 324 +++++++ .../google-cloud-alloydb/protos/protos.js | 837 +++++++++++++++++- .../google-cloud-alloydb/protos/protos.json | 65 ++ 4 files changed, 1277 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto index d6c3927f6a5..4fee0dc94ba 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto @@ -375,6 +375,33 @@ message ContinuousBackupSource { [(google.api.field_behavior) = REQUIRED]; } +// MaintenanceUpdatePolicy defines the policy for system updates. +message MaintenanceUpdatePolicy { + // MaintenanceWindow specifies a preferred day and time for maintenance. + message MaintenanceWindow { + // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + google.type.DayOfWeek day = 1; + + // Preferred time to start the maintenance operation on the specified day. + // Maintenance will start within 1 hour of this time. + google.type.TimeOfDay start_time = 2; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; +} + +// MaintenanceSchedule stores the maintenance schedule generated from +// the MaintenanceUpdatePolicy, once a maintenance rollout is triggered, if +// MaintenanceWindow is set, and if there is no conflicting DenyPeriod. +// The schedule is cleared once the update takes place. This field cannot be +// manually changed; modify the MaintenanceUpdatePolicy instead. +message MaintenanceSchedule { + // Output only. The scheduled start time for the maintenance. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // A cluster is a collection of regional AlloyDB resources. It can include a // primary instance and one or more read pool instances. // All cluster resources share a storage layer, which scales as needed. @@ -391,7 +418,7 @@ message Cluster { // resources are created and from which they are accessible via Private IP. // The network must belong to the same project as the cluster. It is // specified in the form: - // "projects/{project_number}/global/networks/{network_id}". This is + // `projects/{project_number}/global/networks/{network_id}`. This is // required to create a cluster. string network = 1 [ (google.api.field_behavior) = OPTIONAL, @@ -543,7 +570,7 @@ message Cluster { // Required. The resource link for the VPC network in which cluster resources // are created and from which they are accessible via Private IP. The network // must belong to the same project as the cluster. It is specified in the - // form: "projects/{project}/global/networks/{network_id}". This is required + // form: `projects/{project}/global/networks/{network_id}`. This is required // to create a cluster. Deprecated, use network_config.network instead. string network = 10 [ deprecated = true, @@ -610,6 +637,16 @@ message Cluster { // Output only. Reserved for future use. bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The maintenance update policy determines when to allow or deny + // updates. + MaintenanceUpdatePolicy maintenance_update_policy = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The maintenance schedule for the cluster, generated for a + // specific rollout if a maintenance window is set. + MaintenanceSchedule maintenance_schedule = 37 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // An Instance is a computing unit that an end customer can connect to. @@ -773,6 +810,10 @@ message Instance { // Optional. Enabling public ip for the instance. bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling an outbound public IP address to support a database + // server sending requests out into the internet. + bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; } // Instance State @@ -945,7 +986,10 @@ message Instance { // Output only. The public IP addresses for the Instance. This is available // ONLY when enable_public_ip is set. This is the connection endpoint for an // end-user application. - string public_ip_address = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; + string public_ip_address = 27 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; // Output only. Reconciling (https://google.aip.dev/128#reconciliation). // Set to true if the current state of Instance does not match the user's @@ -983,6 +1027,12 @@ message Instance { // Optional. Instance level network configuration. InstanceNetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. All outbound public IP addresses configured for the instance. + repeated string outbound_public_ip_addresses = 34 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; } // ConnectionInfo singleton resource. diff --git a/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index 7b7469ae243..293dc297929 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -21008,6 +21008,306 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MaintenanceUpdatePolicy. */ + interface IMaintenanceUpdatePolicy { + + /** MaintenanceUpdatePolicy maintenanceWindows */ + maintenanceWindows?: (google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); + } + + /** Represents a MaintenanceUpdatePolicy. */ + class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy); + + /** MaintenanceUpdatePolicy maintenanceWindows. */ + public maintenanceWindows: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow[]; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceUpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceUpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @param message MaintenanceUpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MaintenanceUpdatePolicy { + + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { + + /** MaintenanceWindow day */ + day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** MaintenanceWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { + + /** + * Constructs a new MaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow); + + /** MaintenanceWindow day. */ + public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** MaintenanceWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceWindow instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Verifies a MaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { + + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MaintenanceSchedule. */ + class MaintenanceSchedule implements IMaintenanceSchedule { + + /** + * Constructs a new MaintenanceSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IMaintenanceSchedule); + + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IMaintenanceSchedule): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Verifies a MaintenanceSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @param message MaintenanceSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Cluster. */ interface ICluster { @@ -21091,6 +21391,12 @@ export namespace google { /** Cluster satisfiesPzs */ satisfiesPzs?: (boolean|null); + + /** Cluster maintenanceUpdatePolicy */ + maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); } /** Represents a Cluster. */ @@ -21183,6 +21489,12 @@ export namespace google { /** Cluster satisfiesPzs. */ public satisfiesPzs: boolean; + /** Cluster maintenanceUpdatePolicy. */ + public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); + /** Cluster source. */ public source?: ("backupSource"|"migrationSource"); @@ -21668,6 +21980,9 @@ export namespace google { /** Instance networkConfig */ networkConfig?: (google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null); + + /** Instance outboundPublicIpAddresses */ + outboundPublicIpAddresses?: (string[]|null); } /** Represents an Instance. */ @@ -21760,6 +22075,9 @@ export namespace google { /** Instance networkConfig. */ public networkConfig?: (google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null); + /** Instance outboundPublicIpAddresses. */ + public outboundPublicIpAddresses: string[]; + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -22721,6 +23039,9 @@ export namespace google { /** InstanceNetworkConfig enablePublicIp */ enablePublicIp?: (boolean|null); + + /** InstanceNetworkConfig enableOutboundPublicIp */ + enableOutboundPublicIp?: (boolean|null); } /** Represents an InstanceNetworkConfig. */ @@ -22738,6 +23059,9 @@ export namespace google { /** InstanceNetworkConfig enablePublicIp. */ public enablePublicIp: boolean; + /** InstanceNetworkConfig enableOutboundPublicIp. */ + public enableOutboundPublicIp: boolean; + /** * Creates a new InstanceNetworkConfig instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index 48e7be1a45f..dba34735200 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -53087,6 +53087,719 @@ return ContinuousBackupSource; })(); + v1beta.MaintenanceUpdatePolicy = (function() { + + /** + * Properties of a MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1beta + * @interface IMaintenanceUpdatePolicy + * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows + */ + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a MaintenanceUpdatePolicy. + * @implements IMaintenanceUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy=} [properties] Properties to set + */ + function MaintenanceUpdatePolicy(properties) { + this.maintenanceWindows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceUpdatePolicy maintenanceWindows. + * @member {Array.} maintenanceWindows + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance + */ + MaintenanceUpdatePolicy.create = function create(properties) { + return new MaintenanceUpdatePolicy(properties); + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maintenanceWindows != null && message.maintenanceWindows.length) + for (var i = 0; i < message.maintenanceWindows.length; ++i) + $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.maintenanceWindows && message.maintenanceWindows.length)) + message.maintenanceWindows = []; + message.maintenanceWindows.push($root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceUpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { + if (!Array.isArray(message.maintenanceWindows)) + return "maintenanceWindows: array expected"; + for (var i = 0; i < message.maintenanceWindows.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); + if (error) + return "maintenanceWindows." + error; + } + } + return null; + }; + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + */ + MaintenanceUpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy(); + if (object.maintenanceWindows) { + if (!Array.isArray(object.maintenanceWindows)) + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); + message.maintenanceWindows = []; + for (var i = 0; i < object.maintenanceWindows.length; ++i) { + if (typeof object.maintenanceWindows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); + message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceUpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.maintenanceWindows = []; + if (message.maintenanceWindows && message.maintenanceWindows.length) { + object.maintenanceWindows = []; + for (var j = 0; j < message.maintenanceWindows.length; ++j) + object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); + } + return object; + }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy"; + }; + + MaintenanceUpdatePolicy.MaintenanceWindow = (function() { + + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @interface IMaintenanceWindow + * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day + * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime + */ + + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.day = 0; + + /** + * MaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.day = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.day != null && message.hasOwnProperty("day")) + switch (message.day) { + default: + return "day: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.day = 0; + break; + case "MONDAY": + case 1: + message.day = 1; + break; + case "TUESDAY": + case 2: + message.day = 2; + break; + case "WEDNESDAY": + case 3: + message.day = 3; + break; + case "THURSDAY": + case 4: + message.day = 4; + break; + case "FRIDAY": + case 5: + message.day = 5; + break; + case "SATURDAY": + case 6: + message.day = 6; + break; + case "SUNDAY": + case 7: + message.day = 7; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.day != null && message.hasOwnProperty("day")) + object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + return MaintenanceUpdatePolicy; + })(); + + v1beta.MaintenanceSchedule = (function() { + + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1beta + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + */ + + /** + * Constructs a new MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule=} [properties] Properties to set + */ + function MaintenanceSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceSchedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceSchedule} message MaintenanceSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTime = null; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceSchedule"; + }; + + return MaintenanceSchedule; + })(); + v1beta.Cluster = (function() { /** @@ -53120,6 +53833,8 @@ * @property {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig * @property {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs + * @property {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy + * @property {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule */ /** @@ -53355,6 +54070,22 @@ */ Cluster.prototype.satisfiesPzs = false; + /** + * Cluster maintenanceUpdatePolicy. + * @member {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.maintenanceUpdatePolicy = null; + + /** + * Cluster maintenanceSchedule. + * @member {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.maintenanceSchedule = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -53449,6 +54180,10 @@ $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); + if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) + $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); return writer; }; @@ -53629,6 +54364,14 @@ message.satisfiesPzs = reader.bool(); break; } + case 32: { + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); + break; + } + case 37: { + message.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -53820,6 +54563,16 @@ if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) if (typeof message.satisfiesPzs !== "boolean") return "satisfiesPzs: boolean expected"; + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); + if (error) + return "maintenanceUpdatePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } return null; }; @@ -54030,6 +54783,16 @@ } if (object.satisfiesPzs != null) message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.maintenanceUpdatePolicy != null) { + if (typeof object.maintenanceUpdatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.maintenanceUpdatePolicy: object expected"); + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } return message; }; @@ -54074,6 +54837,8 @@ object.continuousBackupInfo = null; object.networkConfig = null; object.satisfiesPzs = false; + object.maintenanceUpdatePolicy = null; + object.maintenanceSchedule = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -54142,6 +54907,10 @@ object.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.toObject(message.networkConfig, options); if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) object.satisfiesPzs = message.satisfiesPzs; + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) + object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); return object; }; @@ -54902,6 +55671,7 @@ * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs * @property {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig * @property {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig + * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses */ /** @@ -54917,6 +55687,7 @@ this.databaseFlags = {}; this.nodes = []; this.annotations = {}; + this.outboundPublicIpAddresses = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55139,6 +55910,14 @@ */ Instance.prototype.networkConfig = null; + /** + * Instance outboundPublicIpAddresses. + * @member {Array.} outboundPublicIpAddresses + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -55221,6 +56000,9 @@ $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); return writer; }; @@ -55422,6 +56204,12 @@ message.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); break; } + case 34: { + if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) + message.outboundPublicIpAddresses = []; + message.outboundPublicIpAddresses.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -55606,6 +56394,13 @@ if (error) return "networkConfig." + error; } + if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { + if (!Array.isArray(message.outboundPublicIpAddresses)) + return "outboundPublicIpAddresses: array expected"; + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + if (!$util.isString(message.outboundPublicIpAddresses[i])) + return "outboundPublicIpAddresses: string[] expected"; + } return null; }; @@ -55813,6 +56608,13 @@ throw TypeError(".google.cloud.alloydb.v1beta.Instance.networkConfig: object expected"); message.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); } + if (object.outboundPublicIpAddresses) { + if (!Array.isArray(object.outboundPublicIpAddresses)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.outboundPublicIpAddresses: array expected"); + message.outboundPublicIpAddresses = []; + for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) + message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); + } return message; }; @@ -55829,8 +56631,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.nodes = []; + object.outboundPublicIpAddresses = []; + } if (options.objects || options.defaults) { object.labels = {}; object.databaseFlags = {}; @@ -55928,6 +56732,11 @@ object.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) object.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); + if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { + object.outboundPublicIpAddresses = []; + for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) + object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; + } return object; }; @@ -58073,6 +58882,7 @@ * @interface IInstanceNetworkConfig * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp + * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp */ /** @@ -58107,6 +58917,14 @@ */ InstanceNetworkConfig.prototype.enablePublicIp = false; + /** + * InstanceNetworkConfig enableOutboundPublicIp. + * @member {boolean} enableOutboundPublicIp + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; + /** * Creates a new InstanceNetworkConfig instance using the specified properties. * @function create @@ -58136,6 +58954,8 @@ $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); + if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); return writer; }; @@ -58180,6 +59000,10 @@ message.enablePublicIp = reader.bool(); break; } + case 3: { + message.enableOutboundPublicIp = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -58227,6 +59051,9 @@ if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) if (typeof message.enablePublicIp !== "boolean") return "enablePublicIp: boolean expected"; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + if (typeof message.enableOutboundPublicIp !== "boolean") + return "enableOutboundPublicIp: boolean expected"; return null; }; @@ -58254,6 +59081,8 @@ } if (object.enablePublicIp != null) message.enablePublicIp = Boolean(object.enablePublicIp); + if (object.enableOutboundPublicIp != null) + message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); return message; }; @@ -58272,8 +59101,10 @@ var object = {}; if (options.arrays || options.defaults) object.authorizedExternalNetworks = []; - if (options.defaults) + if (options.defaults) { object.enablePublicIp = false; + object.enableOutboundPublicIp = false; + } if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { object.authorizedExternalNetworks = []; for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) @@ -58281,6 +59112,8 @@ } if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) object.enablePublicIp = message.enablePublicIp; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + object.enableOutboundPublicIp = message.enableOutboundPublicIp; return object; }; diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index d5d54f6b7f7..ac730b97a32 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -7074,6 +7074,40 @@ } } }, + "MaintenanceUpdatePolicy": { + "fields": { + "maintenanceWindows": { + "rule": "repeated", + "type": "MaintenanceWindow", + "id": 1 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + } + } + }, + "MaintenanceSchedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "Cluster": { "options": { "(google.api.resource).type": "alloydb.googleapis.com/Cluster", @@ -7263,6 +7297,20 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "maintenanceUpdatePolicy": { + "type": "MaintenanceUpdatePolicy", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -7444,6 +7492,7 @@ "type": "string", "id": 27, "options": { + "(google.api.field_info).format": "IPV4", "(google.api.field_behavior)": "OUTPUT_ONLY" } }, @@ -7494,6 +7543,15 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "outboundPublicIpAddresses": { + "rule": "repeated", + "type": "string", + "id": 34, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -7693,6 +7751,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "enableOutboundPublicIp": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { From 8d709aee8e89ae993bd43f8c0c3d74d5d6c6c9a0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 28 Aug 2024 20:10:20 +0200 Subject: [PATCH 09/16] chore(deps): update dependency gapic-tools to v0.4.5 (#5643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [gapic-tools](https://togithub.com/googleapis/gax-nodejs) ([source](https://togithub.com/googleapis/gax-nodejs/tree/HEAD/gapic-tools)) | [`0.4.4` -> `0.4.5`](https://renovatebot.com/diffs/npm/gapic-tools/0.4.4/0.4.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/gapic-tools/0.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/gapic-tools/0.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/gapic-tools/0.4.4/0.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/gapic-tools/0.4.4/0.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/gax-nodejs (gapic-tools) ### [`v0.4.5`](https://togithub.com/googleapis/gax-nodejs/releases/tag/gapic-tools-v0.4.5): gapic-tools: v0.4.5 [Compare Source](https://togithub.com/googleapis/gax-nodejs/compare/gapic-tools-v0.4.4...gapic-tools-v0.4.5) ##### Bug Fixes - **deps:** update dependency protobufjs-cli to v1.1.3 ([#​1645](https://togithub.com/googleapis/gax-nodejs/issues/1645)) ([1b2ffdf](https://togithub.com/googleapis/gax-nodejs/commit/1b2ffdfdf2a2eed08c81b1b1be6943424fd15258))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/google-cloud-node). --- .../google-cloud-commerce-consumer-procurement/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-commerce-consumer-procurement/package.json b/packages/google-cloud-commerce-consumer-procurement/package.json index 308afb4e59c..6b84b3e0b77 100644 --- a/packages/google-cloud-commerce-consumer-procurement/package.json +++ b/packages/google-cloud-commerce-consumer-procurement/package.json @@ -53,7 +53,7 @@ "@types/sinon": "^17.0.0", "c8": "^9.0.0", "gts": "^5.0.0", - "gapic-tools": "0.4.4", + "gapic-tools": "0.4.5", "jsdoc": "^4.0.0", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", From 4fe0674834f7bce5e845017efae304dd0c8ef862 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:25:54 -0700 Subject: [PATCH 10/16] feat: [recaptchaenterprise] add AssessmentEnvironment for CreateAssessement to explicitly describe the environment of the assessment (#5639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add AssessmentEnvironment for CreateAssessement to explicitly describe the environment of the assessment PiperOrigin-RevId: 668000366 Source-Link: https://github.com/googleapis/googleapis/commit/14d1fe2996a0237d2be8de0e26b507760dba8ce4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a53bb74c0a311860c70318509db1767dfeb5e580 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6ImE1M2JiNzRjMGEzMTE4NjBjNzAzMTg1MDlkYjE3NjdkZmViNWU1ODAifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../v1/recaptchaenterprise.proto | 22 ++ .../protos/protos.d.ts | 109 ++++++++ .../protos/protos.js | 255 ++++++++++++++++++ .../protos/protos.json | 25 ++ 4 files changed, 411 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 11320f5311c..45c1523edfd 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -667,6 +667,12 @@ message Assessment { // protection need to be enabled. PhoneFraudAssessment phone_fraud_assessment = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The environment creating the assessment. This describes your + // environment (the system invoking CreateAssessment), NOT the environment of + // your user. + AssessmentEnvironment assessment_environment = 14 + [(google.api.field_behavior) = OPTIONAL]; } // The event being assessed. @@ -2046,6 +2052,22 @@ message WafSettings { WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED]; } +// The environment creating the assessment. This describes your environment +// (the system invoking CreateAssessment), NOT the environment of your user. +message AssessmentEnvironment { + // Optional. Identifies the client module initiating the CreateAssessment + // request. This can be the link to the client module's project. Examples + // include: + // - "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" + // - "cloud.google.com/recaptcha/docs/implement-waf-akamai" + // - "cloud.google.com/recaptcha/docs/implement-waf-cloudflare" + // - "wordpress.org/plugins/recaptcha-something" + string client = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The version of the client module. For example, "1.0.0". + string version = 2 [(google.api.field_behavior) = OPTIONAL]; +} + // Information about the IP or IP range override. message IpOverrideData { // Enum that represents the type of IP override. diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index c287c5d182c..4a8cc156c97 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -1363,6 +1363,9 @@ export namespace google { /** Assessment phoneFraudAssessment */ phoneFraudAssessment?: (google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null); + + /** Assessment assessmentEnvironment */ + assessmentEnvironment?: (google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment|null); } /** Represents an Assessment. */ @@ -1407,6 +1410,9 @@ export namespace google { /** Assessment phoneFraudAssessment. */ public phoneFraudAssessment?: (google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null); + /** Assessment assessmentEnvironment. */ + public assessmentEnvironment?: (google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -9030,6 +9036,109 @@ export namespace google { } } + /** Properties of an AssessmentEnvironment. */ + interface IAssessmentEnvironment { + + /** AssessmentEnvironment client */ + client?: (string|null); + + /** AssessmentEnvironment version */ + version?: (string|null); + } + + /** Represents an AssessmentEnvironment. */ + class AssessmentEnvironment implements IAssessmentEnvironment { + + /** + * Constructs a new AssessmentEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment); + + /** AssessmentEnvironment client. */ + public client: string; + + /** AssessmentEnvironment version. */ + public version: string; + + /** + * Creates a new AssessmentEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessmentEnvironment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment): google.cloud.recaptchaenterprise.v1.AssessmentEnvironment; + + /** + * Encodes the specified AssessmentEnvironment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.verify|verify} messages. + * @param message AssessmentEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssessmentEnvironment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.verify|verify} messages. + * @param message AssessmentEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessmentEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssessmentEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AssessmentEnvironment; + + /** + * Decodes an AssessmentEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssessmentEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AssessmentEnvironment; + + /** + * Verifies an AssessmentEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssessmentEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssessmentEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AssessmentEnvironment; + + /** + * Creates a plain object from an AssessmentEnvironment message. Also converts values to other types if specified. + * @param message AssessmentEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AssessmentEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssessmentEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssessmentEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an IpOverrideData. */ interface IIpOverrideData { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 631e1b84814..77f8b900530 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -3158,6 +3158,7 @@ * @property {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment|null} [fraudPreventionAssessment] Assessment fraudPreventionAssessment * @property {google.cloud.recaptchaenterprise.v1.IFraudSignals|null} [fraudSignals] Assessment fraudSignals * @property {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null} [phoneFraudAssessment] Assessment phoneFraudAssessment + * @property {google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment|null} [assessmentEnvironment] Assessment assessmentEnvironment */ /** @@ -3263,6 +3264,14 @@ */ Assessment.prototype.phoneFraudAssessment = null; + /** + * Assessment assessmentEnvironment. + * @member {google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment|null|undefined} assessmentEnvironment + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.assessmentEnvironment = null; + /** * Creates a new Assessment instance using the specified properties. * @function create @@ -3309,6 +3318,8 @@ $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.encode(message.phoneFraudAssessment, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.fraudSignals != null && Object.hasOwnProperty.call(message, "fraudSignals")) $root.google.cloud.recaptchaenterprise.v1.FraudSignals.encode(message.fraudSignals, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.assessmentEnvironment != null && Object.hasOwnProperty.call(message, "assessmentEnvironment")) + $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.encode(message.assessmentEnvironment, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -3387,6 +3398,10 @@ message.phoneFraudAssessment = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.decode(reader, reader.uint32()); break; } + case 14: { + message.assessmentEnvironment = $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3475,6 +3490,11 @@ if (error) return "phoneFraudAssessment." + error; } + if (message.assessmentEnvironment != null && message.hasOwnProperty("assessmentEnvironment")) { + var error = $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.verify(message.assessmentEnvironment); + if (error) + return "assessmentEnvironment." + error; + } return null; }; @@ -3542,6 +3562,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.phoneFraudAssessment: object expected"); message.phoneFraudAssessment = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.fromObject(object.phoneFraudAssessment); } + if (object.assessmentEnvironment != null) { + if (typeof object.assessmentEnvironment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.assessmentEnvironment: object expected"); + message.assessmentEnvironment = $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.fromObject(object.assessmentEnvironment); + } return message; }; @@ -3570,6 +3595,7 @@ object.fraudPreventionAssessment = null; object.phoneFraudAssessment = null; object.fraudSignals = null; + object.assessmentEnvironment = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -3593,6 +3619,8 @@ object.phoneFraudAssessment = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.toObject(message.phoneFraudAssessment, options); if (message.fraudSignals != null && message.hasOwnProperty("fraudSignals")) object.fraudSignals = $root.google.cloud.recaptchaenterprise.v1.FraudSignals.toObject(message.fraudSignals, options); + if (message.assessmentEnvironment != null && message.hasOwnProperty("assessmentEnvironment")) + object.assessmentEnvironment = $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.toObject(message.assessmentEnvironment, options); return object; }; @@ -21934,6 +21962,233 @@ return WafSettings; })(); + v1.AssessmentEnvironment = (function() { + + /** + * Properties of an AssessmentEnvironment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAssessmentEnvironment + * @property {string|null} [client] AssessmentEnvironment client + * @property {string|null} [version] AssessmentEnvironment version + */ + + /** + * Constructs a new AssessmentEnvironment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AssessmentEnvironment. + * @implements IAssessmentEnvironment + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment=} [properties] Properties to set + */ + function AssessmentEnvironment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssessmentEnvironment client. + * @member {string} client + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @instance + */ + AssessmentEnvironment.prototype.client = ""; + + /** + * AssessmentEnvironment version. + * @member {string} version + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @instance + */ + AssessmentEnvironment.prototype.version = ""; + + /** + * Creates a new AssessmentEnvironment instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AssessmentEnvironment} AssessmentEnvironment instance + */ + AssessmentEnvironment.create = function create(properties) { + return new AssessmentEnvironment(properties); + }; + + /** + * Encodes the specified AssessmentEnvironment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment} message AssessmentEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessmentEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.client); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified AssessmentEnvironment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AssessmentEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAssessmentEnvironment} message AssessmentEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessmentEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssessmentEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AssessmentEnvironment} AssessmentEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessmentEnvironment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.client = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssessmentEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AssessmentEnvironment} AssessmentEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessmentEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssessmentEnvironment message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssessmentEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates an AssessmentEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AssessmentEnvironment} AssessmentEnvironment + */ + AssessmentEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.AssessmentEnvironment(); + if (object.client != null) + message.client = String(object.client); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from an AssessmentEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {google.cloud.recaptchaenterprise.v1.AssessmentEnvironment} message AssessmentEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssessmentEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.client = ""; + object.version = ""; + } + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this AssessmentEnvironment to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @instance + * @returns {Object.} JSON object + */ + AssessmentEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssessmentEnvironment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AssessmentEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessmentEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AssessmentEnvironment"; + }; + + return AssessmentEnvironment; + })(); + v1.IpOverrideData = (function() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 2a3441b7aba..c7853a1bdf1 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -767,6 +767,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "assessmentEnvironment": { + "type": "AssessmentEnvironment", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -2484,6 +2491,24 @@ } } }, + "AssessmentEnvironment": { + "fields": { + "client": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "version": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "IpOverrideData": { "fields": { "ip": { From b03f419cab2ebf8385d2df7bf018863e63295624 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:26:51 -0700 Subject: [PATCH 11/16] feat: [container] add `EXTENDED` enum value for `ReleaseChannel.Channel` (#5641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add ReleaseChannel EXTENDED value PiperOrigin-RevId: 668105133 Source-Link: https://github.com/googleapis/googleapis/commit/0e9edd7617044f88b9667f9783729cd8e8b528e5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ec9af8f4fb10c8f89a2bcb36345fda2b3ef3675d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiZWM5YWY4ZjRmYjEwYzhmODlhMmJjYjM2MzQ1ZmRhMmIzZWYzNjc1ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add `EXTENDED` enum value for `ReleaseChannel.Channel` PiperOrigin-RevId: 668474656 Source-Link: https://github.com/googleapis/googleapis/commit/b1a9e6c1b07dcdc809b8b3ba2ceebf9c5c03f475 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c0109f32a0f9b9ce300566b3a7dd3b31b0c8cf82 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiYzAxMDlmMzJhMGY5YjljZTMwMDU2NmIzYTdkZDNiMzFiMGM4Y2Y4MiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../google/container/v1/cluster_service.proto | 4 ++++ .../container/v1beta1/cluster_service.proto | 4 ++++ packages/google-container/protos/protos.d.ts | 6 +++-- packages/google-container/protos/protos.js | 24 +++++++++++++++++++ packages/google-container/protos/protos.json | 6 +++-- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/packages/google-container/protos/google/container/v1/cluster_service.proto b/packages/google-container/protos/google/container/v1/cluster_service.proto index fe9b2daec23..ba8730d3d57 100644 --- a/packages/google-container/protos/google/container/v1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1/cluster_service.proto @@ -4752,6 +4752,10 @@ message ReleaseChannel { // Clusters subscribed to STABLE receive versions that are known to be // stable and reliable in production. STABLE = 3; + + // Clusters subscribed to EXTENDED receive extended support and availability + // for versions which are known to be stable and reliable in production. + EXTENDED = 4; } // channel specifies which release channel the cluster is subscribed to. diff --git a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto index f5dec1e43ec..5db56b0c13c 100644 --- a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto @@ -5728,6 +5728,10 @@ message ReleaseChannel { // Clusters subscribed to STABLE receive versions that are known to be // stable and reliable in production. STABLE = 3; + + // Clusters subscribed to EXTENDED receive extended support and availability + // for versions which are known to be stable and reliable in production. + EXTENDED = 4; } // channel specifies which release channel the cluster is subscribed to. diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index 1f0ea01b3de..7febc877131 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -17773,7 +17773,8 @@ export namespace google { UNSPECIFIED = 0, RAPID = 1, REGULAR = 2, - STABLE = 3 + STABLE = 3, + EXTENDED = 4 } } @@ -45578,7 +45579,8 @@ export namespace google { UNSPECIFIED = 0, RAPID = 1, REGULAR = 2, - STABLE = 3 + STABLE = 3, + EXTENDED = 4 } } diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index 9a25c3a692b..79f3498c277 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -29803,6 +29803,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.defaultVersion != null && message.hasOwnProperty("defaultVersion")) @@ -29853,6 +29854,10 @@ case 3: message.channel = 3; break; + case "EXTENDED": + case 4: + message.channel = 4; + break; } if (object.defaultVersion != null) message.defaultVersion = String(object.defaultVersion); @@ -46307,6 +46312,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -46347,6 +46353,10 @@ case 3: message.channel = 3; break; + case "EXTENDED": + case 4: + message.channel = 4; + break; } return message; }; @@ -46405,6 +46415,7 @@ * @property {number} RAPID=1 RAPID value * @property {number} REGULAR=2 REGULAR value * @property {number} STABLE=3 STABLE value + * @property {number} EXTENDED=4 EXTENDED value */ ReleaseChannel.Channel = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -46412,6 +46423,7 @@ values[valuesById[1] = "RAPID"] = 1; values[valuesById[2] = "REGULAR"] = 2; values[valuesById[3] = "STABLE"] = 3; + values[valuesById[4] = "EXTENDED"] = 4; return values; })(); @@ -92744,6 +92756,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.defaultVersion != null && message.hasOwnProperty("defaultVersion")) @@ -92803,6 +92816,10 @@ case 3: message.channel = 3; break; + case "EXTENDED": + case 4: + message.channel = 4; + break; } if (object.defaultVersion != null) message.defaultVersion = String(object.defaultVersion); @@ -116647,6 +116664,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -116687,6 +116705,10 @@ case 3: message.channel = 3; break; + case "EXTENDED": + case 4: + message.channel = 4; + break; } return message; }; @@ -116745,6 +116767,7 @@ * @property {number} RAPID=1 RAPID value * @property {number} REGULAR=2 REGULAR value * @property {number} STABLE=3 STABLE value + * @property {number} EXTENDED=4 EXTENDED value */ ReleaseChannel.Channel = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -116752,6 +116775,7 @@ values[valuesById[1] = "RAPID"] = 1; values[valuesById[2] = "REGULAR"] = 2; values[valuesById[3] = "STABLE"] = 3; + values[valuesById[4] = "EXTENDED"] = 4; return values; })(); diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index 459c53c2b1c..9c2c9ef0e07 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -5439,7 +5439,8 @@ "UNSPECIFIED": 0, "RAPID": 1, "REGULAR": 2, - "STABLE": 3 + "STABLE": 3, + "EXTENDED": 4 } } } @@ -12737,7 +12738,8 @@ "UNSPECIFIED": 0, "RAPID": 1, "REGULAR": 2, - "STABLE": 3 + "STABLE": 3, + "EXTENDED": 4 } } } From c03e3a5ce9740b70c9e9cf67ef98464d14052f84 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:41:39 -0700 Subject: [PATCH 12/16] feat: [gkeconnect] removed the nonfunctional GatewayService and replaced it with the GatewayControl service (#5632) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: removed the nonfunctional GatewayService and replaced it with the GatewayControl service BREAKING CHANGE: existing client libraries are being regenerated to remove unused functionality and introduce new features. PiperOrigin-RevId: 665485495 Source-Link: https://github.com/googleapis/googleapis/commit/5e76753c1855b907a7c452cdfe90921cbcc305c3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/565ebdf8b33ceeaaed972e0d9fbe4aa063e5292e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZWNvbm5lY3QtZ2F0ZXdheS8uT3dsQm90LnlhbWwiLCJoIjoiNTY1ZWJkZjhiMzNjZWVhYWVkOTcyZTBkOWZiZTRhYTA2M2U1MjkyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat!: removed the nonfunctional GatewayService and replaced it with the GatewayControl service BREAKING CHANGE: existing client libraries are being regenerated to remove unused functionality and introduce new features. PiperOrigin-RevId: 665564055 Source-Link: https://github.com/googleapis/googleapis/commit/71434fd174dbdf4714e82801501cd78db4897473 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3fcf6a6943a930cba9090f8b88a6caf71c8fb694 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZWNvbm5lY3QtZ2F0ZXdheS8uT3dsQm90LnlhbWwiLCJoIjoiM2ZjZjZhNjk0M2E5MzBjYmE5MDkwZjhiODhhNmNhZjcxYzhmYjY5NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * removing test for deprecated service * update quickstart to use new service * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Sofia Leon Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../google-cloud-gkeconnect-gateway/README.md | 6 +- .../cloud/gkeconnect/gateway/v1/control.proto | 95 ++ .../gkeconnect/gateway/v1beta1/control.proto | 95 ++ .../protos/protos.d.ts | 576 +++++++ .../protos/protos.js | 1407 +++++++++++++++++ .../protos/protos.json | 194 +++ .../samples/README.md | 36 + .../gateway_control.generate_credentials.js | 85 + ...ta_google.cloud.gkeconnect.gateway.v1.json | 71 + .../gateway_control.generate_credentials.js | 85 + ...ogle.cloud.gkeconnect.gateway.v1beta1.json | 226 +-- .../samples/quickstart.js | 4 +- .../src/index.ts | 9 +- .../src/v1/gapic_metadata.json | 33 + .../src/v1/gateway_control_client.ts | 491 ++++++ .../src/v1/gateway_control_client_config.json | 43 + .../src/v1/gateway_control_proto_list.json | 3 + .../src/v1/index.ts | 19 + .../src/v1beta1/gapic_metadata.json | 54 +- .../src/v1beta1/gateway_control_client.ts | 488 ++++++ .../gateway_control_client_config.json | 43 + .../v1beta1/gateway_control_proto_list.json | 3 + .../src/v1beta1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 8 +- .../test/gapic_gateway_control_v1.ts | 378 +++++ .../test/gapic_gateway_control_v1beta1.ts | 379 +++++ .../test/gapic_gateway_service_v1beta1.ts | 608 ------- .../webpack.config.js | 4 +- 29 files changed, 4571 insertions(+), 876 deletions(-) create mode 100644 packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1/control.proto create mode 100644 packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/control.proto create mode 100644 packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js create mode 100644 packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json create mode 100644 packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client.ts create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client_config.json create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_proto_list.json create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1/index.ts create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client.ts create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client_config.json create mode 100644 packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_proto_list.json create mode 100644 packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1.ts create mode 100644 packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1beta1.ts delete mode 100644 packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts diff --git a/packages/google-cloud-gkeconnect-gateway/README.md b/packages/google-cloud-gkeconnect-gateway/README.md index 587378e411f..7a0b98d15ce 100644 --- a/packages/google-cloud-gkeconnect-gateway/README.md +++ b/packages/google-cloud-gkeconnect-gateway/README.md @@ -59,10 +59,10 @@ npm install @google-cloud/gke-connect-gateway ```javascript // Imports the Google Cloud client library -const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway'); +const {GatewayControlClient} = require('@google-cloud/gke-connect-gateway'); // Creates a client -new GatewayServiceClient(); +new GatewayControlClient(); ``` @@ -74,6 +74,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Gateway_control.generate_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js,packages/google-cloud-gkeconnect-gateway/samples/README.md) | +| Gateway_control.generate_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js,packages/google-cloud-gkeconnect-gateway/samples/README.md) | | Gateway_service.delete_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js,packages/google-cloud-gkeconnect-gateway/samples/README.md) | | Gateway_service.get_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js,packages/google-cloud-gkeconnect-gateway/samples/README.md) | | Gateway_service.patch_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js,packages/google-cloud-gkeconnect-gateway/samples/README.md) | diff --git a/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1/control.proto b/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1/control.proto new file mode 100644 index 00000000000..cef05844128 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1/control.proto @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.gkeconnect.gateway.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.GkeConnect.Gateway.V1"; +option go_package = "cloud.google.com/go/gkeconnect/gateway/apiv1/gatewaypb;gatewaypb"; +option java_multiple_files = true; +option java_outer_classname = "ControlProto"; +option java_package = "com.google.cloud.gkeconnect.gateway.v1"; +option php_namespace = "Google\\Cloud\\GkeConnect\\Gateway\\V1"; +option ruby_package = "Google::Cloud::GkeConnect::Gateway::V1"; + +// GatewayControl is the control plane API for Connect Gateway. +service GatewayControl { + option (google.api.default_host) = "connectgateway.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // GenerateCredentials provides connection information that allows a user to + // access the specified membership using Connect Gateway. + rpc GenerateCredentials(GenerateCredentialsRequest) + returns (GenerateCredentialsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + }; + } +} + +// A request for connection information for a particular membership. +message GenerateCredentialsRequest { + // Operating systems requiring specialized kubeconfigs. + enum OperatingSystem { + // Generates a kubeconfig that works for all operating systems not defined + // below. + OPERATING_SYSTEM_UNSPECIFIED = 0; + + // Generates a kubeconfig that is specifically designed to work with + // Windows. + OPERATING_SYSTEM_WINDOWS = 1; + } + + // Required. The Fleet membership resource. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether to force the use of Connect Agent-based transport. + // + // This will return a configuration that uses Connect Agent as the underlying + // transport mechanism for cluster types that would otherwise have used a + // different transport. Requires that Connect Agent be installed on the + // cluster. Setting this field to false is equivalent to not setting it. + bool force_use_agent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Connect Gateway version to be used in the resulting + // configuration. + // + // Leave this field blank to let the server choose the version (recommended). + string version = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The namespace to use in the kubeconfig context. + // + // If this field is specified, the server will set the `namespace` field in + // kubeconfig context. If not specified, the `namespace` field is omitted. + string kubernetes_namespace = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The operating system where the kubeconfig will be used. + OperatingSystem operating_system = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Connection information for a particular membership. +message GenerateCredentialsResponse { + // A full YAML kubeconfig in serialized format. + bytes kubeconfig = 1; + + // The generated URI of the cluster as accessed through the Connect Gateway + // API. + string endpoint = 2; +} diff --git a/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/control.proto b/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/control.proto new file mode 100644 index 00000000000..3458153b20b --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/control.proto @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.gkeconnect.gateway.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.GkeConnect.Gateway.V1Beta1"; +option go_package = "cloud.google.com/go/gkeconnect/gateway/apiv1beta1/gatewaypb;gatewaypb"; +option java_multiple_files = true; +option java_outer_classname = "ControlProto"; +option java_package = "com.google.cloud.gkeconnect.gateway.v1beta1"; +option php_namespace = "Google\\Cloud\\GkeConnect\\Gateway\\V1beta1"; +option ruby_package = "Google::Cloud::GkeConnect::Gateway::V1beta1"; + +// GatewayControl is the control plane API for Connect Gateway. +service GatewayControl { + option (google.api.default_host) = "connectgateway.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // GenerateCredentials provides connection information that allows a user to + // access the specified membership using Connect Gateway. + rpc GenerateCredentials(GenerateCredentialsRequest) + returns (GenerateCredentialsResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + }; + } +} + +// A request for connection information for a particular membership. +message GenerateCredentialsRequest { + // Operating systems requiring specialized kubeconfigs. + enum OperatingSystem { + // Generates a kubeconfig that works for all operating systems not defined + // below. + OPERATING_SYSTEM_UNSPECIFIED = 0; + + // Generates a kubeconfig that is specifically designed to work with + // Windows. + OPERATING_SYSTEM_WINDOWS = 1; + } + + // Required. The Fleet membership resource. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether to force the use of Connect Agent-based transport. + // + // This will return a configuration that uses Connect Agent as the underlying + // transport mechanism for cluster types that would otherwise have used a + // different transport. Requires that Connect Agent be installed on the + // cluster. Setting this field to false is equivalent to not setting it. + bool force_use_agent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Connect Gateway version to be used in the resulting + // configuration. + // + // Leave this field blank to let the server choose the version (recommended). + string version = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The namespace to use in the kubeconfig context. + // + // If this field is specified, the server will set the `namespace` field in + // kubeconfig context. If not specified, the `namespace` field is omitted. + string kubernetes_namespace = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The operating system where the kubeconfig will be used. + OperatingSystem operating_system = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Connection information for a particular membership. +message GenerateCredentialsResponse { + // A full YAML kubeconfig in serialized format. + bytes kubeconfig = 1; + + // The generated URI of the cluster as accessed through the Connect Gateway + // API. + string endpoint = 2; +} diff --git a/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts b/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts index 1e43dcbdeee..76c80bd714f 100644 --- a/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts +++ b/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts @@ -26,9 +26,569 @@ export namespace google { /** Namespace gateway. */ namespace gateway { + /** Namespace v1. */ + namespace v1 { + + /** Represents a GatewayControl */ + class GatewayControl extends $protobuf.rpc.Service { + + /** + * Constructs a new GatewayControl service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new GatewayControl service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): GatewayControl; + + /** + * Calls GenerateCredentials. + * @param request GenerateCredentialsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateCredentialsResponse + */ + public generateCredentials(request: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, callback: google.cloud.gkeconnect.gateway.v1.GatewayControl.GenerateCredentialsCallback): void; + + /** + * Calls GenerateCredentials. + * @param request GenerateCredentialsRequest message or plain object + * @returns Promise + */ + public generateCredentials(request: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest): Promise; + } + + namespace GatewayControl { + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1.GatewayControl|generateCredentials}. + * @param error Error, if any + * @param [response] GenerateCredentialsResponse + */ + type GenerateCredentialsCallback = (error: (Error|null), response?: google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse) => void; + } + + /** Properties of a GenerateCredentialsRequest. */ + interface IGenerateCredentialsRequest { + + /** GenerateCredentialsRequest name */ + name?: (string|null); + + /** GenerateCredentialsRequest forceUseAgent */ + forceUseAgent?: (boolean|null); + + /** GenerateCredentialsRequest version */ + version?: (string|null); + + /** GenerateCredentialsRequest kubernetesNamespace */ + kubernetesNamespace?: (string|null); + + /** GenerateCredentialsRequest operatingSystem */ + operatingSystem?: (google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem|keyof typeof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem|null); + } + + /** Represents a GenerateCredentialsRequest. */ + class GenerateCredentialsRequest implements IGenerateCredentialsRequest { + + /** + * Constructs a new GenerateCredentialsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest); + + /** GenerateCredentialsRequest name. */ + public name: string; + + /** GenerateCredentialsRequest forceUseAgent. */ + public forceUseAgent: boolean; + + /** GenerateCredentialsRequest version. */ + public version: string; + + /** GenerateCredentialsRequest kubernetesNamespace. */ + public kubernetesNamespace: string; + + /** GenerateCredentialsRequest operatingSystem. */ + public operatingSystem: (google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem|keyof typeof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem); + + /** + * Creates a new GenerateCredentialsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateCredentialsRequest instance + */ + public static create(properties?: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest; + + /** + * Encodes the specified GenerateCredentialsRequest message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.verify|verify} messages. + * @param message GenerateCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.verify|verify} messages. + * @param message GenerateCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest; + + /** + * Verifies a GenerateCredentialsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateCredentialsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest; + + /** + * Creates a plain object from a GenerateCredentialsRequest message. Also converts values to other types if specified. + * @param message GenerateCredentialsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateCredentialsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateCredentialsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateCredentialsRequest { + + /** OperatingSystem enum. */ + enum OperatingSystem { + OPERATING_SYSTEM_UNSPECIFIED = 0, + OPERATING_SYSTEM_WINDOWS = 1 + } + } + + /** Properties of a GenerateCredentialsResponse. */ + interface IGenerateCredentialsResponse { + + /** GenerateCredentialsResponse kubeconfig */ + kubeconfig?: (Uint8Array|string|null); + + /** GenerateCredentialsResponse endpoint */ + endpoint?: (string|null); + } + + /** Represents a GenerateCredentialsResponse. */ + class GenerateCredentialsResponse implements IGenerateCredentialsResponse { + + /** + * Constructs a new GenerateCredentialsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse); + + /** GenerateCredentialsResponse kubeconfig. */ + public kubeconfig: (Uint8Array|string); + + /** GenerateCredentialsResponse endpoint. */ + public endpoint: string; + + /** + * Creates a new GenerateCredentialsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateCredentialsResponse instance + */ + public static create(properties?: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse; + + /** + * Encodes the specified GenerateCredentialsResponse message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse.verify|verify} messages. + * @param message GenerateCredentialsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateCredentialsResponse message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse.verify|verify} messages. + * @param message GenerateCredentialsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse; + + /** + * Verifies a GenerateCredentialsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateCredentialsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateCredentialsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse; + + /** + * Creates a plain object from a GenerateCredentialsResponse message. Also converts values to other types if specified. + * @param message GenerateCredentialsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateCredentialsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateCredentialsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace v1beta1. */ namespace v1beta1 { + /** Represents a GatewayControl */ + class GatewayControl extends $protobuf.rpc.Service { + + /** + * Constructs a new GatewayControl service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new GatewayControl service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): GatewayControl; + + /** + * Calls GenerateCredentials. + * @param request GenerateCredentialsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateCredentialsResponse + */ + public generateCredentials(request: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, callback: google.cloud.gkeconnect.gateway.v1beta1.GatewayControl.GenerateCredentialsCallback): void; + + /** + * Calls GenerateCredentials. + * @param request GenerateCredentialsRequest message or plain object + * @returns Promise + */ + public generateCredentials(request: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest): Promise; + } + + namespace GatewayControl { + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayControl|generateCredentials}. + * @param error Error, if any + * @param [response] GenerateCredentialsResponse + */ + type GenerateCredentialsCallback = (error: (Error|null), response?: google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) => void; + } + + /** Properties of a GenerateCredentialsRequest. */ + interface IGenerateCredentialsRequest { + + /** GenerateCredentialsRequest name */ + name?: (string|null); + + /** GenerateCredentialsRequest forceUseAgent */ + forceUseAgent?: (boolean|null); + + /** GenerateCredentialsRequest version */ + version?: (string|null); + + /** GenerateCredentialsRequest kubernetesNamespace */ + kubernetesNamespace?: (string|null); + + /** GenerateCredentialsRequest operatingSystem */ + operatingSystem?: (google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem|keyof typeof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem|null); + } + + /** Represents a GenerateCredentialsRequest. */ + class GenerateCredentialsRequest implements IGenerateCredentialsRequest { + + /** + * Constructs a new GenerateCredentialsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest); + + /** GenerateCredentialsRequest name. */ + public name: string; + + /** GenerateCredentialsRequest forceUseAgent. */ + public forceUseAgent: boolean; + + /** GenerateCredentialsRequest version. */ + public version: string; + + /** GenerateCredentialsRequest kubernetesNamespace. */ + public kubernetesNamespace: string; + + /** GenerateCredentialsRequest operatingSystem. */ + public operatingSystem: (google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem|keyof typeof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem); + + /** + * Creates a new GenerateCredentialsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateCredentialsRequest instance + */ + public static create(properties?: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; + + /** + * Encodes the specified GenerateCredentialsRequest message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.verify|verify} messages. + * @param message GenerateCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.verify|verify} messages. + * @param message GenerateCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; + + /** + * Verifies a GenerateCredentialsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateCredentialsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; + + /** + * Creates a plain object from a GenerateCredentialsRequest message. Also converts values to other types if specified. + * @param message GenerateCredentialsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateCredentialsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateCredentialsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateCredentialsRequest { + + /** OperatingSystem enum. */ + enum OperatingSystem { + OPERATING_SYSTEM_UNSPECIFIED = 0, + OPERATING_SYSTEM_WINDOWS = 1 + } + } + + /** Properties of a GenerateCredentialsResponse. */ + interface IGenerateCredentialsResponse { + + /** GenerateCredentialsResponse kubeconfig */ + kubeconfig?: (Uint8Array|string|null); + + /** GenerateCredentialsResponse endpoint */ + endpoint?: (string|null); + } + + /** Represents a GenerateCredentialsResponse. */ + class GenerateCredentialsResponse implements IGenerateCredentialsResponse { + + /** + * Constructs a new GenerateCredentialsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse); + + /** GenerateCredentialsResponse kubeconfig. */ + public kubeconfig: (Uint8Array|string); + + /** GenerateCredentialsResponse endpoint. */ + public endpoint: string; + + /** + * Creates a new GenerateCredentialsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateCredentialsResponse instance + */ + public static create(properties?: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; + + /** + * Encodes the specified GenerateCredentialsResponse message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.verify|verify} messages. + * @param message GenerateCredentialsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateCredentialsResponse message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.verify|verify} messages. + * @param message GenerateCredentialsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; + + /** + * Verifies a GenerateCredentialsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateCredentialsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateCredentialsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; + + /** + * Creates a plain object from a GenerateCredentialsResponse message. Also converts values to other types if specified. + * @param message GenerateCredentialsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateCredentialsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateCredentialsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a GatewayService */ class GatewayService extends $protobuf.rpc.Service { @@ -2012,6 +2572,19 @@ export namespace google { DEPRECATED = 5 } + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + /** Properties of a HttpBody. */ interface IHttpBody { @@ -4282,6 +4855,9 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); } /** Represents a FieldOptions. */ diff --git a/packages/google-cloud-gkeconnect-gateway/protos/protos.js b/packages/google-cloud-gkeconnect-gateway/protos/protos.js index 58c53a936a2..f72f654f6bc 100644 --- a/packages/google-cloud-gkeconnect-gateway/protos/protos.js +++ b/packages/google-cloud-gkeconnect-gateway/protos/protos.js @@ -66,6 +66,651 @@ */ var gateway = {}; + gateway.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.gkeconnect.gateway + * @namespace + */ + var v1 = {}; + + v1.GatewayControl = (function() { + + /** + * Constructs a new GatewayControl service. + * @memberof google.cloud.gkeconnect.gateway.v1 + * @classdesc Represents a GatewayControl + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function GatewayControl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GatewayControl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GatewayControl; + + /** + * Creates new GatewayControl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1.GatewayControl + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {GatewayControl} RPC service. Useful where requests and/or responses are streamed. + */ + GatewayControl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1.GatewayControl|generateCredentials}. + * @memberof google.cloud.gkeconnect.gateway.v1.GatewayControl + * @typedef GenerateCredentialsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse} [response] GenerateCredentialsResponse + */ + + /** + * Calls GenerateCredentials. + * @function generateCredentials + * @memberof google.cloud.gkeconnect.gateway.v1.GatewayControl + * @instance + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest} request GenerateCredentialsRequest message or plain object + * @param {google.cloud.gkeconnect.gateway.v1.GatewayControl.GenerateCredentialsCallback} callback Node-style callback called with the error, if any, and GenerateCredentialsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayControl.prototype.generateCredentials = function generateCredentials(request, callback) { + return this.rpcCall(generateCredentials, $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest, $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse, request, callback); + }, "name", { value: "GenerateCredentials" }); + + /** + * Calls GenerateCredentials. + * @function generateCredentials + * @memberof google.cloud.gkeconnect.gateway.v1.GatewayControl + * @instance + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest} request GenerateCredentialsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GatewayControl; + })(); + + v1.GenerateCredentialsRequest = (function() { + + /** + * Properties of a GenerateCredentialsRequest. + * @memberof google.cloud.gkeconnect.gateway.v1 + * @interface IGenerateCredentialsRequest + * @property {string|null} [name] GenerateCredentialsRequest name + * @property {boolean|null} [forceUseAgent] GenerateCredentialsRequest forceUseAgent + * @property {string|null} [version] GenerateCredentialsRequest version + * @property {string|null} [kubernetesNamespace] GenerateCredentialsRequest kubernetesNamespace + * @property {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem|null} [operatingSystem] GenerateCredentialsRequest operatingSystem + */ + + /** + * Constructs a new GenerateCredentialsRequest. + * @memberof google.cloud.gkeconnect.gateway.v1 + * @classdesc Represents a GenerateCredentialsRequest. + * @implements IGenerateCredentialsRequest + * @constructor + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest=} [properties] Properties to set + */ + function GenerateCredentialsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateCredentialsRequest name. + * @member {string} name + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.name = ""; + + /** + * GenerateCredentialsRequest forceUseAgent. + * @member {boolean} forceUseAgent + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.forceUseAgent = false; + + /** + * GenerateCredentialsRequest version. + * @member {string} version + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.version = ""; + + /** + * GenerateCredentialsRequest kubernetesNamespace. + * @member {string} kubernetesNamespace + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.kubernetesNamespace = ""; + + /** + * GenerateCredentialsRequest operatingSystem. + * @member {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem} operatingSystem + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.operatingSystem = 0; + + /** + * Creates a new GenerateCredentialsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest} GenerateCredentialsRequest instance + */ + GenerateCredentialsRequest.create = function create(properties) { + return new GenerateCredentialsRequest(properties); + }; + + /** + * Encodes the specified GenerateCredentialsRequest message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest} message GenerateCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsRequest.encode = function encode(message, writer) { + 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.forceUseAgent != null && Object.hasOwnProperty.call(message, "forceUseAgent")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.forceUseAgent); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.kubernetesNamespace != null && Object.hasOwnProperty.call(message, "kubernetesNamespace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kubernetesNamespace); + if (message.operatingSystem != null && Object.hasOwnProperty.call(message, "operatingSystem")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operatingSystem); + return writer; + }; + + /** + * Encodes the specified GenerateCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest} message GenerateCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest} GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.forceUseAgent = reader.bool(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + case 4: { + message.kubernetesNamespace = reader.string(); + break; + } + case 5: { + message.operatingSystem = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest} GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateCredentialsRequest message. + * @function verify + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateCredentialsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.forceUseAgent != null && message.hasOwnProperty("forceUseAgent")) + if (typeof message.forceUseAgent !== "boolean") + return "forceUseAgent: boolean expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) + if (!$util.isString(message.kubernetesNamespace)) + return "kubernetesNamespace: string expected"; + if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) + switch (message.operatingSystem) { + default: + return "operatingSystem: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GenerateCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest} GenerateCredentialsRequest + */ + GenerateCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest) + return object; + var message = new $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.forceUseAgent != null) + message.forceUseAgent = Boolean(object.forceUseAgent); + if (object.version != null) + message.version = String(object.version); + if (object.kubernetesNamespace != null) + message.kubernetesNamespace = String(object.kubernetesNamespace); + switch (object.operatingSystem) { + default: + if (typeof object.operatingSystem === "number") { + message.operatingSystem = object.operatingSystem; + break; + } + break; + case "OPERATING_SYSTEM_UNSPECIFIED": + case 0: + message.operatingSystem = 0; + break; + case "OPERATING_SYSTEM_WINDOWS": + case 1: + message.operatingSystem = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GenerateCredentialsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest} message GenerateCredentialsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateCredentialsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.forceUseAgent = false; + object.version = ""; + object.kubernetesNamespace = ""; + object.operatingSystem = options.enums === String ? "OPERATING_SYSTEM_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.forceUseAgent != null && message.hasOwnProperty("forceUseAgent")) + object.forceUseAgent = message.forceUseAgent; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) + object.kubernetesNamespace = message.kubernetesNamespace; + if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) + object.operatingSystem = options.enums === String ? $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem[message.operatingSystem] === undefined ? message.operatingSystem : $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem[message.operatingSystem] : message.operatingSystem; + return object; + }; + + /** + * Converts this GenerateCredentialsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateCredentialsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateCredentialsRequest + * @function getTypeUrl + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest"; + }; + + /** + * OperatingSystem enum. + * @name google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem + * @enum {number} + * @property {number} OPERATING_SYSTEM_UNSPECIFIED=0 OPERATING_SYSTEM_UNSPECIFIED value + * @property {number} OPERATING_SYSTEM_WINDOWS=1 OPERATING_SYSTEM_WINDOWS value + */ + GenerateCredentialsRequest.OperatingSystem = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATING_SYSTEM_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPERATING_SYSTEM_WINDOWS"] = 1; + return values; + })(); + + return GenerateCredentialsRequest; + })(); + + v1.GenerateCredentialsResponse = (function() { + + /** + * Properties of a GenerateCredentialsResponse. + * @memberof google.cloud.gkeconnect.gateway.v1 + * @interface IGenerateCredentialsResponse + * @property {Uint8Array|null} [kubeconfig] GenerateCredentialsResponse kubeconfig + * @property {string|null} [endpoint] GenerateCredentialsResponse endpoint + */ + + /** + * Constructs a new GenerateCredentialsResponse. + * @memberof google.cloud.gkeconnect.gateway.v1 + * @classdesc Represents a GenerateCredentialsResponse. + * @implements IGenerateCredentialsResponse + * @constructor + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse=} [properties] Properties to set + */ + function GenerateCredentialsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateCredentialsResponse kubeconfig. + * @member {Uint8Array} kubeconfig + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @instance + */ + GenerateCredentialsResponse.prototype.kubeconfig = $util.newBuffer([]); + + /** + * GenerateCredentialsResponse endpoint. + * @member {string} endpoint + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @instance + */ + GenerateCredentialsResponse.prototype.endpoint = ""; + + /** + * Creates a new GenerateCredentialsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse=} [properties] Properties to set + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse} GenerateCredentialsResponse instance + */ + GenerateCredentialsResponse.create = function create(properties) { + return new GenerateCredentialsResponse(properties); + }; + + /** + * Encodes the specified GenerateCredentialsResponse message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse} message GenerateCredentialsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kubeconfig != null && Object.hasOwnProperty.call(message, "kubeconfig")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.kubeconfig); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpoint); + return writer; + }; + + /** + * Encodes the specified GenerateCredentialsResponse message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse} message GenerateCredentialsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse} GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kubeconfig = reader.bytes(); + break; + } + case 2: { + message.endpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse} GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateCredentialsResponse message. + * @function verify + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateCredentialsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kubeconfig != null && message.hasOwnProperty("kubeconfig")) + if (!(message.kubeconfig && typeof message.kubeconfig.length === "number" || $util.isString(message.kubeconfig))) + return "kubeconfig: buffer expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + return null; + }; + + /** + * Creates a GenerateCredentialsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse} GenerateCredentialsResponse + */ + GenerateCredentialsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse) + return object; + var message = new $root.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse(); + if (object.kubeconfig != null) + if (typeof object.kubeconfig === "string") + $util.base64.decode(object.kubeconfig, message.kubeconfig = $util.newBuffer($util.base64.length(object.kubeconfig)), 0); + else if (object.kubeconfig.length >= 0) + message.kubeconfig = object.kubeconfig; + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + return message; + }; + + /** + * Creates a plain object from a GenerateCredentialsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse} message GenerateCredentialsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateCredentialsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.kubeconfig = ""; + else { + object.kubeconfig = []; + if (options.bytes !== Array) + object.kubeconfig = $util.newBuffer(object.kubeconfig); + } + object.endpoint = ""; + } + if (message.kubeconfig != null && message.hasOwnProperty("kubeconfig")) + object.kubeconfig = options.bytes === String ? $util.base64.encode(message.kubeconfig, 0, message.kubeconfig.length) : options.bytes === Array ? Array.prototype.slice.call(message.kubeconfig) : message.kubeconfig; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + return object; + }; + + /** + * Converts this GenerateCredentialsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateCredentialsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateCredentialsResponse + * @function getTypeUrl + * @memberof google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateCredentialsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse"; + }; + + return GenerateCredentialsResponse; + })(); + + return v1; + })(); + gateway.v1beta1 = (function() { /** @@ -75,6 +720,639 @@ */ var v1beta1 = {}; + v1beta1.GatewayControl = (function() { + + /** + * Constructs a new GatewayControl service. + * @memberof google.cloud.gkeconnect.gateway.v1beta1 + * @classdesc Represents a GatewayControl + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function GatewayControl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GatewayControl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GatewayControl; + + /** + * Creates new GatewayControl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayControl + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {GatewayControl} RPC service. Useful where requests and/or responses are streamed. + */ + GatewayControl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayControl|generateCredentials}. + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayControl + * @typedef GenerateCredentialsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} [response] GenerateCredentialsResponse + */ + + /** + * Calls GenerateCredentials. + * @function generateCredentials + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayControl + * @instance + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest} request GenerateCredentialsRequest message or plain object + * @param {google.cloud.gkeconnect.gateway.v1beta1.GatewayControl.GenerateCredentialsCallback} callback Node-style callback called with the error, if any, and GenerateCredentialsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayControl.prototype.generateCredentials = function generateCredentials(request, callback) { + return this.rpcCall(generateCredentials, $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest, $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse, request, callback); + }, "name", { value: "GenerateCredentials" }); + + /** + * Calls GenerateCredentials. + * @function generateCredentials + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayControl + * @instance + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest} request GenerateCredentialsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GatewayControl; + })(); + + v1beta1.GenerateCredentialsRequest = (function() { + + /** + * Properties of a GenerateCredentialsRequest. + * @memberof google.cloud.gkeconnect.gateway.v1beta1 + * @interface IGenerateCredentialsRequest + * @property {string|null} [name] GenerateCredentialsRequest name + * @property {boolean|null} [forceUseAgent] GenerateCredentialsRequest forceUseAgent + * @property {string|null} [version] GenerateCredentialsRequest version + * @property {string|null} [kubernetesNamespace] GenerateCredentialsRequest kubernetesNamespace + * @property {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem|null} [operatingSystem] GenerateCredentialsRequest operatingSystem + */ + + /** + * Constructs a new GenerateCredentialsRequest. + * @memberof google.cloud.gkeconnect.gateway.v1beta1 + * @classdesc Represents a GenerateCredentialsRequest. + * @implements IGenerateCredentialsRequest + * @constructor + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest=} [properties] Properties to set + */ + function GenerateCredentialsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateCredentialsRequest name. + * @member {string} name + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.name = ""; + + /** + * GenerateCredentialsRequest forceUseAgent. + * @member {boolean} forceUseAgent + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.forceUseAgent = false; + + /** + * GenerateCredentialsRequest version. + * @member {string} version + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.version = ""; + + /** + * GenerateCredentialsRequest kubernetesNamespace. + * @member {string} kubernetesNamespace + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.kubernetesNamespace = ""; + + /** + * GenerateCredentialsRequest operatingSystem. + * @member {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem} operatingSystem + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @instance + */ + GenerateCredentialsRequest.prototype.operatingSystem = 0; + + /** + * Creates a new GenerateCredentialsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} GenerateCredentialsRequest instance + */ + GenerateCredentialsRequest.create = function create(properties) { + return new GenerateCredentialsRequest(properties); + }; + + /** + * Encodes the specified GenerateCredentialsRequest message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest} message GenerateCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsRequest.encode = function encode(message, writer) { + 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.forceUseAgent != null && Object.hasOwnProperty.call(message, "forceUseAgent")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.forceUseAgent); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.kubernetesNamespace != null && Object.hasOwnProperty.call(message, "kubernetesNamespace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kubernetesNamespace); + if (message.operatingSystem != null && Object.hasOwnProperty.call(message, "operatingSystem")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operatingSystem); + return writer; + }; + + /** + * Encodes the specified GenerateCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest} message GenerateCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.forceUseAgent = reader.bool(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + case 4: { + message.kubernetesNamespace = reader.string(); + break; + } + case 5: { + message.operatingSystem = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateCredentialsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} GenerateCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateCredentialsRequest message. + * @function verify + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateCredentialsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.forceUseAgent != null && message.hasOwnProperty("forceUseAgent")) + if (typeof message.forceUseAgent !== "boolean") + return "forceUseAgent: boolean expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) + if (!$util.isString(message.kubernetesNamespace)) + return "kubernetesNamespace: string expected"; + if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) + switch (message.operatingSystem) { + default: + return "operatingSystem: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GenerateCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} GenerateCredentialsRequest + */ + GenerateCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) + return object; + var message = new $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.forceUseAgent != null) + message.forceUseAgent = Boolean(object.forceUseAgent); + if (object.version != null) + message.version = String(object.version); + if (object.kubernetesNamespace != null) + message.kubernetesNamespace = String(object.kubernetesNamespace); + switch (object.operatingSystem) { + default: + if (typeof object.operatingSystem === "number") { + message.operatingSystem = object.operatingSystem; + break; + } + break; + case "OPERATING_SYSTEM_UNSPECIFIED": + case 0: + message.operatingSystem = 0; + break; + case "OPERATING_SYSTEM_WINDOWS": + case 1: + message.operatingSystem = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GenerateCredentialsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} message GenerateCredentialsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateCredentialsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.forceUseAgent = false; + object.version = ""; + object.kubernetesNamespace = ""; + object.operatingSystem = options.enums === String ? "OPERATING_SYSTEM_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.forceUseAgent != null && message.hasOwnProperty("forceUseAgent")) + object.forceUseAgent = message.forceUseAgent; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) + object.kubernetesNamespace = message.kubernetesNamespace; + if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) + object.operatingSystem = options.enums === String ? $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem[message.operatingSystem] === undefined ? message.operatingSystem : $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem[message.operatingSystem] : message.operatingSystem; + return object; + }; + + /** + * Converts this GenerateCredentialsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateCredentialsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateCredentialsRequest + * @function getTypeUrl + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest"; + }; + + /** + * OperatingSystem enum. + * @name google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + * @enum {number} + * @property {number} OPERATING_SYSTEM_UNSPECIFIED=0 OPERATING_SYSTEM_UNSPECIFIED value + * @property {number} OPERATING_SYSTEM_WINDOWS=1 OPERATING_SYSTEM_WINDOWS value + */ + GenerateCredentialsRequest.OperatingSystem = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATING_SYSTEM_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPERATING_SYSTEM_WINDOWS"] = 1; + return values; + })(); + + return GenerateCredentialsRequest; + })(); + + v1beta1.GenerateCredentialsResponse = (function() { + + /** + * Properties of a GenerateCredentialsResponse. + * @memberof google.cloud.gkeconnect.gateway.v1beta1 + * @interface IGenerateCredentialsResponse + * @property {Uint8Array|null} [kubeconfig] GenerateCredentialsResponse kubeconfig + * @property {string|null} [endpoint] GenerateCredentialsResponse endpoint + */ + + /** + * Constructs a new GenerateCredentialsResponse. + * @memberof google.cloud.gkeconnect.gateway.v1beta1 + * @classdesc Represents a GenerateCredentialsResponse. + * @implements IGenerateCredentialsResponse + * @constructor + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse=} [properties] Properties to set + */ + function GenerateCredentialsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateCredentialsResponse kubeconfig. + * @member {Uint8Array} kubeconfig + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @instance + */ + GenerateCredentialsResponse.prototype.kubeconfig = $util.newBuffer([]); + + /** + * GenerateCredentialsResponse endpoint. + * @member {string} endpoint + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @instance + */ + GenerateCredentialsResponse.prototype.endpoint = ""; + + /** + * Creates a new GenerateCredentialsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse=} [properties] Properties to set + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} GenerateCredentialsResponse instance + */ + GenerateCredentialsResponse.create = function create(properties) { + return new GenerateCredentialsResponse(properties); + }; + + /** + * Encodes the specified GenerateCredentialsResponse message. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse} message GenerateCredentialsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kubeconfig != null && Object.hasOwnProperty.call(message, "kubeconfig")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.kubeconfig); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpoint); + return writer; + }; + + /** + * Encodes the specified GenerateCredentialsResponse message, length delimited. Does not implicitly {@link google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse} message GenerateCredentialsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateCredentialsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kubeconfig = reader.bytes(); + break; + } + case 2: { + message.endpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateCredentialsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} GenerateCredentialsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateCredentialsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateCredentialsResponse message. + * @function verify + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateCredentialsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kubeconfig != null && message.hasOwnProperty("kubeconfig")) + if (!(message.kubeconfig && typeof message.kubeconfig.length === "number" || $util.isString(message.kubeconfig))) + return "kubeconfig: buffer expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + return null; + }; + + /** + * Creates a GenerateCredentialsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} GenerateCredentialsResponse + */ + GenerateCredentialsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) + return object; + var message = new $root.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse(); + if (object.kubeconfig != null) + if (typeof object.kubeconfig === "string") + $util.base64.decode(object.kubeconfig, message.kubeconfig = $util.newBuffer($util.base64.length(object.kubeconfig)), 0); + else if (object.kubeconfig.length >= 0) + message.kubeconfig = object.kubeconfig; + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + return message; + }; + + /** + * Creates a plain object from a GenerateCredentialsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} message GenerateCredentialsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateCredentialsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.kubeconfig = ""; + else { + object.kubeconfig = []; + if (options.bytes !== Array) + object.kubeconfig = $util.newBuffer(object.kubeconfig); + } + object.endpoint = ""; + } + if (message.kubeconfig != null && message.hasOwnProperty("kubeconfig")) + object.kubeconfig = options.bytes === String ? $util.base64.encode(message.kubeconfig, 0, message.kubeconfig.length) : options.bytes === Array ? Array.prototype.slice.call(message.kubeconfig) : message.kubeconfig; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + return object; + }; + + /** + * Converts this GenerateCredentialsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateCredentialsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateCredentialsResponse + * @function getTypeUrl + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateCredentialsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse"; + }; + + return GenerateCredentialsResponse; + })(); + v1beta1.GatewayService = (function() { /** @@ -5188,6 +6466,34 @@ return values; })(); + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + api.HttpBody = (function() { /** @@ -11568,6 +12874,7 @@ * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** @@ -11582,6 +12889,7 @@ this.targets = []; this.editionDefaults = []; this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11692,6 +13000,14 @@ */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -11745,6 +13061,12 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } return writer; }; @@ -11842,6 +13164,17 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11965,6 +13298,25 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } return null; }; @@ -12130,6 +13482,55 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } return message; }; @@ -12150,6 +13551,7 @@ object.targets = []; object.editionDefaults = []; object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; @@ -12198,6 +13600,11 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } return object; }; diff --git a/packages/google-cloud-gkeconnect-gateway/protos/protos.json b/packages/google-cloud-gkeconnect-gateway/protos/protos.json index 9e65e3fa191..e5cc54242c4 100644 --- a/packages/google-cloud-gkeconnect-gateway/protos/protos.json +++ b/packages/google-cloud-gkeconnect-gateway/protos/protos.json @@ -8,6 +8,100 @@ "nested": { "gateway": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.GkeConnect.Gateway.V1", + "go_package": "cloud.google.com/go/gkeconnect/gateway/apiv1/gatewaypb;gatewaypb", + "java_multiple_files": true, + "java_outer_classname": "ControlProto", + "java_package": "com.google.cloud.gkeconnect.gateway.v1", + "php_namespace": "Google\\Cloud\\GkeConnect\\Gateway\\V1", + "ruby_package": "Google::Cloud::GkeConnect::Gateway::V1" + }, + "nested": { + "GatewayControl": { + "options": { + "(google.api.default_host)": "connectgateway.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GenerateCredentials": { + "requestType": "GenerateCredentialsRequest", + "responseType": "GenerateCredentialsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + } + } + ] + } + } + }, + "GenerateCredentialsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "forceUseAgent": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "version": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kubernetesNamespace": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "operatingSystem": { + "type": "OperatingSystem", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OperatingSystem": { + "values": { + "OPERATING_SYSTEM_UNSPECIFIED": 0, + "OPERATING_SYSTEM_WINDOWS": 1 + } + } + } + }, + "GenerateCredentialsResponse": { + "fields": { + "kubeconfig": { + "type": "bytes", + "id": 1 + }, + "endpoint": { + "type": "string", + "id": 2 + } + } + } + } + }, "v1beta1": { "options": { "csharp_namespace": "Google.Cloud.GkeConnect.Gateway.V1Beta1", @@ -19,6 +113,87 @@ "ruby_package": "Google::Cloud::GkeConnect::Gateway::V1beta1" }, "nested": { + "GatewayControl": { + "options": { + "(google.api.default_host)": "connectgateway.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GenerateCredentials": { + "requestType": "GenerateCredentialsRequest", + "responseType": "GenerateCredentialsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + } + } + ] + } + } + }, + "GenerateCredentialsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "forceUseAgent": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "version": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kubernetesNamespace": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "operatingSystem": { + "type": "OperatingSystem", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OperatingSystem": { + "values": { + "OPERATING_SYSTEM_UNSPECIFIED": 0, + "OPERATING_SYSTEM_WINDOWS": 1 + } + } + } + }, + "GenerateCredentialsResponse": { + "fields": { + "kubeconfig": { + "type": "bytes", + "id": 1 + }, + "endpoint": { + "type": "string", + "id": 2 + } + } + }, "GatewayService": { "options": { "(google.api.default_host)": "connectgateway.googleapis.com", @@ -497,6 +672,25 @@ "DEPRECATED": 5 } }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, "HttpBody": { "fields": { "contentType": { diff --git a/packages/google-cloud-gkeconnect-gateway/samples/README.md b/packages/google-cloud-gkeconnect-gateway/samples/README.md index eea37eff0c1..ee5b317c554 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/README.md +++ b/packages/google-cloud-gkeconnect-gateway/samples/README.md @@ -12,6 +12,8 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Gateway_control.generate_credentials](#gateway_control.generate_credentials) + * [Gateway_control.generate_credentials](#gateway_control.generate_credentials) * [Gateway_service.delete_resource](#gateway_service.delete_resource) * [Gateway_service.get_resource](#gateway_service.get_resource) * [Gateway_service.patch_resource](#gateway_service.patch_resource) @@ -34,6 +36,40 @@ Before running the samples, make sure you've followed the steps outlined in +### Gateway_control.generate_credentials + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js` + + +----- + + + + +### Gateway_control.generate_credentials + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js` + + +----- + + + + ### Gateway_service.delete_resource View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js). diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js new file mode 100644 index 00000000000..5cd5b80a7f5 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/gateway_control.generate_credentials.js @@ -0,0 +1,85 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectgateway_v1_generated_GatewayControl_GenerateCredentials_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Fleet membership resource. + */ + // const name = 'abc123' + /** + * Optional. Whether to force the use of Connect Agent-based transport. + * This will return a configuration that uses Connect Agent as the underlying + * transport mechanism for cluster types that would otherwise have used a + * different transport. Requires that Connect Agent be installed on the + * cluster. Setting this field to false is equivalent to not setting it. + */ + // const forceUseAgent = true + /** + * Optional. The Connect Gateway version to be used in the resulting + * configuration. + * Leave this field blank to let the server choose the version (recommended). + */ + // const version = 'abc123' + /** + * Optional. The namespace to use in the kubeconfig context. + * If this field is specified, the server will set the `namespace` field in + * kubeconfig context. If not specified, the `namespace` field is omitted. + */ + // const kubernetesNamespace = 'abc123' + /** + * Optional. The operating system where the kubeconfig will be used. + */ + // const operatingSystem = {} + + // Imports the Gateway library + const {GatewayControlClient} = require('@google-cloud/gateway').v1; + + // Instantiates a client + const gatewayClient = new GatewayControlClient(); + + async function callGenerateCredentials() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gatewayClient.generateCredentials(request); + console.log(response); + } + + callGenerateCredentials(); + // [END connectgateway_v1_generated_GatewayControl_GenerateCredentials_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json new file mode 100644 index 00000000000..1a18ea87dfd --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json @@ -0,0 +1,71 @@ +{ + "clientLibrary": { + "name": "nodejs-gateway", + "version": "3.3.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gkeconnect.gateway.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "connectgateway_v1_generated_GatewayControl_GenerateCredentials_async", + "title": "GatewayControl generateCredentials Sample", + "origin": "API_DEFINITION", + "description": " GenerateCredentials provides connection information that allows a user to access the specified membership using Connect Gateway.", + "canonical": true, + "file": "gateway_control.generate_credentials.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateCredentials", + "fullName": "google.cloud.gkeconnect.gateway.v1.GatewayControl.GenerateCredentials", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force_use_agent", + "type": "TYPE_BOOL" + }, + { + "name": "version", + "type": "TYPE_STRING" + }, + { + "name": "kubernetes_namespace", + "type": "TYPE_STRING" + }, + { + "name": "operating_system", + "type": ".google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem" + } + ], + "resultType": ".google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse", + "client": { + "shortName": "GatewayControlClient", + "fullName": "google.cloud.gkeconnect.gateway.v1.GatewayControlClient" + }, + "method": { + "shortName": "GenerateCredentials", + "fullName": "google.cloud.gkeconnect.gateway.v1.GatewayControl.GenerateCredentials", + "service": { + "shortName": "GatewayControl", + "fullName": "google.cloud.gkeconnect.gateway.v1.GatewayControl" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js new file mode 100644 index 00000000000..d4c5fbd5e97 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_control.generate_credentials.js @@ -0,0 +1,85 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Fleet membership resource. + */ + // const name = 'abc123' + /** + * Optional. Whether to force the use of Connect Agent-based transport. + * This will return a configuration that uses Connect Agent as the underlying + * transport mechanism for cluster types that would otherwise have used a + * different transport. Requires that Connect Agent be installed on the + * cluster. Setting this field to false is equivalent to not setting it. + */ + // const forceUseAgent = true + /** + * Optional. The Connect Gateway version to be used in the resulting + * configuration. + * Leave this field blank to let the server choose the version (recommended). + */ + // const version = 'abc123' + /** + * Optional. The namespace to use in the kubeconfig context. + * If this field is specified, the server will set the `namespace` field in + * kubeconfig context. If not specified, the `namespace` field is omitted. + */ + // const kubernetesNamespace = 'abc123' + /** + * Optional. The operating system where the kubeconfig will be used. + */ + // const operatingSystem = {} + + // Imports the Gateway library + const {GatewayControlClient} = require('@google-cloud/gke-connect-gateway').v1beta1; + + // Instantiates a client + const gatewayClient = new GatewayControlClient(); + + async function callGenerateCredentials() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gatewayClient.generateCredentials(request); + console.log(response); + } + + callGenerateCredentials(); + // [END connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json index cbc31fadfca..5a95cbab2f0 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json @@ -12,241 +12,57 @@ }, "snippets": [ { - "regionTag": "connectgateway_v1beta1_generated_GatewayService_GetResource_async", - "title": "GatewayService getResource Sample", + "regionTag": "connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_async", + "title": "GatewayControl generateCredentials Sample", "origin": "API_DEFINITION", - "description": " GetResource performs an HTTP GET request on the Kubernetes API Server.", + "description": " GenerateCredentials provides connection information that allows a user to access the specified membership using Connect Gateway.", "canonical": true, - "file": "gateway_service.get_resource.js", + "file": "gateway_control.generate_credentials.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 61, + "end": 77, "type": "FULL" } ], "clientMethod": { - "shortName": "GetResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.GetResource", + "shortName": "GenerateCredentials", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl.GenerateCredentials", "async": true, "parameters": [ { - "name": "content_type", + "name": "name", "type": "TYPE_STRING" }, { - "name": "data", - "type": "TYPE_BYTES" + "name": "force_use_agent", + "type": "TYPE_BOOL" }, { - "name": "extensions", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.api.HttpBody", - "client": { - "shortName": "GatewayServiceClient", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" - }, - "method": { - "shortName": "GetResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.GetResource", - "service": { - "shortName": "GatewayService", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" - } - } - } - }, - { - "regionTag": "connectgateway_v1beta1_generated_GatewayService_PostResource_async", - "title": "GatewayService postResource Sample", - "origin": "API_DEFINITION", - "description": " PostResource performs an HTTP POST on the Kubernetes API Server.", - "canonical": true, - "file": "gateway_service.post_resource.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PostResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PostResource", - "async": true, - "parameters": [ - { - "name": "content_type", - "type": "TYPE_STRING" - }, - { - "name": "data", - "type": "TYPE_BYTES" - }, - { - "name": "extensions", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.api.HttpBody", - "client": { - "shortName": "GatewayServiceClient", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" - }, - "method": { - "shortName": "PostResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PostResource", - "service": { - "shortName": "GatewayService", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" - } - } - } - }, - { - "regionTag": "connectgateway_v1beta1_generated_GatewayService_DeleteResource_async", - "title": "GatewayService deleteResource Sample", - "origin": "API_DEFINITION", - "description": " DeleteResource performs an HTTP DELETE on the Kubernetes API Server.", - "canonical": true, - "file": "gateway_service.delete_resource.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.DeleteResource", - "async": true, - "parameters": [ - { - "name": "content_type", - "type": "TYPE_STRING" - }, - { - "name": "data", - "type": "TYPE_BYTES" - }, - { - "name": "extensions", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.api.HttpBody", - "client": { - "shortName": "GatewayServiceClient", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" - }, - "method": { - "shortName": "DeleteResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.DeleteResource", - "service": { - "shortName": "GatewayService", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" - } - } - } - }, - { - "regionTag": "connectgateway_v1beta1_generated_GatewayService_PutResource_async", - "title": "GatewayService putResource Sample", - "origin": "API_DEFINITION", - "description": " PutResource performs an HTTP PUT on the Kubernetes API Server.", - "canonical": true, - "file": "gateway_service.put_resource.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PutResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PutResource", - "async": true, - "parameters": [ - { - "name": "content_type", + "name": "version", "type": "TYPE_STRING" }, { - "name": "data", - "type": "TYPE_BYTES" - }, - { - "name": "extensions", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.api.HttpBody", - "client": { - "shortName": "GatewayServiceClient", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" - }, - "method": { - "shortName": "PutResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PutResource", - "service": { - "shortName": "GatewayService", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" - } - } - } - }, - { - "regionTag": "connectgateway_v1beta1_generated_GatewayService_PatchResource_async", - "title": "GatewayService patchResource Sample", - "origin": "API_DEFINITION", - "description": " PatchResource performs an HTTP PATCH on the Kubernetes API Server.", - "canonical": true, - "file": "gateway_service.patch_resource.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PatchResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PatchResource", - "async": true, - "parameters": [ - { - "name": "content_type", + "name": "kubernetes_namespace", "type": "TYPE_STRING" }, { - "name": "data", - "type": "TYPE_BYTES" - }, - { - "name": "extensions", - "type": "TYPE_MESSAGE[]" + "name": "operating_system", + "type": ".google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem" } ], - "resultType": ".google.api.HttpBody", + "resultType": ".google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse", "client": { - "shortName": "GatewayServiceClient", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" + "shortName": "GatewayControlClient", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayControlClient" }, "method": { - "shortName": "PatchResource", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PatchResource", + "shortName": "GenerateCredentials", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl.GenerateCredentials", "service": { - "shortName": "GatewayService", - "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" + "shortName": "GatewayControl", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl" } } } diff --git a/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js b/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js index aa414d03f2d..1ee681795fb 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js +++ b/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js @@ -17,10 +17,10 @@ async function main() { // [START nodejs_connect_gateway_quickstart] // Imports the Google Cloud client library - const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway'); + const {GatewayControlClient} = require('@google-cloud/gke-connect-gateway'); // Creates a client - new GatewayServiceClient(); + new GatewayControlClient(); // [END nodejs_connect_gateway_quickstart] } diff --git a/packages/google-cloud-gkeconnect-gateway/src/index.ts b/packages/google-cloud-gkeconnect-gateway/src/index.ts index a0a34e14cf9..d56e850fea9 100644 --- a/packages/google-cloud-gkeconnect-gateway/src/index.ts +++ b/packages/google-cloud-gkeconnect-gateway/src/index.ts @@ -16,12 +16,13 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; -const GatewayServiceClient = v1beta1.GatewayServiceClient; -type GatewayServiceClient = v1beta1.GatewayServiceClient; +const GatewayControlClient = v1beta1.GatewayControlClient; +type GatewayControlClient = v1beta1.GatewayControlClient; -export {v1beta1, GatewayServiceClient}; -export default {v1beta1, GatewayServiceClient}; +export {v1, v1beta1, GatewayControlClient}; +export default {v1, v1beta1, GatewayControlClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1/gapic_metadata.json b/packages/google-cloud-gkeconnect-gateway/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..e18ef7368fc --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.gkeconnect.gateway.v1", + "libraryPackage": "@google-cloud/gateway", + "services": { + "GatewayControl": { + "clients": { + "grpc": { + "libraryClient": "GatewayControlClient", + "rpcs": { + "GenerateCredentials": { + "methods": [ + "generateCredentials" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GatewayControlClient", + "rpcs": { + "GenerateCredentials": { + "methods": [ + "generateCredentials" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client.ts b/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client.ts new file mode 100644 index 00000000000..bf48e8d0ef2 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client.ts @@ -0,0 +1,491 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/gateway_control_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './gateway_control_client_config.json'; +const version = require('../../../package.json').version; + +/** + * GatewayControl is the control plane API for Connect Gateway. + * @class + * @memberof v1 + */ +export class GatewayControlClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + gatewayControlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GatewayControlClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new GatewayControlClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof GatewayControlClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'connectgateway.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gkeconnect.gateway.v1.GatewayControl', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.gatewayControlStub) { + return this.gatewayControlStub; + } + + // Put together the "service stub" for + // google.cloud.gkeconnect.gateway.v1.GatewayControl. + this.gatewayControlStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gkeconnect.gateway.v1.GatewayControl' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gkeconnect.gateway.v1 + .GatewayControl, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const gatewayControlStubMethods = ['generateCredentials']; + for (const methodName of gatewayControlStubMethods) { + const callPromise = this.gatewayControlStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.gatewayControlStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'connectgateway.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'connectgateway.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * GenerateCredentials provides connection information that allows a user to + * access the specified membership using Connect Gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Fleet membership resource. + * @param {boolean} [request.forceUseAgent] + * Optional. Whether to force the use of Connect Agent-based transport. + * + * This will return a configuration that uses Connect Agent as the underlying + * transport mechanism for cluster types that would otherwise have used a + * different transport. Requires that Connect Agent be installed on the + * cluster. Setting this field to false is equivalent to not setting it. + * @param {string} [request.version] + * Optional. The Connect Gateway version to be used in the resulting + * configuration. + * + * Leave this field blank to let the server choose the version (recommended). + * @param {string} [request.kubernetesNamespace] + * Optional. The namespace to use in the kubeconfig context. + * + * If this field is specified, the server will set the `namespace` field in + * kubeconfig context. If not specified, the `namespace` field is omitted. + * @param {google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest.OperatingSystem} [request.operatingSystem] + * Optional. The operating system where the kubeconfig will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse|GenerateCredentialsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/gateway_control.generate_credentials.js + * region_tag:connectgateway_v1_generated_GatewayControl_GenerateCredentials_async + */ + generateCredentials( + request?: protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, + ( + | protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest + | undefined + ), + {} | undefined, + ] + >; + generateCredentials( + request: protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateCredentials( + request: protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, + callback: Callback< + protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateCredentials( + request?: protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse, + ( + | protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateCredentials(request, options, callback); + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.gatewayControlStub && !this._terminated) { + return this.gatewayControlStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client_config.json b/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client_config.json new file mode 100644 index 00000000000..a0e1f6708c3 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.gkeconnect.gateway.v1.GatewayControl": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GenerateCredentials": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_proto_list.json b/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_proto_list.json new file mode 100644 index 00000000000..1debfa4050d --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1/gateway_control_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/gkeconnect/gateway/v1/control.proto" +] diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1/index.ts b/packages/google-cloud-gkeconnect-gateway/src/v1/index.ts new file mode 100644 index 00000000000..58f2810e2db --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {GatewayControlClient} from './gateway_control_client'; diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json index 5c3d96707e3..af6ec6e801c 100644 --- a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json @@ -5,64 +5,24 @@ "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", "libraryPackage": "@google-cloud/gke-connect-gateway", "services": { - "GatewayService": { + "GatewayControl": { "clients": { "grpc": { - "libraryClient": "GatewayServiceClient", + "libraryClient": "GatewayControlClient", "rpcs": { - "GetResource": { + "GenerateCredentials": { "methods": [ - "getResource" - ] - }, - "PostResource": { - "methods": [ - "postResource" - ] - }, - "DeleteResource": { - "methods": [ - "deleteResource" - ] - }, - "PutResource": { - "methods": [ - "putResource" - ] - }, - "PatchResource": { - "methods": [ - "patchResource" + "generateCredentials" ] } } }, "grpc-fallback": { - "libraryClient": "GatewayServiceClient", + "libraryClient": "GatewayControlClient", "rpcs": { - "GetResource": { - "methods": [ - "getResource" - ] - }, - "PostResource": { - "methods": [ - "postResource" - ] - }, - "DeleteResource": { - "methods": [ - "deleteResource" - ] - }, - "PutResource": { - "methods": [ - "putResource" - ] - }, - "PatchResource": { + "GenerateCredentials": { "methods": [ - "patchResource" + "generateCredentials" ] } } diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client.ts b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client.ts new file mode 100644 index 00000000000..8cc2910c798 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client.ts @@ -0,0 +1,488 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/gateway_control_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './gateway_control_client_config.json'; +const version = require('../../../package.json').version; + +/** + * GatewayControl is the control plane API for Connect Gateway. + * @class + * @memberof v1beta1 + */ +export class GatewayControlClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + gatewayControlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GatewayControlClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new GatewayControlClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof GatewayControlClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'connectgateway.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gkeconnect.gateway.v1beta1.GatewayControl', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.gatewayControlStub) { + return this.gatewayControlStub; + } + + // Put together the "service stub" for + // google.cloud.gkeconnect.gateway.v1beta1.GatewayControl. + this.gatewayControlStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gkeconnect.gateway.v1beta1.GatewayControl' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gkeconnect.gateway.v1beta1 + .GatewayControl, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const gatewayControlStubMethods = ['generateCredentials']; + for (const methodName of gatewayControlStubMethods) { + const callPromise = this.gatewayControlStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.gatewayControlStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'connectgateway.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'connectgateway.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * GenerateCredentials provides connection information that allows a user to + * access the specified membership using Connect Gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Fleet membership resource. + * @param {boolean} [request.forceUseAgent] + * Optional. Whether to force the use of Connect Agent-based transport. + * + * This will return a configuration that uses Connect Agent as the underlying + * transport mechanism for cluster types that would otherwise have used a + * different transport. Requires that Connect Agent be installed on the + * cluster. Setting this field to false is equivalent to not setting it. + * @param {string} [request.version] + * Optional. The Connect Gateway version to be used in the resulting + * configuration. + * + * Leave this field blank to let the server choose the version (recommended). + * @param {string} [request.kubernetesNamespace] + * Optional. The namespace to use in the kubeconfig context. + * + * If this field is specified, the server will set the `namespace` field in + * kubeconfig context. If not specified, the `namespace` field is omitted. + * @param {google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem} [request.operatingSystem] + * Optional. The operating system where the kubeconfig will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse|GenerateCredentialsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gateway_control.generate_credentials.js + * region_tag:connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_async + */ + generateCredentials( + request?: protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, + ( + | protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest + | undefined + ), + {} | undefined, + ] + >; + generateCredentials( + request: protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateCredentials( + request: protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, + callback: Callback< + protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateCredentials( + request?: protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, + | protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse, + ( + | protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateCredentials(request, options, callback); + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.gatewayControlStub && !this._terminated) { + return this.gatewayControlStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client_config.json b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client_config.json new file mode 100644 index 00000000000..e4233c920e5 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GenerateCredentials": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_proto_list.json b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_proto_list.json new file mode 100644 index 00000000000..37d936ad85b --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_control_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/gkeconnect/gateway/v1beta1/control.proto" +] diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts index 6257a42bdfb..58f2810e2db 100644 --- a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts @@ -16,4 +16,4 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {GatewayServiceClient} from './gateway_service_client'; +export {GatewayControlClient} from './gateway_control_client'; diff --git a/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js index ff35b4164b3..78439a18c9e 100644 --- a/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js @@ -20,7 +20,7 @@ const gateway = require('@google-cloud/gke-connect-gateway'); function main() { - const gatewayServiceClient = new gateway.GatewayServiceClient(); + const gatewayControlClient = new gateway.GatewayControlClient(); } main(); diff --git a/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts index bb3c638833e..2801297f835 100644 --- a/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts @@ -16,17 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {GatewayServiceClient} from '@google-cloud/gke-connect-gateway'; +import {GatewayControlClient} from '@google-cloud/gke-connect-gateway'; // check that the client class type name can be used -function doStuffWithGatewayServiceClient(client: GatewayServiceClient) { +function doStuffWithGatewayControlClient(client: GatewayControlClient) { client.close(); } function main() { // check that the client instance can be created - const gatewayServiceClient = new GatewayServiceClient(); - doStuffWithGatewayServiceClient(gatewayServiceClient); + const gatewayControlClient = new GatewayControlClient(); + doStuffWithGatewayControlClient(gatewayControlClient); } main(); diff --git a/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1.ts b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1.ts new file mode 100644 index 00000000000..9f8661479ea --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1.ts @@ -0,0 +1,378 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as gatewaycontrolModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1.GatewayControlClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'connectgateway.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + gatewaycontrolModule.v1.GatewayControlClient.servicePath; + assert.strictEqual(servicePath, 'connectgateway.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + gatewaycontrolModule.v1.GatewayControlClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'connectgateway.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'connectgateway.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'connectgateway.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new gatewaycontrolModule.v1.GatewayControlClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'connectgateway.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'connectgateway.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new gatewaycontrolModule.v1.GatewayControlClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = gatewaycontrolModule.v1.GatewayControlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gatewayControlStub, undefined); + await client.initialize(); + assert(client.gatewayControlStub); + }); + + it('has close method for the initialized client', done => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.gatewayControlStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gatewayControlStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('generateCredentials', () => { + it('invokes generateCredentials without error', async () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse() + ); + client.innerApiCalls.generateCredentials = + stubSimpleCall(expectedResponse); + const [response] = await client.generateCredentials(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateCredentials without error using callback', async () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsResponse() + ); + client.innerApiCalls.generateCredentials = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateCredentials( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkeconnect.gateway.v1.IGenerateCredentialsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateCredentials with error', async () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateCredentials = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateCredentials(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateCredentials with closed client', async () => { + const client = new gatewaycontrolModule.v1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateCredentials(request), expectedError); + }); + }); +}); diff --git a/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1beta1.ts b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1beta1.ts new file mode 100644 index 00000000000..1d5b83fe506 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_control_v1beta1.ts @@ -0,0 +1,379 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as gatewaycontrolModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta1.GatewayControlClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'connectgateway.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + gatewaycontrolModule.v1beta1.GatewayControlClient.servicePath; + assert.strictEqual(servicePath, 'connectgateway.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + gatewaycontrolModule.v1beta1.GatewayControlClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'connectgateway.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'connectgateway.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'connectgateway.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new gatewaycontrolModule.v1beta1.GatewayControlClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'connectgateway.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'connectgateway.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new gatewaycontrolModule.v1beta1.GatewayControlClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = gatewaycontrolModule.v1beta1.GatewayControlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gatewayControlStub, undefined); + await client.initialize(); + assert(client.gatewayControlStub); + }); + + it('has close method for the initialized client', done => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.gatewayControlStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gatewayControlStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('generateCredentials', () => { + it('invokes generateCredentials without error', async () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse() + ); + client.innerApiCalls.generateCredentials = + stubSimpleCall(expectedResponse); + const [response] = await client.generateCredentials(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateCredentials without error using callback', async () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse() + ); + client.innerApiCalls.generateCredentials = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateCredentials( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkeconnect.gateway.v1beta1.IGenerateCredentialsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateCredentials with error', async () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateCredentials = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateCredentials(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateCredentials with closed client', async () => { + const client = new gatewaycontrolModule.v1beta1.GatewayControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateCredentials(request), expectedError); + }); + }); +}); diff --git a/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts deleted file mode 100644 index 35b276acb49..00000000000 --- a/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts +++ /dev/null @@ -1,608 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as gatewayserviceModule from '../src'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON( - require('../protos/protos.json') -).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = ( - instance.constructor as typeof protobuf.Message - ).toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1beta1.GatewayServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'connectgateway.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, 'googleapis.com'); - }); - - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = - gatewayserviceModule.v1beta1.GatewayServiceClient.servicePath; - assert.strictEqual(servicePath, 'connectgateway.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = - gatewayserviceModule.v1beta1.GatewayServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'connectgateway.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - universeDomain: 'example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'connectgateway.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - universe_domain: 'example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'connectgateway.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = - new gatewayserviceModule.v1beta1.GatewayServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'connectgateway.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - universeDomain: 'configured.example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual( - servicePath, - 'connectgateway.configured.example.com' - ); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { - new gatewayserviceModule.v1beta1.GatewayServiceClient({ - universe_domain: 'example.com', - universeDomain: 'example.net', - }); - }); - }); - - it('has port', () => { - const port = gatewayserviceModule.v1beta1.GatewayServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.gatewayServiceStub, undefined); - await client.initialize(); - assert(client.gatewayServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.gatewayServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.gatewayServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getResource', () => { - it('invokes getResource without error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.getResource = stubSimpleCall(expectedResponse); - const [response] = await client.getResource(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes getResource without error using callback', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.getResource = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getResource( - request, - (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes getResource with error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('expected'); - client.innerApiCalls.getResource = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.getResource(request), expectedError); - }); - - it('invokes getResource with closed client', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getResource(request), expectedError); - }); - }); - - describe('postResource', () => { - it('invokes postResource without error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.postResource = stubSimpleCall(expectedResponse); - const [response] = await client.postResource(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes postResource without error using callback', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.postResource = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.postResource( - request, - (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes postResource with error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('expected'); - client.innerApiCalls.postResource = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.postResource(request), expectedError); - }); - - it('invokes postResource with closed client', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.postResource(request), expectedError); - }); - }); - - describe('deleteResource', () => { - it('invokes deleteResource without error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.deleteResource = stubSimpleCall(expectedResponse); - const [response] = await client.deleteResource(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes deleteResource without error using callback', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.deleteResource = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteResource( - request, - (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes deleteResource with error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResource = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteResource(request), expectedError); - }); - - it('invokes deleteResource with closed client', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteResource(request), expectedError); - }); - }); - - describe('putResource', () => { - it('invokes putResource without error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.putResource = stubSimpleCall(expectedResponse); - const [response] = await client.putResource(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes putResource without error using callback', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.putResource = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.putResource( - request, - (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes putResource with error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('expected'); - client.innerApiCalls.putResource = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.putResource(request), expectedError); - }); - - it('invokes putResource with closed client', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.putResource(request), expectedError); - }); - }); - - describe('patchResource', () => { - it('invokes patchResource without error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.patchResource = stubSimpleCall(expectedResponse); - const [response] = await client.patchResource(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes patchResource without error using callback', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.patchResource = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.patchResource( - request, - (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes patchResource with error', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('expected'); - client.innerApiCalls.patchResource = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.patchResource(request), expectedError); - }); - - it('invokes patchResource with closed client', async () => { - const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.api.HttpBody()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.patchResource(request), expectedError); - }); - }); -}); diff --git a/packages/google-cloud-gkeconnect-gateway/webpack.config.js b/packages/google-cloud-gkeconnect-gateway/webpack.config.js index fdb6f321889..9af444a956f 100644 --- a/packages/google-cloud-gkeconnect-gateway/webpack.config.js +++ b/packages/google-cloud-gkeconnect-gateway/webpack.config.js @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'GatewayService', - filename: './gateway-service.js', + library: 'GatewayControl', + filename: './gateway-control.js', }, node: { child_process: 'empty', From 39e65cbbe8c09020d6d33a2b6864de17ec58ef51 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:43:01 -0700 Subject: [PATCH 13/16] feat: add max_wait_duration to Scheduling (#5642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add max_wait_duration to Scheduling PiperOrigin-RevId: 668122347 Source-Link: https://github.com/googleapis/googleapis/commit/aee11eedca934535f08b3edea46ea309d201a154 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1b66c1cd1a4d87d02df205a2629ae99069063d7e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjFiNjZjMWNkMWE0ZDg3ZDAyZGYyMDVhMjYyOWFlOTkwNjkwNjNkN2UifQ== * feat: add max_wait_duration to Scheduling PiperOrigin-RevId: 668122422 Source-Link: https://github.com/googleapis/googleapis/commit/8b2adf3f686a77297f38d9a810d9910c8fdfca98 Source-Link: https://github.com/googleapis/googleapis-gen/commit/92a8ccf052f48727d252dc2f3e00fd98354d04f6 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjkyYThjY2YwNTJmNDg3MjdkMjUyZGMyZjNlMDBmZDk4MzU0ZDA0ZjYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../cloud/aiplatform/v1/custom_job.proto | 7 +++ .../cloud/aiplatform/v1beta1/custom_job.proto | 7 +++ .../protos/protos.d.ts | 12 ++++ .../google-cloud-aiplatform/protos/protos.js | 56 +++++++++++++++++++ .../protos/protos.json | 14 +++++ 5 files changed, 96 insertions(+) diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto index 0cfeb63f297..fd4d146e5fe 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto @@ -394,4 +394,11 @@ message Scheduling { // job starts running. If true, overrides // `Scheduling.restart_job_on_worker_restart` to false. bool disable_retries = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This is the maximum duration that a job will wait for the + // requested resources to be provisioned if the scheduling strategy is set to + // [Strategy.DWS_FLEX_START]. + // If set to 0, the job will wait indefinitely. The default is 24 hours. + google.protobuf.Duration max_wait_duration = 6 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto index 405dd8480c3..5ad6c69f4bd 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto @@ -394,4 +394,11 @@ message Scheduling { // job starts running. If true, overrides // `Scheduling.restart_job_on_worker_restart` to false. bool disable_retries = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This is the maximum duration that a job will wait for the + // requested resources to be provisioned if the scheduling strategy is set to + // [Strategy.DWS_FLEX_START]. + // If set to 0, the job will wait indefinitely. The default is 24 hours. + google.protobuf.Duration max_wait_duration = 6 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 60fa419c568..7fbdf09a27c 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -13276,6 +13276,9 @@ export namespace google { /** Scheduling disableRetries */ disableRetries?: (boolean|null); + + /** Scheduling maxWaitDuration */ + maxWaitDuration?: (google.protobuf.IDuration|null); } /** Represents a Scheduling. */ @@ -13299,6 +13302,9 @@ export namespace google { /** Scheduling disableRetries. */ public disableRetries: boolean; + /** Scheduling maxWaitDuration. */ + public maxWaitDuration?: (google.protobuf.IDuration|null); + /** * Creates a new Scheduling instance using the specified properties. * @param [properties] Properties to set @@ -136730,6 +136736,9 @@ export namespace google { /** Scheduling disableRetries */ disableRetries?: (boolean|null); + + /** Scheduling maxWaitDuration */ + maxWaitDuration?: (google.protobuf.IDuration|null); } /** Represents a Scheduling. */ @@ -136753,6 +136762,9 @@ export namespace google { /** Scheduling disableRetries. */ public disableRetries: boolean; + /** Scheduling maxWaitDuration. */ + public maxWaitDuration?: (google.protobuf.IDuration|null); + /** * Creates a new Scheduling instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index ab5eece88bd..88730fee6fb 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -35068,6 +35068,7 @@ * @property {boolean|null} [restartJobOnWorkerRestart] Scheduling restartJobOnWorkerRestart * @property {google.cloud.aiplatform.v1.Scheduling.Strategy|null} [strategy] Scheduling strategy * @property {boolean|null} [disableRetries] Scheduling disableRetries + * @property {google.protobuf.IDuration|null} [maxWaitDuration] Scheduling maxWaitDuration */ /** @@ -35117,6 +35118,14 @@ */ Scheduling.prototype.disableRetries = false; + /** + * Scheduling maxWaitDuration. + * @member {google.protobuf.IDuration|null|undefined} maxWaitDuration + * @memberof google.cloud.aiplatform.v1.Scheduling + * @instance + */ + Scheduling.prototype.maxWaitDuration = null; + /** * Creates a new Scheduling instance using the specified properties. * @function create @@ -35149,6 +35158,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.strategy); if (message.disableRetries != null && Object.hasOwnProperty.call(message, "disableRetries")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableRetries); + if (message.maxWaitDuration != null && Object.hasOwnProperty.call(message, "maxWaitDuration")) + $root.google.protobuf.Duration.encode(message.maxWaitDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -35199,6 +35210,10 @@ message.disableRetries = reader.bool(); break; } + case 6: { + message.maxWaitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35256,6 +35271,11 @@ if (message.disableRetries != null && message.hasOwnProperty("disableRetries")) if (typeof message.disableRetries !== "boolean") return "disableRetries: boolean expected"; + if (message.maxWaitDuration != null && message.hasOwnProperty("maxWaitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxWaitDuration); + if (error) + return "maxWaitDuration." + error; + } return null; }; @@ -35308,6 +35328,11 @@ } if (object.disableRetries != null) message.disableRetries = Boolean(object.disableRetries); + if (object.maxWaitDuration != null) { + if (typeof object.maxWaitDuration !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Scheduling.maxWaitDuration: object expected"); + message.maxWaitDuration = $root.google.protobuf.Duration.fromObject(object.maxWaitDuration); + } return message; }; @@ -35329,6 +35354,7 @@ object.restartJobOnWorkerRestart = false; object.strategy = options.enums === String ? "STRATEGY_UNSPECIFIED" : 0; object.disableRetries = false; + object.maxWaitDuration = null; } if (message.timeout != null && message.hasOwnProperty("timeout")) object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); @@ -35338,6 +35364,8 @@ object.strategy = options.enums === String ? $root.google.cloud.aiplatform.v1.Scheduling.Strategy[message.strategy] === undefined ? message.strategy : $root.google.cloud.aiplatform.v1.Scheduling.Strategy[message.strategy] : message.strategy; if (message.disableRetries != null && message.hasOwnProperty("disableRetries")) object.disableRetries = message.disableRetries; + if (message.maxWaitDuration != null && message.hasOwnProperty("maxWaitDuration")) + object.maxWaitDuration = $root.google.protobuf.Duration.toObject(message.maxWaitDuration, options); return object; }; @@ -335361,6 +335389,7 @@ * @property {boolean|null} [restartJobOnWorkerRestart] Scheduling restartJobOnWorkerRestart * @property {google.cloud.aiplatform.v1beta1.Scheduling.Strategy|null} [strategy] Scheduling strategy * @property {boolean|null} [disableRetries] Scheduling disableRetries + * @property {google.protobuf.IDuration|null} [maxWaitDuration] Scheduling maxWaitDuration */ /** @@ -335410,6 +335439,14 @@ */ Scheduling.prototype.disableRetries = false; + /** + * Scheduling maxWaitDuration. + * @member {google.protobuf.IDuration|null|undefined} maxWaitDuration + * @memberof google.cloud.aiplatform.v1beta1.Scheduling + * @instance + */ + Scheduling.prototype.maxWaitDuration = null; + /** * Creates a new Scheduling instance using the specified properties. * @function create @@ -335442,6 +335479,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.strategy); if (message.disableRetries != null && Object.hasOwnProperty.call(message, "disableRetries")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableRetries); + if (message.maxWaitDuration != null && Object.hasOwnProperty.call(message, "maxWaitDuration")) + $root.google.protobuf.Duration.encode(message.maxWaitDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -335492,6 +335531,10 @@ message.disableRetries = reader.bool(); break; } + case 6: { + message.maxWaitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -335549,6 +335592,11 @@ if (message.disableRetries != null && message.hasOwnProperty("disableRetries")) if (typeof message.disableRetries !== "boolean") return "disableRetries: boolean expected"; + if (message.maxWaitDuration != null && message.hasOwnProperty("maxWaitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxWaitDuration); + if (error) + return "maxWaitDuration." + error; + } return null; }; @@ -335601,6 +335649,11 @@ } if (object.disableRetries != null) message.disableRetries = Boolean(object.disableRetries); + if (object.maxWaitDuration != null) { + if (typeof object.maxWaitDuration !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Scheduling.maxWaitDuration: object expected"); + message.maxWaitDuration = $root.google.protobuf.Duration.fromObject(object.maxWaitDuration); + } return message; }; @@ -335622,6 +335675,7 @@ object.restartJobOnWorkerRestart = false; object.strategy = options.enums === String ? "STRATEGY_UNSPECIFIED" : 0; object.disableRetries = false; + object.maxWaitDuration = null; } if (message.timeout != null && message.hasOwnProperty("timeout")) object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); @@ -335631,6 +335685,8 @@ object.strategy = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.Scheduling.Strategy[message.strategy] === undefined ? message.strategy : $root.google.cloud.aiplatform.v1beta1.Scheduling.Strategy[message.strategy] : message.strategy; if (message.disableRetries != null && message.hasOwnProperty("disableRetries")) object.disableRetries = message.disableRetries; + if (message.maxWaitDuration != null && message.hasOwnProperty("maxWaitDuration")) + object.maxWaitDuration = $root.google.protobuf.Duration.toObject(message.maxWaitDuration, options); return object; }; diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 7c439c0193f..f431d2e3fca 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -3743,6 +3743,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "maxWaitDuration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -36556,6 +36563,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "maxWaitDuration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { From 23f4865a43fd0bcd69c9625fbc327906f304aa7b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 29 Aug 2024 23:43:14 +0200 Subject: [PATCH 14/16] chore(deps): update dependency webpack to v5 [security] (#5645) --- packages/google-cloud-tasks/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-tasks/package.json b/packages/google-cloud-tasks/package.json index a2ade523f76..7d63f4cd3e6 100644 --- a/packages/google-cloud-tasks/package.json +++ b/packages/google-cloud-tasks/package.json @@ -101,7 +101,7 @@ "sinon": "^18.0.0", "ts-loader": "^9.0.0", "typescript": "5.1.6", - "webpack": "^4.47.0", + "webpack": "^5.94.0", "webpack-cli": "^4.10.0" }, "engines": { From dd2bbcd15d95bdf036bdd0c7abda4b6d695317c3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:43:29 -0700 Subject: [PATCH 15/16] docs: [recaptchaenterprise] minor doc fixes (#5646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: minor doc fixes PiperOrigin-RevId: 668754916 Source-Link: https://github.com/googleapis/googleapis/commit/b99f12ae81cdfa330817274aed2b272e0c57c1c5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/43ba3fad89f71737dc1c561b3d8b5ca4585fe5b8 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6IjQzYmEzZmFkODlmNzE3MzdkYzFjNTYxYjNkOGI1Y2E0NTg1ZmU1YjgifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../v1/recaptchaenterprise.proto | 34 +++++++++---------- .../v1beta1/recaptchaenterprise.proto | 4 +-- ..._enterprise_service.annotate_assessment.js | 2 +- ...ha_enterprise_service.create_assessment.js | 2 +- ...recaptcha_enterprise_service.create_key.js | 2 +- .../recaptcha_enterprise_service.list_keys.js | 2 +- ...terprise_service.update_firewall_policy.js | 2 +- ...recaptcha_enterprise_service.update_key.js | 2 +- ...a_google.cloud.recaptchaenterprise.v1.json | 2 +- ...se_service_v1_beta1.annotate_assessment.js | 2 +- ...rise_service_v1_beta1.create_assessment.js | 2 +- .../v1/recaptcha_enterprise_service_client.ts | 18 +++++----- ...tcha_enterprise_service_v1_beta1_client.ts | 4 +-- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 45c1523edfd..6048f012c49 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -130,7 +130,7 @@ service RecaptchaEnterpriseService { // Adds an IP override to a key. The following restrictions hold: // * The maximum number of IP overrides per key is 100. // * For any conflict (such as IP already exists or IP part of an existing - // IP range), an error will be returned. + // IP range), an error is returned. rpc AddIpOverride(AddIpOverrideRequest) returns (AddIpOverrideResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/keys/*}:addIpOverride" @@ -239,7 +239,7 @@ service RecaptchaEnterpriseService { // The create assessment request message. message CreateAssessmentRequest { - // Required. The name of the project in which the assessment will be created, + // Required. The name of the project in which the assessment is created, // in the format `projects/{project}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -469,7 +469,7 @@ message AnnotateAssessmentRequest { } ]; - // Optional. The annotation that will be assigned to the Event. This field can + // Optional. The annotation that is assigned to the Event. This field can // be left empty to provide reasons that apply to an event without concluding // whether the event is legitimate or fraudulent. Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -726,7 +726,7 @@ message Event { [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. Flag for a reCAPTCHA express request for an assessment without a - // token. If enabled, `site_key` must reference an Express site key. + // token. If enabled, `site_key` must reference an express key. bool express = 14 [(google.api.field_behavior) = OPTIONAL]; // Optional. The URI resource the user requested that triggered an assessment. @@ -744,12 +744,12 @@ message Event { repeated string headers = 11 [(google.api.field_behavior) = OPTIONAL]; // Optional. Flag for enabling firewall policy config assessment. - // If this flag is enabled, the firewall policy will be evaluated and a - // suggested firewall action will be returned in the response. + // If this flag is enabled, the firewall policy is evaluated and a + // suggested firewall action is returned in the response. bool firewall_policy_evaluation = 12 [(google.api.field_behavior) = OPTIONAL]; // Optional. Data describing a payment transaction to be assessed. Sending - // this data enables reCAPTCHA Enterprise Fraud Prevention and the + // this data enables reCAPTCHA Fraud Prevention and the // FraudPreventionAssessment component in the response. TransactionData transaction_data = 13 [(google.api.field_behavior) = OPTIONAL]; @@ -1197,7 +1197,7 @@ message AccountDefenderAssessment { // The create key request message. message CreateKeyRequest { - // Required. The name of the project in which the key will be created, in the + // Required. The name of the project in which the key is created, in the // format `projects/{project}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1212,7 +1212,7 @@ message CreateKeyRequest { // The list keys request message. message ListKeysRequest { - // Required. The name of the project that contains the keys that will be + // Required. The name of the project that contains the keys that are // listed, in the format `projects/{project}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1270,7 +1270,7 @@ message UpdateKeyRequest { Key key = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The mask to control which fields of the key get updated. If the - // mask is not present, all fields will be updated. + // mask is not present, all fields are updated. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -1350,7 +1350,7 @@ message UpdateFirewallPolicyRequest { FirewallPolicy firewall_policy = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The mask to control which fields of the policy get updated. If - // the mask is not present, all fields will be updated. + // the mask is not present, all fields are updated. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -1444,11 +1444,11 @@ message Metrics { // Inclusive start time aligned to a day (UTC). google.protobuf.Timestamp start_time = 1; - // Metrics will be continuous and in order by dates, and in the granularity + // Metrics are continuous and in order by dates, and in the granularity // of day. All Key types should have score-based data. repeated ScoreMetrics score_metrics = 2; - // Metrics will be continuous and in order by dates, and in the granularity + // Metrics are continuous and in order by dates, and in the granularity // of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have // challenge-based data. repeated ChallengeMetrics challenge_metrics = 3; @@ -1493,7 +1493,7 @@ message Key { // Settings for keys that can be used by iOS apps. IOSKeySettings ios_settings = 5; - // Settings for keys that can be used by reCAPTCHA Express. + // Settings specific to keys that can be used for reCAPTCHA Express. ExpressKeySettings express_settings = 11; } @@ -1698,13 +1698,13 @@ message ChallengeMetrics { // Policy config assessment. message FirewallPolicyAssessment { - // Output only. If the processing of a policy config fails, an error will be - // populated and the firewall_policy will be left empty. + // Output only. If the processing of a policy config fails, an error is + // populated and the firewall_policy is left empty. google.rpc.Status error = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The policy that matched the request. If more than one policy // may match, this is the first match. If no policy matches the incoming - // request, the policy field will be left empty. + // request, the policy field is left empty. FirewallPolicy firewall_policy = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index 00286834482..c1db3402c74 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -60,7 +60,7 @@ service RecaptchaEnterpriseServiceV1Beta1 { // The create assessment request message. message CreateAssessmentRequest { - // Required. The name of the project in which the assessment will be created, + // Required. The name of the project in which the assessment is created, // in the format `projects/{project_number}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -290,7 +290,7 @@ message AnnotateAssessmentRequest { } ]; - // Optional. The annotation that will be assigned to the Event. This field can + // Optional. The annotation that is assigned to the Event. This field can // be left empty to provide reasons that apply to an event without concluding // whether the event is legitimate or fraudulent. Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index 386c3465228..a29d3fe6be8 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -34,7 +34,7 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. The annotation that will be assigned to the Event. This field can + * Optional. The annotation that is assigned to the Event. This field can * be left empty to provide reasons that apply to an event without concluding * whether the event is legitimate or fraudulent. */ diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js index 60eb442eeb8..84f95b89b16 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js @@ -29,7 +29,7 @@ function main(parent, assessment) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project in which the assessment will be created, + * Required. The name of the project in which the assessment is created, * in the format `projects/{project}`. */ // const parent = 'abc123' diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js index 3ed70706576..19bfe8bf1f8 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js @@ -29,7 +29,7 @@ function main(parent, key) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project in which the key will be created, in the + * Required. The name of the project in which the key is created, in the * format `projects/{project}`. */ // const parent = 'abc123' diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js index 014617591cb..e06e6766b22 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js @@ -29,7 +29,7 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project that contains the keys that will be + * Required. The name of the project that contains the keys that are * listed, in the format `projects/{project}`. */ // const parent = 'abc123' diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_firewall_policy.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_firewall_policy.js index 5940e9d0378..9af5834582b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_firewall_policy.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_firewall_policy.js @@ -34,7 +34,7 @@ function main(firewallPolicy) { // const firewallPolicy = {} /** * Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields will be updated. + * the mask is not present, all fields are updated. */ // const updateMask = {} diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index 399cf5dea98..90b623ec6da 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -34,7 +34,7 @@ function main(key) { // const key = {} /** * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields will be updated. + * mask is not present, all fields are updated. */ // const updateMask = {} diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json index 9a00e4bbd2c..ce4cd9b3763 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json @@ -419,7 +419,7 @@ "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async", "title": "RecaptchaEnterpriseService addIpOverride Sample", "origin": "API_DEFINITION", - "description": " Adds an IP override to a key. The following restrictions hold: * The maximum number of IP overrides per key is 100. * For any conflict (such as IP already exists or IP part of an existing IP range), an error will be returned.", + "description": " Adds an IP override to a key. The following restrictions hold: * The maximum number of IP overrides per key is 100. * For any conflict (such as IP already exists or IP part of an existing IP range), an error is returned.", "canonical": true, "file": "recaptcha_enterprise_service.add_ip_override.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index 39047f28556..20040850ab6 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -34,7 +34,7 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. The annotation that will be assigned to the Event. This field can + * Optional. The annotation that is assigned to the Event. This field can * be left empty to provide reasons that apply to an event without concluding * whether the event is legitimate or fraudulent. */ diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js index 4d249ab174a..3fd11fd3c25 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js @@ -29,7 +29,7 @@ function main(parent, assessment) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project in which the assessment will be created, + * Required. The name of the project in which the assessment is created, * in the format `projects/{project_number}`. */ // const parent = 'abc123' diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 147a307fb68..408044158d4 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -446,7 +446,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, + * Required. The name of the project in which the assessment is created, * in the format `projects/{project}`. * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment * Required. The assessment details. @@ -549,7 +549,7 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name of the Assessment, in the format * `projects/{project}/assessments/{assessment}`. * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] - * Optional. The annotation that will be assigned to the Event. This field can + * Optional. The annotation that is assigned to the Event. This field can * be left empty to provide reasons that apply to an event without concluding * whether the event is legitimate or fraudulent. * @param {number[]} [request.reasons] @@ -661,7 +661,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the + * Required. The name of the project in which the key is created, in the * format `projects/{project}`. * @param {google.cloud.recaptchaenterprise.v1.Key} request.key * Required. Information to create a reCAPTCHA Enterprise key. @@ -951,7 +951,7 @@ export class RecaptchaEnterpriseServiceClient { * Required. The key to update. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields will be updated. + * mask is not present, all fields are updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1235,7 +1235,7 @@ export class RecaptchaEnterpriseServiceClient { * Adds an IP override to a key. The following restrictions hold: * * The maximum number of IP overrides per key is 100. * * For any conflict (such as IP already exists or IP part of an existing - * IP range), an error will be returned. + * IP range), an error is returned. * * @param {Object} request * The request object that will be sent. @@ -1632,7 +1632,7 @@ export class RecaptchaEnterpriseServiceClient { * Required. The policy to update. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. The mask to control which fields of the policy get updated. If - * the mask is not present, all fields will be updated. + * the mask is not present, all fields are updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1930,7 +1930,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project that contains the keys that will be + * Required. The name of the project that contains the keys that are * listed, in the format `projects/{project}`. * @param {number} [request.pageSize] * Optional. The maximum number of keys to return. Default is 10. Max limit is @@ -2030,7 +2030,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project that contains the keys that will be + * Required. The name of the project that contains the keys that are * listed, in the format `projects/{project}`. * @param {number} [request.pageSize] * Optional. The maximum number of keys to return. Default is 10. Max limit is @@ -2078,7 +2078,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project that contains the keys that will be + * Required. The name of the project that contains the keys that are * listed, in the format `projects/{project}`. * @param {number} [request.pageSize] * Optional. The maximum number of keys to return. Default is 10. Max limit is diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 14dbdd842af..b52b16ac4b2 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -379,7 +379,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, + * Required. The name of the project in which the assessment is created, * in the format `projects/{project_number}`. * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment * Required. The assessment details. @@ -482,7 +482,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Required. The resource name of the Assessment, in the format * `projects/{project_number}/assessments/{assessment_id}`. * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} [request.annotation] - * Optional. The annotation that will be assigned to the Event. This field can + * Optional. The annotation that is assigned to the Event. This field can * be left empty to provide reasons that apply to an event without concluding * whether the event is legitimate or fraudulent. * @param {number[]} [request.reasons] From 272b8fd71bc6a2c1113c9c383491ba1587fb0464 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:30:19 +0000 Subject: [PATCH 16/16] chore: release main (#5636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* ---
aiplatform: 3.28.0 ## [3.28.0](https://togithub.com/googleapis/google-cloud-node/compare/aiplatform-v3.27.0...aiplatform-v3.28.0) (2024-08-29) ### Features * Add max_wait_duration to Scheduling ([#5642](https://togithub.com/googleapis/google-cloud-node/issues/5642)) ([39e65cb](https://togithub.com/googleapis/google-cloud-node/commit/39e65cbbe8c09020d6d33a2b6864de17ec58ef51))
alloydb: 1.9.0 ## [1.9.0](https://togithub.com/googleapis/google-cloud-node/compare/alloydb-v1.8.0...alloydb-v1.9.0) (2024-08-29) ### Features * [alloydb] support for enabling outbound public IP on an instance ([#5638](https://togithub.com/googleapis/google-cloud-node/issues/5638)) ([11554e0](https://togithub.com/googleapis/google-cloud-node/commit/11554e0847734bff0b1c68007fd5227ae2008b87))
gke-connect-gateway: 4.0.0 ## [4.0.0](https://togithub.com/googleapis/google-cloud-node/compare/gke-connect-gateway-v3.3.0...gke-connect-gateway-v4.0.0) (2024-08-29) ### ⚠ BREAKING CHANGES * existing client libraries are being regenerated to remove unused functionality and introduce new features. ### Features * [gkeconnect] removed the nonfunctional GatewayService and replaced it with the GatewayControl service ([#5632](https://togithub.com/googleapis/google-cloud-node/issues/5632)) ([c03e3a5](https://togithub.com/googleapis/google-cloud-node/commit/c03e3a5ce9740b70c9e9cf67ef98464d14052f84))
recaptcha-enterprise: 5.11.0 ## [5.11.0](https://togithub.com/googleapis/google-cloud-node/compare/recaptcha-enterprise-v5.10.0...recaptcha-enterprise-v5.11.0) (2024-08-29) ### Features * [recaptchaenterprise] add AddIpOverride RPC ([#5629](https://togithub.com/googleapis/google-cloud-node/issues/5629)) ([a211bb6](https://togithub.com/googleapis/google-cloud-node/commit/a211bb6ca388ef08b2ea819515d71399b0b51979)) * [recaptchaenterprise] add AssessmentEnvironment for CreateAssessement to explicitly describe the environment of the assessment ([#5639](https://togithub.com/googleapis/google-cloud-node/issues/5639)) ([4fe0674](https://togithub.com/googleapis/google-cloud-node/commit/4fe0674834f7bce5e845017efae304dd0c8ef862))
sql: 0.19.0 ## [0.19.0](https://togithub.com/googleapis/google-cloud-node/compare/sql-v0.18.0...sql-v0.19.0) (2024-08-29) ### Features * [sql] A new field `max_chargeable_bytes` is added to message `.google.cloud.sql.v1.BackupRun` ([#5631](https://togithub.com/googleapis/google-cloud-node/issues/5631)) ([a2328d8](https://togithub.com/googleapis/google-cloud-node/commit/a2328d88189081ce1d3342470d1ffcedfc0c78be))
container: 5.17.0 ## [5.17.0](https://togithub.com/googleapis/google-cloud-node/compare/container-v5.16.0...container-v5.17.0) (2024-08-29) ### Features * [container] add `EXTENDED` enum value for `ReleaseChannel.Channel` ([#5641](https://togithub.com/googleapis/google-cloud-node/issues/5641)) ([b03f419](https://togithub.com/googleapis/google-cloud-node/commit/b03f419cab2ebf8385d2df7bf018863e63295624))
--- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- .release-please-manifest.json | 12 +- changelog.json | 113 +++++++++++++++++- packages/google-cloud-aiplatform/CHANGELOG.md | 7 ++ packages/google-cloud-aiplatform/package.json | 2 +- ...t_metadata.google.cloud.aiplatform.v1.json | 2 +- ...t_metadata_google.cloud.aiplatform.v1.json | 2 +- ...adata.google.cloud.aiplatform.v1beta1.json | 2 +- ...adata_google.cloud.aiplatform.v1beta1.json | 2 +- .../samples/package.json | 2 +- packages/google-cloud-alloydb/CHANGELOG.md | 7 ++ packages/google-cloud-alloydb/package.json | 2 +- ...ppet_metadata.google.cloud.alloydb.v1.json | 2 +- ...ppet_metadata_google.cloud.alloydb.v1.json | 2 +- ...metadata.google.cloud.alloydb.v1alpha.json | 2 +- ...metadata_google.cloud.alloydb.v1alpha.json | 2 +- ..._metadata.google.cloud.alloydb.v1beta.json | 2 +- ..._metadata_google.cloud.alloydb.v1beta.json | 2 +- .../google-cloud-alloydb/samples/package.json | 2 +- .../CHANGELOG.md | 11 ++ .../package.json | 2 +- ...ta_google.cloud.gkeconnect.gateway.v1.json | 2 +- ...ogle.cloud.gkeconnect.gateway.v1beta1.json | 2 +- ...ogle.cloud.gkeconnect.gateway.v1beta1.json | 2 +- .../samples/package.json | 2 +- .../CHANGELOG.md | 8 ++ .../package.json | 2 +- ...a.google.cloud.recaptchaenterprise.v1.json | 2 +- ...a_google.cloud.recaptchaenterprise.v1.json | 2 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 2 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../samples/package.json | 2 +- packages/google-cloud-sql/CHANGELOG.md | 7 ++ packages/google-cloud-sql/package.json | 2 +- .../snippet_metadata_google.cloud.sql.v1.json | 2 +- ...pet_metadata_google.cloud.sql.v1beta4.json | 2 +- .../google-cloud-sql/samples/package.json | 2 +- packages/google-container/CHANGELOG.md | 7 ++ packages/google-container/package.json | 2 +- .../snippet_metadata.google.container.v1.json | 2 +- .../snippet_metadata_google.container.v1.json | 2 +- ...pet_metadata.google.container.v1beta1.json | 2 +- ...pet_metadata_google.container.v1beta1.json | 2 +- .../google-container/samples/package.json | 2 +- 43 files changed, 200 insertions(+), 42 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 44b16bdccca..ff0551bb964 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -11,8 +11,8 @@ "packages/google-area120-tables": "3.3.0", "packages/google-cloud-accessapproval": "3.3.0", "packages/google-cloud-advisorynotifications": "1.4.0", - "packages/google-cloud-aiplatform": "3.27.0", - "packages/google-cloud-alloydb": "1.8.0", + "packages/google-cloud-aiplatform": "3.28.0", + "packages/google-cloud-alloydb": "1.9.0", "packages/google-cloud-apigateway": "3.3.0", "packages/google-cloud-apigeeconnect": "3.3.0", "packages/google-cloud-apigeeregistry": "1.3.0", @@ -69,7 +69,7 @@ "packages/google-cloud-filestore": "3.4.0", "packages/google-cloud-functions": "3.6.0", "packages/google-cloud-gkebackup": "1.4.0", - "packages/google-cloud-gkeconnect-gateway": "3.3.0", + "packages/google-cloud-gkeconnect-gateway": "4.0.0", "packages/google-cloud-gkehub": "4.5.0", "packages/google-cloud-gkemulticloud": "1.4.0", "packages/google-cloud-gsuiteaddons": "1.3.0", @@ -103,7 +103,7 @@ "packages/google-cloud-policytroubleshooter-iam": "0.5.0", "packages/google-cloud-privatecatalog": "3.3.0", "packages/google-cloud-rapidmigrationassessment": "1.3.0", - "packages/google-cloud-recaptchaenterprise": "5.10.0", + "packages/google-cloud-recaptchaenterprise": "5.11.0", "packages/google-cloud-recommender": "6.4.0", "packages/google-cloud-redis": "4.3.0", "packages/google-cloud-resourcemanager": "5.3.0", @@ -117,7 +117,7 @@ "packages/google-cloud-servicedirectory": "5.3.0", "packages/google-cloud-shell": "3.3.0", "packages/google-cloud-speech": "6.7.0", - "packages/google-cloud-sql": "0.18.0", + "packages/google-cloud-sql": "0.19.0", "packages/google-cloud-storageinsights": "1.3.0", "packages/google-cloud-support": "1.3.0", "packages/google-cloud-talent": "6.3.1", @@ -137,7 +137,7 @@ "packages/google-cloud-websecurityscanner": "3.3.0", "packages/google-cloud-workflows-executions": "3.4.0", "packages/google-cloud-workstations": "1.4.0", - "packages/google-container": "5.16.0", + "packages/google-container": "5.17.0", "packages/google-dataflow": "3.3.0", "packages/google-devtools-artifactregistry": "3.4.0", "packages/google-devtools-cloudbuild": "4.5.0", diff --git a/changelog.json b/changelog.json index fe4d0abc345..ea3a826424a 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,117 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "b03f419cab2ebf8385d2df7bf018863e63295624", + "message": "[container] add `EXTENDED` enum value for `ReleaseChannel.Channel`", + "issues": [ + "5641" + ] + } + ], + "version": "5.17.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/container", + "id": "5357da50-318f-4c63-9e78-f9713ab69b9d", + "createTime": "2024-08-29T21:45:48.411Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a2328d88189081ce1d3342470d1ffcedfc0c78be", + "message": "[sql] A new field `max_chargeable_bytes` is added to message `.google.cloud.sql.v1.BackupRun`", + "issues": [ + "5631" + ] + } + ], + "version": "0.19.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/sql", + "id": "1b555c9c-8eb9-400a-94be-91cef876568d", + "createTime": "2024-08-29T21:45:48.368Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "4fe0674834f7bce5e845017efae304dd0c8ef862", + "message": "[recaptchaenterprise] add AssessmentEnvironment for CreateAssessement to explicitly describe the environment of the assessment", + "issues": [ + "5639" + ] + }, + { + "type": "feat", + "sha": "a211bb6ca388ef08b2ea819515d71399b0b51979", + "message": "[recaptchaenterprise] add AddIpOverride RPC", + "issues": [ + "5629" + ] + } + ], + "version": "5.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/recaptcha-enterprise", + "id": "3a53352d-3866-4741-9b5e-65e2a8835522", + "createTime": "2024-08-29T21:45:48.351Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c03e3a5ce9740b70c9e9cf67ef98464d14052f84", + "message": "[gkeconnect] removed the nonfunctional GatewayService and replaced it with the GatewayControl service", + "issues": [ + "5632" + ], + "breakingChangeNote": "existing client libraries are being regenerated to remove unused functionality and introduce new features." + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-connect-gateway", + "id": "93097cf3-188b-48c1-bcb1-4121162fd232", + "createTime": "2024-08-29T21:45:48.335Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "11554e0847734bff0b1c68007fd5227ae2008b87", + "message": "[alloydb] support for enabling outbound public IP on an instance", + "issues": [ + "5638" + ] + } + ], + "version": "1.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/alloydb", + "id": "14b738c0-e806-471b-9d4f-820ad5d05da6", + "createTime": "2024-08-29T21:45:48.319Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "39e65cbbe8c09020d6d33a2b6864de17ec58ef51", + "message": "Add max_wait_duration to Scheduling", + "issues": [ + "5642" + ] + } + ], + "version": "3.28.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "d0cdee92-6a12-49dd-8c77-be4a2cba1142", + "createTime": "2024-08-29T21:45:48.283Z" + }, { "changes": [ { @@ -36104,5 +36215,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2024-08-19T17:17:10.524Z" + "updateTime": "2024-08-29T21:45:48.411Z" } \ No newline at end of file diff --git a/packages/google-cloud-aiplatform/CHANGELOG.md b/packages/google-cloud-aiplatform/CHANGELOG.md index 5e277d0a0a0..8f89d820382 100644 --- a/packages/google-cloud-aiplatform/CHANGELOG.md +++ b/packages/google-cloud-aiplatform/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.28.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.27.0...aiplatform-v3.28.0) (2024-08-29) + + +### Features + +* Add max_wait_duration to Scheduling ([#5642](https://github.com/googleapis/google-cloud-node/issues/5642)) ([39e65cb](https://github.com/googleapis/google-cloud-node/commit/39e65cbbe8c09020d6d33a2b6864de17ec58ef51)) + ## [3.27.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.26.0...aiplatform-v3.27.0) (2024-08-19) diff --git a/packages/google-cloud-aiplatform/package.json b/packages/google-cloud-aiplatform/package.json index de0b2e8be16..67aa06f9ff9 100644 --- a/packages/google-cloud-aiplatform/package.json +++ b/packages/google-cloud-aiplatform/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/aiplatform", - "version": "3.27.0", + "version": "3.28.0", "description": "Vertex AI client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json index da79e26c1a2..a7314278e40 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.27.0", + "version": "3.28.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json index fe34c445e1b..2ebc6729657 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.27.0", + "version": "3.28.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index d725d5c848a..56cfd178fdb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.27.0", + "version": "3.28.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json index 9c1b5f997d3..4c4c8c2c8fb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.27.0", + "version": "3.28.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/package.json b/packages/google-cloud-aiplatform/samples/package.json index dbf036a7055..a48fafdbec2 100644 --- a/packages/google-cloud-aiplatform/samples/package.json +++ b/packages/google-cloud-aiplatform/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 1200000 test/*.js" }, "dependencies": { - "@google-cloud/aiplatform": "^3.27.0" + "@google-cloud/aiplatform": "^3.28.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-alloydb/CHANGELOG.md b/packages/google-cloud-alloydb/CHANGELOG.md index 408fe5b3557..f72b136e98c 100644 --- a/packages/google-cloud-alloydb/CHANGELOG.md +++ b/packages/google-cloud-alloydb/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.9.0](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.8.0...alloydb-v1.9.0) (2024-08-29) + + +### Features + +* [alloydb] support for enabling outbound public IP on an instance ([#5638](https://github.com/googleapis/google-cloud-node/issues/5638)) ([11554e0](https://github.com/googleapis/google-cloud-node/commit/11554e0847734bff0b1c68007fd5227ae2008b87)) + ## [1.8.0](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.7.0...alloydb-v1.8.0) (2024-05-21) diff --git a/packages/google-cloud-alloydb/package.json b/packages/google-cloud-alloydb/package.json index c2a7e4cbcb3..a218ab95404 100644 --- a/packages/google-cloud-alloydb/package.json +++ b/packages/google-cloud-alloydb/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/alloydb", - "version": "1.8.0", + "version": "1.9.0", "description": "AlloyDB API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json index e1cfc7cdc52..6210905d14c 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.8.0", + "version": "1.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json index a29d41453e4..0a7512f59e9 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.8.0", + "version": "1.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json index 14a1ad4d08a..1f602478e03 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.8.0", + "version": "1.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json index 4a5411e3517..275f53341e4 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.8.0", + "version": "1.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json index ad5999b7ce6..6ed85201d55 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.8.0", + "version": "1.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json index 3a23cf91256..225b8663d6d 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.8.0", + "version": "1.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/package.json b/packages/google-cloud-alloydb/samples/package.json index 0272ffbe55e..320b0137840 100644 --- a/packages/google-cloud-alloydb/samples/package.json +++ b/packages/google-cloud-alloydb/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/alloydb": "^1.8.0" + "@google-cloud/alloydb": "^1.9.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md b/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md index 3aff59b10d8..d663f48c718 100644 --- a/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md +++ b/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/gke-connect-gateway-v3.3.0...gke-connect-gateway-v4.0.0) (2024-08-29) + + +### ⚠ BREAKING CHANGES + +* existing client libraries are being regenerated to remove unused functionality and introduce new features. + +### Features + +* [gkeconnect] removed the nonfunctional GatewayService and replaced it with the GatewayControl service ([#5632](https://github.com/googleapis/google-cloud-node/issues/5632)) ([c03e3a5](https://github.com/googleapis/google-cloud-node/commit/c03e3a5ce9740b70c9e9cf67ef98464d14052f84)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/gke-connect-gateway-v3.2.0...gke-connect-gateway-v3.3.0) (2024-05-21) diff --git a/packages/google-cloud-gkeconnect-gateway/package.json b/packages/google-cloud-gkeconnect-gateway/package.json index 5f9ff0fd4cf..5127f2f2e9e 100644 --- a/packages/google-cloud-gkeconnect-gateway/package.json +++ b/packages/google-cloud-gkeconnect-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/gke-connect-gateway", - "version": "3.3.0", + "version": "4.0.0", "description": "apigateway client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json index 1a18ea87dfd..e94fda2adc2 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1/snippet_metadata_google.cloud.gkeconnect.gateway.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gateway", - "version": "3.3.0", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json index cbc31fadfca..a098eaeaa81 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gateway", - "version": "3.3.0", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json index 5a95cbab2f0..5b33047b5e1 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gateway", - "version": "3.3.0", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkeconnect-gateway/samples/package.json b/packages/google-cloud-gkeconnect-gateway/samples/package.json index 5f14ab1177a..1da29bf72d1 100644 --- a/packages/google-cloud-gkeconnect-gateway/samples/package.json +++ b/packages/google-cloud-gkeconnect-gateway/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/gke-connect-gateway": "^3.3.0" + "@google-cloud/gke-connect-gateway": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 6bb3014a4d8..6fb58cad465 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [5.11.0](https://github.com/googleapis/google-cloud-node/compare/recaptcha-enterprise-v5.10.0...recaptcha-enterprise-v5.11.0) (2024-08-29) + + +### Features + +* [recaptchaenterprise] add AddIpOverride RPC ([#5629](https://github.com/googleapis/google-cloud-node/issues/5629)) ([a211bb6](https://github.com/googleapis/google-cloud-node/commit/a211bb6ca388ef08b2ea819515d71399b0b51979)) +* [recaptchaenterprise] add AssessmentEnvironment for CreateAssessement to explicitly describe the environment of the assessment ([#5639](https://github.com/googleapis/google-cloud-node/issues/5639)) ([4fe0674](https://github.com/googleapis/google-cloud-node/commit/4fe0674834f7bce5e845017efae304dd0c8ef862)) + ## [5.10.0](https://github.com/googleapis/google-cloud-node/compare/recaptcha-enterprise-v5.9.0...recaptcha-enterprise-v5.10.0) (2024-06-26) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 472dd26619e..dd20333a473 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/googleapis/google-cloud-node.git" }, "name": "@google-cloud/recaptcha-enterprise", - "version": "5.10.0", + "version": "5.11.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 7eb0196b094..16892134e57 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json index ce4cd9b3763..bc88addcb33 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index d8778ee4822..a92bcae2094 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json index d96610b2e2a..1c997a041b5 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 08c7ee9657b..bda186ad07b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^5.10.0" + "@google-cloud/recaptcha-enterprise": "^5.11.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-sql/CHANGELOG.md b/packages/google-cloud-sql/CHANGELOG.md index d224e6cf330..5960b128bce 100644 --- a/packages/google-cloud-sql/CHANGELOG.md +++ b/packages/google-cloud-sql/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.19.0](https://github.com/googleapis/google-cloud-node/compare/sql-v0.18.0...sql-v0.19.0) (2024-08-29) + + +### Features + +* [sql] A new field `max_chargeable_bytes` is added to message `.google.cloud.sql.v1.BackupRun` ([#5631](https://github.com/googleapis/google-cloud-node/issues/5631)) ([a2328d8](https://github.com/googleapis/google-cloud-node/commit/a2328d88189081ce1d3342470d1ffcedfc0c78be)) + ## [0.18.0](https://github.com/googleapis/google-cloud-node/compare/sql-v0.17.0...sql-v0.18.0) (2024-08-19) diff --git a/packages/google-cloud-sql/package.json b/packages/google-cloud-sql/package.json index cda5e3b913b..93363ee8d5a 100644 --- a/packages/google-cloud-sql/package.json +++ b/packages/google-cloud-sql/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/sql", - "version": "0.18.0", + "version": "0.19.0", "description": "Sql client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json b/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json index 10c443ab3d4..45102ffd037 100644 --- a/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json +++ b/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-sql", - "version": "0.18.0", + "version": "0.19.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json b/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json index 5d37f825be3..af00842f9fa 100644 --- a/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json +++ b/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-sql", - "version": "0.18.0", + "version": "0.19.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-sql/samples/package.json b/packages/google-cloud-sql/samples/package.json index 6b521416b44..393793b08ed 100644 --- a/packages/google-cloud-sql/samples/package.json +++ b/packages/google-cloud-sql/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/sql": "^0.18.0" + "@google-cloud/sql": "^0.19.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-container/CHANGELOG.md b/packages/google-container/CHANGELOG.md index ee4fd089e8d..e5b77d0568e 100644 --- a/packages/google-container/CHANGELOG.md +++ b/packages/google-container/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/container?activeTab=versions +## [5.17.0](https://github.com/googleapis/google-cloud-node/compare/container-v5.16.0...container-v5.17.0) (2024-08-29) + + +### Features + +* [container] add `EXTENDED` enum value for `ReleaseChannel.Channel` ([#5641](https://github.com/googleapis/google-cloud-node/issues/5641)) ([b03f419](https://github.com/googleapis/google-cloud-node/commit/b03f419cab2ebf8385d2df7bf018863e63295624)) + ## [5.16.0](https://github.com/googleapis/google-cloud-node/compare/container-v5.15.1...container-v5.16.0) (2024-07-22) diff --git a/packages/google-container/package.json b/packages/google-container/package.json index f8fa5c6ed63..c0ce50e0893 100644 --- a/packages/google-container/package.json +++ b/packages/google-container/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/container", "description": "Google Container Engine API client for Node.js", - "version": "5.16.0", + "version": "5.17.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json index 9b713b0ac4a..5550d811749 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.16.0", + "version": "5.17.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json index b2408929c7e..90265ae94b1 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.16.0", + "version": "5.17.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json index 5b5c16d3b5f..c471db4b4f4 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.16.0", + "version": "5.17.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json index 21e7003db0a..0f312e5c91d 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.16.0", + "version": "5.17.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/package.json b/packages/google-container/samples/package.json index 728588c6043..aa7223ab1f6 100644 --- a/packages/google-container/samples/package.json +++ b/packages/google-container/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 1000000" }, "dependencies": { - "@google-cloud/container": "^5.16.0", + "@google-cloud/container": "^5.17.0", "uuid": "^9.0.0" }, "devDependencies": {