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

/// A collection of virtual machines and connected resources forming a
/// high-performance computing cluster capable of running large-scale, tightly
/// coupled workloads. A cluster combines a set a compute resources that perform
/// computations, storage resources that contain inputs and store outputs, an
/// orchestrator that is responsible for assigning jobs to compute resources, and
/// network resources that connect everything together.
public struct Cluster: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Identifier. [Relative resource name](https://google.aip.dev/122) of the
  /// cluster, in the format
  /// `projects/{project}/locations/{location}/clusters/{cluster}`.
  public var name: Swift.String = Swift.String()

  /// Optional. User-provided description of the cluster.
  public var description: Swift.String = Swift.String()

  /// Optional.
  /// [Labels](https://cloud.google.com/compute/docs/labeling-resources) applied
  /// to the cluster. Labels can be used to organize clusters and to filter them
  /// in queries.
  public var labels: [Swift.String: Swift.String] = [:]

  /// Output only. Time that the cluster was originally created.
  public var createTime: GoogleCloudWkt.Timestamp? = nil

  /// Output only. Time that the cluster was most recently updated.
  public var updateTime: GoogleCloudWkt.Timestamp? = nil

  /// Output only. Indicates whether changes to the cluster are currently in
  /// flight. If this is `true`, then the current state might not match the
  /// cluster's intended state.
  public var reconciling: Swift.Bool = Swift.Bool()

  /// Optional. Network resources available to the cluster. Must contain at most
  /// one value. Keys specify the ID of the network resource by which it can be
  /// referenced elsewhere, and must conform to
  /// [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
  /// alphanumeric, and at most 63 characters).
  public var networkResources: [Swift.String: NetworkResource] = [:]

  /// Optional. Storage resources available to the cluster. Keys specify the ID
  /// of the storage resource by which it can be referenced elsewhere, and must
  /// conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034)
  /// (lower-case, alphanumeric, and at most 63 characters).
  public var storageResources: [Swift.String: StorageResource] = [:]

  /// Optional. Compute resources available to the cluster. Keys specify the ID
  /// of the compute resource by which it can be referenced elsewhere, and must
  /// conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034)
  /// (lower-case, alphanumeric, and at most 63 characters).
  public var computeResources: [Swift.String: ComputeResource] = [:]

  /// Optional. Orchestrator that is responsible for scheduling and running jobs
  /// on the cluster.
  public var orchestrator: Orchestrator? = nil

  /// Initialize a new instance of `Cluster`.
  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 = Cluster().with { $0.name = ... }
  /// ```
  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.hypercomputecluster.v1.Cluster"
  }
  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)
  }
}
