// 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

/// UpdateSettings control the level of parallelism and the level of
/// disruption caused during the update of a node pool.
///
/// These settings are applicable when the node pool update requires replacing
/// the existing node pool nodes with the updated ones.
///
/// UpdateSettings are optional. When UpdateSettings are not specified during the
/// node pool creation, a default is chosen based on the parent cluster's
/// version. For clusters with minor version 1.27 and later, a default
/// surge_settings configuration with max_surge = 1 and max_unavailable = 0 is
/// used. For clusters with older versions, node pool updates use the traditional
/// rolling update mechanism of updating one node at a time in a
/// "terminate before create" fashion and update_settings is not applicable.
///
/// Set the surge_settings parameter to use the Surge Update mechanism for
/// the rolling update of node pool nodes.
/// 1. max_surge controls the number of additional nodes that can be created
/// beyond the current size of the node pool temporarily for the time of the
/// update to increase the number of available nodes.
/// 2. max_unavailable controls the number of nodes that can be simultaneously
/// unavailable during the update.
/// 3. (max_surge + max_unavailable) determines the level of parallelism (i.e.,
/// the number of nodes being updated at the same time).
@available(*, deprecated)
public struct UpdateSettings: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Optional. Settings for surge update.
  public var surgeSettings: SurgeSettings? = nil

  /// Initialize a new instance of `UpdateSettings`.
  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 = UpdateSettings().with { $0.surgeSettings = ... }
  /// ```
  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.cloud.gkemulticloud.v1.UpdateSettings"
  }
  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)
  }
}
