diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto index 22b82d56d0f..874ac489ee8 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto @@ -308,9 +308,9 @@ message ContinuousBackupConfig { // Whether ContinuousBackup is enabled. optional bool enabled = 1; - // The number of days backups and logs will be retained, which determines the - // window of time that data is recoverable for. If not set, it defaults to 14 - // days. + // The number of days that are eligible to restore from using PITR. To support + // the entire recovery window, backups and logs are retained for one day more + // than the recovery window. If not set, defaults to 14 days. int32 recovery_window_days = 4; // The encryption config can be specified to encrypt the @@ -381,6 +381,31 @@ message Cluster { style: DECLARATIVE_FRIENDLY }; + // Metadata related to network configuration. + message NetworkConfig { + // 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_number}/global/networks/{network_id}". This is + // required to create a cluster. + string network = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Optional. Name of the allocated IP range for the private IP AlloyDB + // cluster, for example: "google-managed-services-default". If set, the + // instance IPs for this cluster will be created in the allocated range. The + // range name must comply with RFC 1035. Specifically, the name must be 1-63 + // characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. + // Field name is intended to be consistent with CloudSQL. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Configuration information for the secondary cluster. This should be set // if and only if the cluster is of type SECONDARY. message SecondaryConfig { @@ -503,18 +528,21 @@ message Cluster { // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The database engine major version. This is an output-only - // field and it's populated at the Cluster creation time. This field cannot be - // changed after cluster creation. - DatabaseVersion database_version = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The database engine major version. This is an optional field and + // it is populated at the Cluster creation time. If a database version is not + // supplied at cluster creation time, then a default database version will + // be used. + DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; + + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; // 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_number}/global/networks/{network_id}". This is - // required to create a cluster. It can be updated, but it cannot be removed. + // 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, (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } ]; @@ -638,6 +666,16 @@ message Instance { int32 node_count = 1; } + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL config option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Instance State enum State { // The state of the instance is unknown. @@ -818,6 +856,10 @@ message Instance { // This is distinct from labels. // https://google.aip.dev/128 map annotations = 18; + + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; } // Message describing Backup object @@ -828,6 +870,29 @@ message Backup { style: DECLARATIVE_FRIENDLY }; + // A backup's position in a quantity-based retention queue, of backups with + // the same source cluster and type, with length, retention, specified by the + // backup's retention policy. + // Once the position is greater than the retention, the backup is eligible to + // be garbage collected. + // + // Example: 5 backups from the same source cluster and type with a + // quantity-based retention of 3 and denoted by backup_id (position, + // retention). + // + // Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). + // Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3) + message QuantityBasedExpiry { + // Output only. The backup's position among its backups with the same source + // cluster and type, by descending chronological order create time(i.e. + // newest first). + int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The length of the quantity-based queue, specified by the + // backup's retention policy. + int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // Backup State enum State { // The state of the backup is unknown. @@ -950,6 +1015,18 @@ message Backup { // added to the backup's create_time. google.protobuf.Timestamp expiry_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The QuantityBasedExpiry of the backup, specified by the + // backup's retention policy. Once the expiry quantity is over retention, the + // backup is eligible to be garbage collected. + QuantityBasedExpiry expiry_quantity = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database engine major version of the cluster this backup + // was created from. Any restored cluster created from this backup will have + // the same database version. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // SupportedDatabaseFlag gives general information about a database flag, diff --git a/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index 04ae91efe43..24b4c955b18 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -1520,6 +1520,9 @@ export namespace google { /** Cluster databaseVersion */ databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); + /** Cluster network */ network?: (string|null); @@ -1605,6 +1608,9 @@ export namespace google { /** Cluster databaseVersion. */ public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); + /** Cluster network. */ public network: string; @@ -1727,6 +1733,109 @@ export namespace google { namespace Cluster { + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a 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.v1.Cluster.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is 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.v1.Cluster.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SecondaryConfig. */ interface ISecondaryConfig { @@ -2008,6 +2117,9 @@ export namespace google { /** Instance annotations */ annotations?: ({ [k: string]: string }|null); + + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); } /** Represents an Instance. */ @@ -2082,6 +2194,9 @@ export namespace google { /** Instance annotations. */ public annotations: { [k: string]: string }; + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -2595,6 +2710,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a 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.v1.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload is 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.v1.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, @@ -2683,6 +2901,12 @@ export namespace google { /** Backup expiryTime */ expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity */ + expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); } /** Represents a Backup. */ @@ -2751,6 +2975,12 @@ export namespace google { /** Backup expiryTime. */ public expiryTime?: (google.protobuf.ITimestamp|null); + /** Backup expiryQuantity. */ + public expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); + + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + /** * Creates a new Backup instance using the specified properties. * @param [properties] Properties to set @@ -2831,6 +3061,109 @@ export namespace google { namespace Backup { + /** Properties of a QuantityBasedExpiry. */ + interface IQuantityBasedExpiry { + + /** QuantityBasedExpiry retentionCount */ + retentionCount?: (number|null); + + /** QuantityBasedExpiry totalRetentionCount */ + totalRetentionCount?: (number|null); + } + + /** Represents a QuantityBasedExpiry. */ + class QuantityBasedExpiry implements IQuantityBasedExpiry { + + /** + * Constructs a new QuantityBasedExpiry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry); + + /** QuantityBasedExpiry retentionCount. */ + public retentionCount: number; + + /** QuantityBasedExpiry totalRetentionCount. */ + public totalRetentionCount: number; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedExpiry instance + */ + public static create(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a 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.v1.Backup.QuantityBasedExpiry; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is 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.v1.Backup.QuantityBasedExpiry; + + /** + * Verifies a QuantityBasedExpiry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedExpiry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @param message QuantityBasedExpiry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index 9db93d6209a..4084a8c8f73 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -3760,6 +3760,7 @@ * @property {google.cloud.alloydb.v1.Cluster.State|null} [state] Cluster state * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] Cluster clusterType * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig * @property {string|null} [network] Cluster network * @property {string|null} [etag] Cluster etag * @property {Object.|null} [annotations] Cluster annotations @@ -3888,6 +3889,14 @@ */ Cluster.prototype.databaseVersion = 0; + /** + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.networkConfig = null; + /** * Cluster network. * @member {string} network @@ -4082,6 +4091,8 @@ $root.google.cloud.alloydb.v1.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) $root.google.cloud.alloydb.v1.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); return writer; }; @@ -4183,6 +4194,10 @@ message.databaseVersion = reader.int32(); break; } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } case 10: { message.network = reader.string(); break; @@ -4374,6 +4389,11 @@ case 2: break; } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } if (message.network != null && message.hasOwnProperty("network")) if (!$util.isString(message.network)) return "network: string expected"; @@ -4577,6 +4597,11 @@ message.databaseVersion = 2; break; } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.fromObject(object.networkConfig); + } if (object.network != null) message.network = String(object.network); if (object.etag != null) @@ -4677,6 +4702,7 @@ object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; object.continuousBackupConfig = null; object.continuousBackupInfo = null; + object.networkConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4741,6 +4767,8 @@ object.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) object.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.toObject(message.networkConfig, options); return object; }; @@ -4770,6 +4798,233 @@ return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster"; }; + Cluster.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.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.v1.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.NetworkConfig"; + }; + + return NetworkConfig; + })(); + Cluster.SecondaryConfig = (function() { /** @@ -5268,6 +5523,7 @@ * @property {boolean|null} [reconciling] Instance reconciling * @property {string|null} [etag] Instance etag * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig */ /** @@ -5457,6 +5713,14 @@ */ Instance.prototype.annotations = $util.emptyObject; + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -5527,6 +5791,8 @@ $root.google.cloud.alloydb.v1.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); return writer; }; @@ -5704,6 +5970,10 @@ message.annotations[key] = value; break; } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5862,6 +6132,11 @@ if (!$util.isString(message.annotations[key[i]])) return "annotations: string{k:string} expected"; } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } return null; }; @@ -6045,6 +6320,11 @@ for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) message.annotations[keys[i]] = String(object.annotations[keys[i]]); } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } return message; }; @@ -6086,6 +6366,7 @@ object.etag = ""; object.writableNode = null; object.queryInsightsConfig = null; + object.clientConnectionConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6142,6 +6423,8 @@ } if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) object.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); return object; }; @@ -7171,31 +7454,263 @@ return ReadPoolConfig; })(); - /** - * State enum. - * @name google.cloud.alloydb.v1.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.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.v1.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value + * @property {number} PROMOTING=9 PROMOTING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; return values; })(); @@ -7261,6 +7776,8 @@ * @property {Object.|null} [annotations] Backup annotations * @property {number|Long|null} [sizeBytes] Backup sizeBytes * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * @property {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Backup databaseVersion */ /** @@ -7432,6 +7949,22 @@ */ Backup.prototype.expiryTime = null; + /** + * Backup expiryQuantity. + * @member {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.expiryQuantity = null; + + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + /** * Creates a new Backup instance using the specified properties. * @function create @@ -7496,6 +8029,10 @@ writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) + $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); return writer; }; @@ -7644,6 +8181,14 @@ message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 20: { + message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); + break; + } + case 22: { + message.databaseVersion = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -7773,6 +8318,20 @@ if (error) return "expiryTime." + error; } + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { + var error = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); + if (error) + return "expiryQuantity." + error; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -7909,6 +8468,31 @@ throw TypeError(".google.cloud.alloydb.v1.Backup.expiryTime: object expected"); message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); } + if (object.expiryQuantity != null) { + if (typeof object.expiryQuantity !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.expiryQuantity: object expected"); + message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + } return message; }; @@ -7951,6 +8535,8 @@ object.sizeBytes = options.longs === String ? "0" : 0; object.clusterUid = ""; object.expiryTime = null; + object.expiryQuantity = null; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8000,6 +8586,10 @@ object.clusterUid = message.clusterUid; if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) + object.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; return object; }; @@ -8029,6 +8619,233 @@ return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; }; + Backup.QuantityBasedExpiry = (function() { + + /** + * Properties of a QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1.Backup + * @interface IQuantityBasedExpiry + * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount + * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount + */ + + /** + * Constructs a new QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1.Backup + * @classdesc Represents a QuantityBasedExpiry. + * @implements IQuantityBasedExpiry + * @constructor + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + */ + function QuantityBasedExpiry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedExpiry retentionCount. + * @member {number} retentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.retentionCount = 0; + + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + */ + QuantityBasedExpiry.create = function create(properties) { + return new QuantityBasedExpiry(properties); + }; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); + if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); + return writer; + }; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.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.v1.Backup.QuantityBasedExpiry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retentionCount = reader.int32(); + break; + } + case 2: { + message.totalRetentionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedExpiry message. + * @function verify + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedExpiry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + if (!$util.isInteger(message.retentionCount)) + return "retentionCount: integer expected"; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + if (!$util.isInteger(message.totalRetentionCount)) + return "totalRetentionCount: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + */ + QuantityBasedExpiry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry) + return object; + var message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); + if (object.retentionCount != null) + message.retentionCount = object.retentionCount | 0; + if (object.totalRetentionCount != null) + message.totalRetentionCount = object.totalRetentionCount | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedExpiry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionCount = 0; + object.totalRetentionCount = 0; + } + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + object.retentionCount = message.retentionCount; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + object.totalRetentionCount = message.totalRetentionCount; + return object; + }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedExpiry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup.QuantityBasedExpiry"; + }; + + return QuantityBasedExpiry; + })(); + /** * State enum. * @name google.cloud.alloydb.v1.Backup.State diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index 20083797b65..17a6e2b40ba 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -454,13 +454,21 @@ "type": "DatabaseVersion", "id": 9, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } }, "network": { "type": "string", "id": 10, "options": { + "deprecated": true, "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "compute.googleapis.com/Network" } @@ -540,6 +548,25 @@ } }, "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "SecondaryConfig": { "fields": { "primaryClusterName": { @@ -710,6 +737,13 @@ "keyType": "string", "type": "string", "id": 18 + }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -795,6 +829,24 @@ } } }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -949,9 +1001,41 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "expiryQuantity": { + "type": "QuantityBasedExpiry", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { + "QuantityBasedExpiry": { + "fields": { + "retentionCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRetentionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0,