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

#if InstanceGroupManagers || RegionInstanceGroupManagers
  import Foundation
  import GoogleCloudWkt

  /// The list of instance statuses and the number of instances in this managed
  /// instance group that have the status. For more information about how to
  /// interpret each status check the instance lifecycle documentation.
  /// Currently only shown for TPU MIGs.
  public struct InstanceGroupManagerStatusInstanceStatusSummary: Codable, Equatable, GoogleCloudWkt
      ._AnyPackable,
    Sendable
  {
    /// Output only. The number of instances in the managed instance group
    /// that have DEPROVISIONING status.
    public var deprovisioning: Swift.Int32? = nil

    /// Output only. The number of instances that have not been created yet or
    /// have been deleted. Includes only instances that would be shown in the
    /// listManagedInstances method and not all instances that have been
    /// deleted in the lifetime of the MIG.
    /// Does not include FlexStart instances that are waiting for the resources
    /// availability, they are considered as 'pending'.
    public var nonExistent: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have PENDING status, that is FlexStart instances that are waiting
    /// for resources. Instances that do not exist because of the other reasons
    /// are counted as 'non_existent'.
    public var pending: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have PENDING_STOP status.
    public var pendingStop: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have PROVISIONING status.
    public var provisioning: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have REPAIRING status.
    public var repairing: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have RUNNING status.
    public var running: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have STAGING status.
    public var staging: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have STOPPED status.
    public var stopped: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have STOPPING status.
    public var stopping: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have SUSPENDED status.
    public var suspended: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have SUSPENDING status.
    public var suspending: Swift.Int32? = nil

    /// Output only. The number of instances in the managed instance group
    /// that have TERMINATED status.
    public var terminated: Swift.Int32? = nil

    /// Initialize a new instance of `InstanceGroupManagerStatusInstanceStatusSummary`.
    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 = InstanceGroupManagerStatusInstanceStatusSummary().with { $0.deprovisioning = ... }
    /// ```
    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.compute.v1.InstanceGroupManagerStatusInstanceStatusSummary"
    }
    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)
    }
  }
#endif
