// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 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.

import Foundation
import GoogleCloudWkt

/// UpdateNodePoolRequests update a node pool's image and/or version.
public struct UpdateNodePoolRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Deprecated. The Google Developers Console [project ID or project
  /// number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
  /// This field has been deprecated and replaced by the name field.
  @available(*, deprecated)
  public var projectId: Swift.String = Swift.String()

  /// Deprecated. The name of the Google Compute Engine
  /// [zone](https://cloud.google.com/compute/docs/zones#available)
  /// in which the cluster resides. This field has been deprecated and replaced
  /// by the name field.
  @available(*, deprecated)
  public var zone: Swift.String = Swift.String()

  /// Deprecated. The name of the cluster to upgrade.
  /// This field has been deprecated and replaced by the name field.
  @available(*, deprecated)
  public var clusterId: Swift.String = Swift.String()

  /// Deprecated. The name of the node pool to upgrade.
  /// This field has been deprecated and replaced by the name field.
  @available(*, deprecated)
  public var nodePoolId: Swift.String = Swift.String()

  /// Required. The Kubernetes version to change the nodes to (typically an
  /// upgrade).
  ///
  /// Users may specify either explicit versions offered by Kubernetes Engine or
  /// version aliases, which have the following behavior:
  ///
  /// - "latest": picks the highest valid Kubernetes version
  /// - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
  /// - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  /// - "1.X.Y-gke.N": picks an explicit Kubernetes version
  /// - "-": picks the Kubernetes master version
  public var nodeVersion: Swift.String = Swift.String()

  /// Required. The desired image type for the node pool. Please see
  /// https://cloud.google.com/kubernetes-engine/docs/concepts/node-images
  /// for available image types.
  public var imageType: Swift.String = Swift.String()

  /// The name (project, location, cluster, node pool) of the node pool to
  /// update. Specified in the format
  /// `projects/*/locations/*/clusters/*/nodePools/*`.
  public var name: Swift.String = Swift.String()

  /// The desired name of the image name to use for this node.
  /// This is used to create clusters using a custom image.
  public var image: Swift.String = Swift.String()

  /// The project containing the desired image to use for this node pool.
  /// This is used to create clusters using a custom image.
  public var imageProject: Swift.String = Swift.String()

  /// The desired list of Google Compute Engine
  /// [zones](https://cloud.google.com/compute/docs/zones#available)
  /// in which the node pool's nodes should be located. Changing the locations
  /// for a node pool will result in nodes being either created or removed from
  /// the node pool, depending on whether locations are being added or removed.
  ///
  /// Warning: It is recommended to update node pool locations in a standalone
  /// API call. Do not combine a location update with changes to other fields
  /// (such as `tags`, `labels`, `taints`, etc.) in the same request.
  /// Otherwise, the API performs a structural modification where changes to
  /// other fields will only apply to newly created nodes and will not be
  /// applied to existing nodes in the node pool. To ensure all nodes are updated
  /// consistently, use a separate API call for location changes.
  public var locations: [Swift.String] = []

  /// The desired workload metadata config for the node pool.
  public var workloadMetadataConfig: WorkloadMetadataConfig? = nil

  /// Upgrade settings control disruption and speed of the upgrade.
  public var upgradeSettings: NodePool.UpgradeSettings? = nil

  /// The desired network tags to be applied to all nodes in the node pool.
  /// If this field is not present, the tags will not be changed. Otherwise,
  /// the existing network tags will be *replaced* with the provided tags.
  public var tags: NetworkTags? = nil

  /// The desired node taints to be applied to all nodes in the node pool.
  /// If this field is not present, the taints will not be changed. Otherwise,
  /// the existing node taints will be *replaced* with the provided taints.
  public var taints: NodeTaints? = nil

  /// The desired node labels to be applied to all nodes in the node pool.
  /// If this field is not present, the labels will not be changed. Otherwise,
  /// the existing node labels will be *replaced* with the provided labels.
  public var labels: NodeLabels? = nil

  /// Parameters that can be configured on Linux nodes.
  public var linuxNodeConfig: LinuxNodeConfig? = nil

  /// Node kubelet configs.
  public var kubeletConfig: NodeKubeletConfig? = nil

  /// Node network config.
  public var nodeNetworkConfig: NodeNetworkConfig? = nil

  /// GCFS config.
  public var gcfsConfig: GcfsConfig? = nil

  /// Confidential nodes config.
  /// All the nodes in the node pool will be Confidential VM once enabled.
  public var confidentialNodes: ConfidentialNodes? = nil

  /// Enable or disable gvnic on the node pool.
  public var gvnic: VirtualNIC? = nil

  /// The current etag of the node pool.
  /// If an etag is provided and does not match the current etag of the node
  /// pool, update will be blocked and an ABORTED error will be returned.
  public var etag: Swift.String = Swift.String()

  /// Enable or disable NCCL fast socket for the node pool.
  public var fastSocket: FastSocket? = nil

  /// Logging configuration.
  public var loggingConfig: NodePoolLoggingConfig? = nil

  /// The resource labels for the node pool to use to annotate any related
  /// Google Compute Engine resources.
  public var resourceLabels: ResourceLabels? = nil

  /// Parameters that can be configured on Windows nodes.
  public var windowsNodeConfig: WindowsNodeConfig? = nil

  /// A list of hardware accelerators to be attached to each node.
  /// See
  /// https://cloud.google.com/compute/docs/gpus
  /// for more information about support for GPUs.
  public var accelerators: [AcceleratorConfig] = []

  /// Optional. The desired [Google Compute Engine machine
  /// type](https://cloud.google.com/compute/docs/machine-types)
  /// for nodes in the node pool. Initiates an upgrade operation that migrates
  /// the nodes in the node pool to the specified machine type.
  public var machineType: Swift.String = Swift.String()

  /// Optional. The desired disk type (e.g. 'pd-standard', 'pd-ssd' or
  /// 'pd-balanced') for nodes in the node pool.
  /// Initiates an upgrade operation that migrates the nodes in the
  /// node pool to the specified disk type.
  public var diskType: Swift.String = Swift.String()

  /// Optional. The desired disk size for nodes in the node pool specified in GB.
  /// The smallest allowed disk size is 10GB.
  /// Initiates an upgrade operation that migrates the nodes in the
  /// node pool to the specified disk size.
  public var diskSizeGb: Swift.Int64 = Swift.Int64()

  /// Desired resource manager tag keys and values to be attached to the nodes
  /// for managing Compute Engine firewalls using Network Firewall Policies.
  /// Existing tags will be replaced with new values.
  public var resourceManagerTags: ResourceManagerTags? = nil

  /// The desired containerd config for nodes in the node pool.
  /// Initiates an upgrade operation that recreates the nodes with the new
  /// config.
  public var containerdConfig: ContainerdConfig? = nil

  /// Specifies the configuration of queued provisioning.
  public var queuedProvisioning: NodePool.QueuedProvisioning? = nil

  /// List of Storage Pools where boot disks are provisioned.
  /// Existing Storage Pools will be replaced with storage-pools.
  public var storagePools: [Swift.String] = []

  /// The maximum duration for the nodes to exist.
  /// If unspecified, the nodes can exist indefinitely.
  public var maxRunDuration: GoogleCloudWkt.Duration? = nil

  /// Flex Start flag for enabling Flex Start VM.
  public var flexStart: Swift.Bool? = nil

  /// The desired boot disk config for nodes in the node pool.
  /// Initiates an upgrade operation that migrates the nodes in the
  /// node pool to the specified boot disk config.
  public var bootDisk: BootDisk? = nil

  /// The desired node drain configuration for nodes in the node pool.
  public var nodeDrainConfig: NodePool.NodeDrainConfig? = nil

  /// Consolidation delay defines duration after which the Cluster Autoscaler can
  /// scale down underutilized nodes. If not set, nodes are scaled down by
  /// default behavior, i.e. according to the chosen autoscaling profile.
  public var consolidationDelay: GoogleCloudWkt.Duration? = nil

  /// The taint configuration for the node pool.
  public var taintConfig: TaintConfig? = nil

  /// Initialize a new instance of `UpdateNodePoolRequest`.
  public init() {}

  /// Use `config` to return a new instance of this object, with some fields updated.
  ///
  /// Commonly used to initialize the value, for example:
  ///
  /// ```
  /// let value = UpdateNodePoolRequest().with { $0.projectId = ... }
  /// ```
  public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
    var copy = self
    try config(&copy)
    return copy
  }

  public static var _anyTypeUrl: Swift.String {
    return "type.googleapis.com/google.container.v1.UpdateNodePoolRequest"
  }
  public init(fromAny any: GoogleCloudWkt.`Any`) throws {
    self = try GoogleCloudWkt._slowAnyDeserialize(Self.self, from: any)
  }
  public func _pack() throws -> GoogleCloudWkt.Struct {
    return try GoogleCloudWkt._slowAnySerialize(message: self)
  }
}
