diff --git a/packages/google-cloud-compute/README.md b/packages/google-cloud-compute/README.md index f408a6c8ed7..9c9a8b69b00 100644 --- a/packages/google-cloud-compute/README.md +++ b/packages/google-cloud-compute/README.md @@ -427,6 +427,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Node_groups.patch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.patch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_groups.patch.js,samples/README.md) | | Node_groups.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_groups.set_iam_policy.js,samples/README.md) | | Node_groups.set_node_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.set_node_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_groups.set_node_template.js,samples/README.md) | +| Node_groups.simulate_maintenance_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js,samples/README.md) | | Node_groups.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_groups.test_iam_permissions.js,samples/README.md) | | Node_templates.aggregated_list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_templates.aggregated_list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_templates.aggregated_list.js,samples/README.md) | | Node_templates.delete | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_templates.delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_templates.delete.js,samples/README.md) | diff --git a/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto b/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto index 7f2d79b4d57..dc2e066fc37 100644 --- a/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto +++ b/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto @@ -9421,6 +9421,8 @@ message GuestOsFeature { SEV_CAPABLE = 87083793; + SEV_LIVE_MIGRATABLE = 392039820; + SEV_SNP_CAPABLE = 426919; UEFI_COMPATIBLE = 195865408; @@ -9897,12 +9899,16 @@ message HealthStatusForNetworkEndpoint { // A value indicating that the enum field is not set. UNDEFINED_HEALTH_STATE = 0; + // Endpoint is being drained. DRAINING = 480455402; + // Endpoint is healthy. HEALTHY = 439801213; + // Endpoint is unhealthy. UNHEALTHY = 462118084; + // Health status of the endpoint is unknown. UNKNOWN = 433141802; } @@ -18682,6 +18688,13 @@ message NodeGroupsSetNodeTemplateRequest { } +// +message NodeGroupsSimulateMaintenanceEventRequest { + // Names of the nodes to go under maintenance simulation. + repeated string nodes = 104993457; + +} + // Represent a sole-tenant Node Template resource. You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. message NodeTemplate { // CPU overcommit. @@ -26603,6 +26616,31 @@ message SimulateMaintenanceEventInstanceRequest { } +// A request message for NodeGroups.SimulateMaintenanceEvent. See the method description for details. +message SimulateMaintenanceEventNodeGroupRequest { + // Name of the NodeGroup resource whose nodes will go under maintenance simulation. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "zone" + ]; + +} + // Represents a Persistent Disk Snapshot resource. You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. message Snapshot { // [Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64. @@ -34205,6 +34243,16 @@ service NodeGroups { option (google.cloud.operation_service) = "ZoneOperations"; } + // Simulates maintenance event on specified nodes from the node group. + rpc SimulateMaintenanceEvent(SimulateMaintenanceEventNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + body: "node_groups_simulate_maintenance_event_request_resource" + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/simulateMaintenanceEvent" + }; + option (google.api.method_signature) = "project,zone,node_group,node_groups_simulate_maintenance_event_request_resource"; + option (google.cloud.operation_service) = "ZoneOperations"; + } + // Returns permissions that a caller has on the specified resource. rpc TestIamPermissions(TestIamPermissionsNodeGroupRequest) returns (TestPermissionsResponse) { option (google.api.http) = { diff --git a/packages/google-cloud-compute/protos/protos.d.ts b/packages/google-cloud-compute/protos/protos.d.ts index ef8070c8747..fffa90d9ed3 100644 --- a/packages/google-cloud-compute/protos/protos.d.ts +++ b/packages/google-cloud-compute/protos/protos.d.ts @@ -55586,6 +55586,7 @@ export namespace google { MULTI_IP_SUBNET = 151776719, SECURE_BOOT = 376811194, SEV_CAPABLE = 87083793, + SEV_LIVE_MIGRATABLE = 392039820, SEV_SNP_CAPABLE = 426919, UEFI_COMPATIBLE = 195865408, VIRTIO_SCSI_MULTIQUEUE = 201597069, @@ -106299,6 +106300,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a NodeGroupsSimulateMaintenanceEventRequest. */ + interface INodeGroupsSimulateMaintenanceEventRequest { + + /** NodeGroupsSimulateMaintenanceEventRequest nodes */ + nodes?: (string[]|null); + } + + /** Represents a NodeGroupsSimulateMaintenanceEventRequest. */ + class NodeGroupsSimulateMaintenanceEventRequest implements INodeGroupsSimulateMaintenanceEventRequest { + + /** + * Constructs a new NodeGroupsSimulateMaintenanceEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest); + + /** NodeGroupsSimulateMaintenanceEventRequest nodes. */ + public nodes: string[]; + + /** + * Creates a new NodeGroupsSimulateMaintenanceEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupsSimulateMaintenanceEventRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest): google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest; + + /** + * Encodes the specified NodeGroupsSimulateMaintenanceEventRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.verify|verify} messages. + * @param message NodeGroupsSimulateMaintenanceEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupsSimulateMaintenanceEventRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.verify|verify} messages. + * @param message NodeGroupsSimulateMaintenanceEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupsSimulateMaintenanceEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupsSimulateMaintenanceEventRequest + * @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.compute.v1.NodeGroupsSimulateMaintenanceEventRequest; + + /** + * Decodes a NodeGroupsSimulateMaintenanceEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupsSimulateMaintenanceEventRequest + * @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.compute.v1.NodeGroupsSimulateMaintenanceEventRequest; + + /** + * Verifies a NodeGroupsSimulateMaintenanceEventRequest 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 NodeGroupsSimulateMaintenanceEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupsSimulateMaintenanceEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest; + + /** + * Creates a plain object from a NodeGroupsSimulateMaintenanceEventRequest message. Also converts values to other types if specified. + * @param message NodeGroupsSimulateMaintenanceEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupsSimulateMaintenanceEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeGroupsSimulateMaintenanceEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a NodeTemplate. */ interface INodeTemplate { @@ -149400,6 +149498,130 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a SimulateMaintenanceEventNodeGroupRequest. */ + interface ISimulateMaintenanceEventNodeGroupRequest { + + /** SimulateMaintenanceEventNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** SimulateMaintenanceEventNodeGroupRequest nodeGroupsSimulateMaintenanceEventRequestResource */ + nodeGroupsSimulateMaintenanceEventRequestResource?: (google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest|null); + + /** SimulateMaintenanceEventNodeGroupRequest project */ + project?: (string|null); + + /** SimulateMaintenanceEventNodeGroupRequest requestId */ + requestId?: (string|null); + + /** SimulateMaintenanceEventNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a SimulateMaintenanceEventNodeGroupRequest. */ + class SimulateMaintenanceEventNodeGroupRequest implements ISimulateMaintenanceEventNodeGroupRequest { + + /** + * Constructs a new SimulateMaintenanceEventNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest); + + /** SimulateMaintenanceEventNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** SimulateMaintenanceEventNodeGroupRequest nodeGroupsSimulateMaintenanceEventRequestResource. */ + public nodeGroupsSimulateMaintenanceEventRequestResource?: (google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest|null); + + /** SimulateMaintenanceEventNodeGroupRequest project. */ + public project: string; + + /** SimulateMaintenanceEventNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** SimulateMaintenanceEventNodeGroupRequest zone. */ + public zone: string; + + /** SimulateMaintenanceEventNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SimulateMaintenanceEventNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SimulateMaintenanceEventNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest): google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest; + + /** + * Encodes the specified SimulateMaintenanceEventNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.verify|verify} messages. + * @param message SimulateMaintenanceEventNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimulateMaintenanceEventNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.verify|verify} messages. + * @param message SimulateMaintenanceEventNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimulateMaintenanceEventNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimulateMaintenanceEventNodeGroupRequest + * @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.compute.v1.SimulateMaintenanceEventNodeGroupRequest; + + /** + * Decodes a SimulateMaintenanceEventNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimulateMaintenanceEventNodeGroupRequest + * @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.compute.v1.SimulateMaintenanceEventNodeGroupRequest; + + /** + * Verifies a SimulateMaintenanceEventNodeGroupRequest 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 SimulateMaintenanceEventNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimulateMaintenanceEventNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest; + + /** + * Creates a plain object from a SimulateMaintenanceEventNodeGroupRequest message. Also converts values to other types if specified. + * @param message SimulateMaintenanceEventNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimulateMaintenanceEventNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SimulateMaintenanceEventNodeGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Snapshot. */ interface ISnapshot { @@ -180388,6 +180610,20 @@ export namespace google { */ public setNodeTemplate(request: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest): Promise; + /** + * Calls SimulateMaintenanceEvent. + * @param request SimulateMaintenanceEventNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public simulateMaintenanceEvent(request: google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEventCallback): void; + + /** + * Calls SimulateMaintenanceEvent. + * @param request SimulateMaintenanceEventNodeGroupRequest message or plain object + * @returns Promise + */ + public simulateMaintenanceEvent(request: google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest): Promise; + /** * Calls TestIamPermissions. * @param request TestIamPermissionsNodeGroupRequest message or plain object @@ -180489,6 +180725,13 @@ export namespace google { */ type SetNodeTemplateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups|simulateMaintenanceEvent}. + * @param error Error, if any + * @param [response] Operation + */ + type SimulateMaintenanceEventCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** * Callback as used by {@link google.cloud.compute.v1.NodeGroups|testIamPermissions}. * @param error Error, if any diff --git a/packages/google-cloud-compute/protos/protos.js b/packages/google-cloud-compute/protos/protos.js index 331e98e8865..32ad659c3c9 100644 --- a/packages/google-cloud-compute/protos/protos.js +++ b/packages/google-cloud-compute/protos/protos.js @@ -146059,6 +146059,7 @@ * @property {number} MULTI_IP_SUBNET=151776719 MULTI_IP_SUBNET value * @property {number} SECURE_BOOT=376811194 SECURE_BOOT value * @property {number} SEV_CAPABLE=87083793 SEV_CAPABLE value + * @property {number} SEV_LIVE_MIGRATABLE=392039820 SEV_LIVE_MIGRATABLE value * @property {number} SEV_SNP_CAPABLE=426919 SEV_SNP_CAPABLE value * @property {number} UEFI_COMPATIBLE=195865408 UEFI_COMPATIBLE value * @property {number} VIRTIO_SCSI_MULTIQUEUE=201597069 VIRTIO_SCSI_MULTIQUEUE value @@ -146072,6 +146073,7 @@ values[valuesById[151776719] = "MULTI_IP_SUBNET"] = 151776719; values[valuesById[376811194] = "SECURE_BOOT"] = 376811194; values[valuesById[87083793] = "SEV_CAPABLE"] = 87083793; + values[valuesById[392039820] = "SEV_LIVE_MIGRATABLE"] = 392039820; values[valuesById[426919] = "SEV_SNP_CAPABLE"] = 426919; values[valuesById[195865408] = "UEFI_COMPATIBLE"] = 195865408; values[valuesById[201597069] = "VIRTIO_SCSI_MULTIQUEUE"] = 201597069; @@ -287840,6 +287842,225 @@ return NodeGroupsSetNodeTemplateRequest; })(); + v1.NodeGroupsSimulateMaintenanceEventRequest = (function() { + + /** + * Properties of a NodeGroupsSimulateMaintenanceEventRequest. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupsSimulateMaintenanceEventRequest + * @property {Array.|null} [nodes] NodeGroupsSimulateMaintenanceEventRequest nodes + */ + + /** + * Constructs a new NodeGroupsSimulateMaintenanceEventRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupsSimulateMaintenanceEventRequest. + * @implements INodeGroupsSimulateMaintenanceEventRequest + * @constructor + * @param {google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest=} [properties] Properties to set + */ + function NodeGroupsSimulateMaintenanceEventRequest(properties) { + this.nodes = []; + 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]]; + } + + /** + * NodeGroupsSimulateMaintenanceEventRequest nodes. + * @member {Array.} nodes + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @instance + */ + NodeGroupsSimulateMaintenanceEventRequest.prototype.nodes = $util.emptyArray; + + /** + * Creates a new NodeGroupsSimulateMaintenanceEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest} NodeGroupsSimulateMaintenanceEventRequest instance + */ + NodeGroupsSimulateMaintenanceEventRequest.create = function create(properties) { + return new NodeGroupsSimulateMaintenanceEventRequest(properties); + }; + + /** + * Encodes the specified NodeGroupsSimulateMaintenanceEventRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest} message NodeGroupsSimulateMaintenanceEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsSimulateMaintenanceEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + writer.uint32(/* id 104993457, wireType 2 =*/839947658).string(message.nodes[i]); + return writer; + }; + + /** + * Encodes the specified NodeGroupsSimulateMaintenanceEventRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest} message NodeGroupsSimulateMaintenanceEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsSimulateMaintenanceEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupsSimulateMaintenanceEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest} NodeGroupsSimulateMaintenanceEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsSimulateMaintenanceEventRequest.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.compute.v1.NodeGroupsSimulateMaintenanceEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 104993457: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupsSimulateMaintenanceEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest} NodeGroupsSimulateMaintenanceEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsSimulateMaintenanceEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupsSimulateMaintenanceEventRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupsSimulateMaintenanceEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) + if (!$util.isString(message.nodes[i])) + return "nodes: string[] expected"; + } + return null; + }; + + /** + * Creates a NodeGroupsSimulateMaintenanceEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest} NodeGroupsSimulateMaintenanceEventRequest + */ + NodeGroupsSimulateMaintenanceEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest(); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) + message.nodes[i] = String(object.nodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupsSimulateMaintenanceEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest} message NodeGroupsSimulateMaintenanceEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupsSimulateMaintenanceEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = message.nodes[j]; + } + return object; + }; + + /** + * Converts this NodeGroupsSimulateMaintenanceEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @instance + * @returns {Object.} JSON object + */ + NodeGroupsSimulateMaintenanceEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeGroupsSimulateMaintenanceEventRequest + * @function getTypeUrl + * @memberof google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeGroupsSimulateMaintenanceEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest"; + }; + + return NodeGroupsSimulateMaintenanceEventRequest; + })(); + v1.NodeTemplate = (function() { /** @@ -403569,6 +403790,326 @@ return SimulateMaintenanceEventInstanceRequest; })(); + v1.SimulateMaintenanceEventNodeGroupRequest = (function() { + + /** + * Properties of a SimulateMaintenanceEventNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ISimulateMaintenanceEventNodeGroupRequest + * @property {string|null} [nodeGroup] SimulateMaintenanceEventNodeGroupRequest nodeGroup + * @property {google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest|null} [nodeGroupsSimulateMaintenanceEventRequestResource] SimulateMaintenanceEventNodeGroupRequest nodeGroupsSimulateMaintenanceEventRequestResource + * @property {string|null} [project] SimulateMaintenanceEventNodeGroupRequest project + * @property {string|null} [requestId] SimulateMaintenanceEventNodeGroupRequest requestId + * @property {string|null} [zone] SimulateMaintenanceEventNodeGroupRequest zone + */ + + /** + * Constructs a new SimulateMaintenanceEventNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SimulateMaintenanceEventNodeGroupRequest. + * @implements ISimulateMaintenanceEventNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest=} [properties] Properties to set + */ + function SimulateMaintenanceEventNodeGroupRequest(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]]; + } + + /** + * SimulateMaintenanceEventNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + */ + SimulateMaintenanceEventNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * SimulateMaintenanceEventNodeGroupRequest nodeGroupsSimulateMaintenanceEventRequestResource. + * @member {google.cloud.compute.v1.INodeGroupsSimulateMaintenanceEventRequest|null|undefined} nodeGroupsSimulateMaintenanceEventRequestResource + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + */ + SimulateMaintenanceEventNodeGroupRequest.prototype.nodeGroupsSimulateMaintenanceEventRequestResource = null; + + /** + * SimulateMaintenanceEventNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + */ + SimulateMaintenanceEventNodeGroupRequest.prototype.project = ""; + + /** + * SimulateMaintenanceEventNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + */ + SimulateMaintenanceEventNodeGroupRequest.prototype.requestId = null; + + /** + * SimulateMaintenanceEventNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + */ + SimulateMaintenanceEventNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SimulateMaintenanceEventNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + */ + Object.defineProperty(SimulateMaintenanceEventNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SimulateMaintenanceEventNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest} SimulateMaintenanceEventNodeGroupRequest instance + */ + SimulateMaintenanceEventNodeGroupRequest.create = function create(properties) { + return new SimulateMaintenanceEventNodeGroupRequest(properties); + }; + + /** + * Encodes the specified SimulateMaintenanceEventNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest} message SimulateMaintenanceEventNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateMaintenanceEventNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroupsSimulateMaintenanceEventRequestResource != null && Object.hasOwnProperty.call(message, "nodeGroupsSimulateMaintenanceEventRequestResource")) + $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.encode(message.nodeGroupsSimulateMaintenanceEventRequestResource, writer.uint32(/* id 351468764, wireType 2 =*/2811750114).fork()).ldelim(); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + return writer; + }; + + /** + * Encodes the specified SimulateMaintenanceEventNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest} message SimulateMaintenanceEventNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateMaintenanceEventNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulateMaintenanceEventNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest} SimulateMaintenanceEventNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateMaintenanceEventNodeGroupRequest.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.compute.v1.SimulateMaintenanceEventNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: { + message.nodeGroup = reader.string(); + break; + } + case 351468764: { + message.nodeGroupsSimulateMaintenanceEventRequestResource = $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.decode(reader, reader.uint32()); + break; + } + case 227560217: { + message.project = reader.string(); + break; + } + case 37109963: { + message.requestId = reader.string(); + break; + } + case 3744684: { + message.zone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulateMaintenanceEventNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest} SimulateMaintenanceEventNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateMaintenanceEventNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulateMaintenanceEventNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulateMaintenanceEventNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.nodeGroupsSimulateMaintenanceEventRequestResource != null && message.hasOwnProperty("nodeGroupsSimulateMaintenanceEventRequestResource")) { + var error = $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.verify(message.nodeGroupsSimulateMaintenanceEventRequestResource); + if (error) + return "nodeGroupsSimulateMaintenanceEventRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SimulateMaintenanceEventNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest} SimulateMaintenanceEventNodeGroupRequest + */ + SimulateMaintenanceEventNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.nodeGroupsSimulateMaintenanceEventRequestResource != null) { + if (typeof object.nodeGroupsSimulateMaintenanceEventRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.nodeGroupsSimulateMaintenanceEventRequestResource: object expected"); + message.nodeGroupsSimulateMaintenanceEventRequestResource = $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.fromObject(object.nodeGroupsSimulateMaintenanceEventRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SimulateMaintenanceEventNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest} message SimulateMaintenanceEventNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulateMaintenanceEventNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.nodeGroupsSimulateMaintenanceEventRequestResource = null; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroupsSimulateMaintenanceEventRequestResource != null && message.hasOwnProperty("nodeGroupsSimulateMaintenanceEventRequestResource")) + object.nodeGroupsSimulateMaintenanceEventRequestResource = $root.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.toObject(message.nodeGroupsSimulateMaintenanceEventRequestResource, options); + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + return object; + }; + + /** + * Converts this SimulateMaintenanceEventNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + SimulateMaintenanceEventNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SimulateMaintenanceEventNodeGroupRequest + * @function getTypeUrl + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SimulateMaintenanceEventNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest"; + }; + + return SimulateMaintenanceEventNodeGroupRequest; + })(); + v1.Snapshot = (function() { /** @@ -480094,6 +480635,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups|simulateMaintenanceEvent}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef SimulateMaintenanceEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SimulateMaintenanceEvent. + * @function simulateMaintenanceEvent + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest} request SimulateMaintenanceEventNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEventCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.simulateMaintenanceEvent = function simulateMaintenanceEvent(request, callback) { + return this.rpcCall(simulateMaintenanceEvent, $root.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SimulateMaintenanceEvent" }); + + /** + * Calls SimulateMaintenanceEvent. + * @function simulateMaintenanceEvent + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest} request SimulateMaintenanceEventNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.compute.v1.NodeGroups|testIamPermissions}. * @memberof google.cloud.compute.v1.NodeGroups diff --git a/packages/google-cloud-compute/protos/protos.json b/packages/google-cloud-compute/protos/protos.json index f343fb12307..ed7e5312a86 100644 --- a/packages/google-cloud-compute/protos/protos.json +++ b/packages/google-cloud-compute/protos/protos.json @@ -21638,6 +21638,7 @@ "MULTI_IP_SUBNET": 151776719, "SECURE_BOOT": 376811194, "SEV_CAPABLE": 87083793, + "SEV_LIVE_MIGRATABLE": 392039820, "SEV_SNP_CAPABLE": 426919, "UEFI_COMPATIBLE": 195865408, "VIRTIO_SCSI_MULTIQUEUE": 201597069, @@ -45331,6 +45332,15 @@ } } }, + "NodeGroupsSimulateMaintenanceEventRequest": { + "fields": { + "nodes": { + "rule": "repeated", + "type": "string", + "id": 104993457 + } + } + }, "NodeTemplate": { "oneofs": { "_cpuOvercommitType": { @@ -62670,6 +62680,54 @@ } } }, + "SimulateMaintenanceEventNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupsSimulateMaintenanceEventRequestResource": { + "type": "NodeGroupsSimulateMaintenanceEventRequest", + "id": 351468764, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.cloud.operation_request_field)": "project" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.cloud.operation_request_field)": "zone" + } + } + } + }, "Snapshot": { "oneofs": { "_architecture": { @@ -79663,6 +79721,30 @@ } ] }, + "SimulateMaintenanceEvent": { + "requestType": "SimulateMaintenanceEventNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).body": "node_groups_simulate_maintenance_event_request_resource", + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/simulateMaintenanceEvent", + "(google.api.method_signature)": "project,zone,node_group,node_groups_simulate_maintenance_event_request_resource", + "(google.cloud.operation_service)": "ZoneOperations" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "body": "node_groups_simulate_maintenance_event_request_resource", + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/simulateMaintenanceEvent" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group,node_groups_simulate_maintenance_event_request_resource" + }, + { + "(google.cloud.operation_service)": "ZoneOperations" + } + ] + }, "TestIamPermissions": { "requestType": "TestIamPermissionsNodeGroupRequest", "responseType": "TestPermissionsResponse", diff --git a/packages/google-cloud-compute/samples/README.md b/packages/google-cloud-compute/samples/README.md index 95879f43a2d..30ac2575ebb 100644 --- a/packages/google-cloud-compute/samples/README.md +++ b/packages/google-cloud-compute/samples/README.md @@ -336,6 +336,7 @@ * [Node_groups.patch](#node_groups.patch) * [Node_groups.set_iam_policy](#node_groups.set_iam_policy) * [Node_groups.set_node_template](#node_groups.set_node_template) + * [Node_groups.simulate_maintenance_event](#node_groups.simulate_maintenance_event) * [Node_groups.test_iam_permissions](#node_groups.test_iam_permissions) * [Node_templates.aggregated_list](#node_templates.aggregated_list) * [Node_templates.delete](#node_templates.delete) @@ -6229,6 +6230,23 @@ __Usage:__ +### Node_groups.simulate_maintenance_event + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js` + + +----- + + + + ### Node_groups.test_iam_permissions View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/node_groups.test_iam_permissions.js). diff --git a/packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js b/packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js new file mode 100644 index 00000000000..b7323b4e366 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated/v1/node_groups.simulate_maintenance_event.js @@ -0,0 +1,80 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(nodeGroup, nodeGroupsSimulateMaintenanceEventRequestResource, project, zone) { + // [START compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the NodeGroup resource whose nodes will go under maintenance simulation. + */ + // const nodeGroup = 'abc123' + /** + * The body resource for this request + */ + // const nodeGroupsSimulateMaintenanceEventRequestResource = {} + /** + * Project ID for this request. + */ + // const project = 'my-project' + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * The name of the zone for this request. + */ + // const zone = 'abc123' + + // Imports the Compute library + const {NodeGroupsClient} = require('@google-cloud/compute').v1; + + // Instantiates a client + const computeClient = new NodeGroupsClient(); + + async function callSimulateMaintenanceEvent() { + // Construct request + const request = { + nodeGroup, + nodeGroupsSimulateMaintenanceEventRequestResource, + project, + zone, + }; + + // Run request + const response = await computeClient.simulateMaintenanceEvent(request); + console.log(response); + } + + callSimulateMaintenanceEvent(); + // [END compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json b/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json index 7612088df4e..1f6ab9ffff1 100644 --- a/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json +++ b/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json @@ -17291,6 +17291,62 @@ } } }, + { + "regionTag": "compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_async", + "title": "AcceleratorTypes simulateMaintenanceEvent Sample", + "origin": "API_DEFINITION", + "description": " Simulates maintenance event on specified nodes from the node group.", + "canonical": true, + "file": "node_groups.simulate_maintenance_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SimulateMaintenanceEvent", + "fullName": "google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEvent", + "async": true, + "parameters": [ + { + "name": "node_group", + "type": "TYPE_STRING" + }, + { + "name": "node_groups_simulate_maintenance_event_request_resource", + "type": ".google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest" + }, + { + "name": "project", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.compute.v1.Operation", + "client": { + "shortName": "NodeGroupsClient", + "fullName": "google.cloud.compute.v1.NodeGroupsClient" + }, + "method": { + "shortName": "SimulateMaintenanceEvent", + "fullName": "google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEvent", + "service": { + "shortName": "NodeGroups", + "fullName": "google.cloud.compute.v1.NodeGroups" + } + } + } + }, { "regionTag": "compute_v1_generated_NodeGroups_TestIamPermissions_async", "title": "AcceleratorTypes testIamPermissions Sample", diff --git a/packages/google-cloud-compute/src/v1/gapic_metadata.json b/packages/google-cloud-compute/src/v1/gapic_metadata.json index 1dc35086303..4f664cb9cc6 100644 --- a/packages/google-cloud-compute/src/v1/gapic_metadata.json +++ b/packages/google-cloud-compute/src/v1/gapic_metadata.json @@ -3915,6 +3915,11 @@ "setNodeTemplate" ] }, + "SimulateMaintenanceEvent": { + "methods": [ + "simulateMaintenanceEvent" + ] + }, "TestIamPermissions": { "methods": [ "testIamPermissions" @@ -3991,6 +3996,11 @@ "setNodeTemplate" ] }, + "SimulateMaintenanceEvent": { + "methods": [ + "simulateMaintenanceEvent" + ] + }, "TestIamPermissions": { "methods": [ "testIamPermissions" diff --git a/packages/google-cloud-compute/src/v1/node_groups_client.ts b/packages/google-cloud-compute/src/v1/node_groups_client.ts index c3578fcc424..6fd3eaa06ea 100644 --- a/packages/google-cloud-compute/src/v1/node_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/node_groups_client.ts @@ -257,6 +257,7 @@ export class NodeGroupsClient { 'patch', 'setIamPolicy', 'setNodeTemplate', + 'simulateMaintenanceEvent', 'testIamPermissions', ]; for (const methodName of nodeGroupsStubMethods) { @@ -1368,6 +1369,132 @@ export class NodeGroupsClient { } ); } + /** + * Simulates maintenance event on specified nodes from the node group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * @param {google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest} request.nodeGroupsSimulateMaintenanceEventRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @param {string} request.zone + * The name of the zone for this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. + * @example include:samples/generated/v1/node_groups.simulate_maintenance_event.js + * region_tag:compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_async + */ + simulateMaintenanceEvent( + request?: protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, + {} | undefined + ] + >; + simulateMaintenanceEvent( + request: protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + simulateMaintenanceEvent( + request: protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + simulateMaintenanceEvent( + request?: protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project: request.project ?? '', + zone: request.zone ?? '', + node_group: request.nodeGroup ?? '', + }); + this.initialize(); + return this.innerApiCalls + .simulateMaintenanceEvent(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); + } /** * Returns permissions that a caller has on the specified resource. * diff --git a/packages/google-cloud-compute/src/v1/node_groups_client_config.json b/packages/google-cloud-compute/src/v1/node_groups_client_config.json index e2646e0cf95..2116a1c8fc1 100644 --- a/packages/google-cloud-compute/src/v1/node_groups_client_config.json +++ b/packages/google-cloud-compute/src/v1/node_groups_client_config.json @@ -68,6 +68,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "SimulateMaintenanceEvent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "TestIamPermissions": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-compute/test/gapic_node_groups_v1.ts b/packages/google-cloud-compute/test/gapic_node_groups_v1.ts index 42ac383cebc..159a6c0e794 100644 --- a/packages/google-cloud-compute/test/gapic_node_groups_v1.ts +++ b/packages/google-cloud-compute/test/gapic_node_groups_v1.ts @@ -1725,6 +1725,183 @@ describe('v1.NodeGroupsClient', () => { }); }); + describe('simulateMaintenanceEvent', () => { + it('invokes simulateMaintenanceEvent without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['project'] + ); + request.project = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['zone'] + ); + request.zone = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['nodeGroup'] + ); + request.nodeGroup = defaultValue3; + const expectedHeaderRequestParams = `project=${defaultValue1}&zone=${defaultValue2}&node_group=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.simulateMaintenanceEvent = + stubSimpleCall(expectedResponse); + const [response] = await client.simulateMaintenanceEvent(request); + assert.deepStrictEqual(response.latestResponse, expectedResponse); + const actualRequest = ( + client.innerApiCalls.simulateMaintenanceEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.simulateMaintenanceEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes simulateMaintenanceEvent without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['project'] + ); + request.project = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['zone'] + ); + request.zone = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['nodeGroup'] + ); + request.nodeGroup = defaultValue3; + const expectedHeaderRequestParams = `project=${defaultValue1}&zone=${defaultValue2}&node_group=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.simulateMaintenanceEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.simulateMaintenanceEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.simulateMaintenanceEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.simulateMaintenanceEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes simulateMaintenanceEvent with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['project'] + ); + request.project = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['zone'] + ); + request.zone = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['nodeGroup'] + ); + request.nodeGroup = defaultValue3; + const expectedHeaderRequestParams = `project=${defaultValue1}&zone=${defaultValue2}&node_group=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.simulateMaintenanceEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.simulateMaintenanceEvent(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.simulateMaintenanceEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.simulateMaintenanceEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes simulateMaintenanceEvent with closed client', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['project'] + ); + request.project = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['zone'] + ); + request.zone = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest', + ['nodeGroup'] + ); + request.nodeGroup = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.simulateMaintenanceEvent(request), + expectedError + ); + }); + }); + describe('testIamPermissions', () => { it('invokes testIamPermissions without error', async () => { const client = new nodegroupsModule.v1.NodeGroupsClient({