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] 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": {