// 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 Google Kubernetes Engine cluster.
public struct Cluster: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// The name of this cluster. The name must be unique within this project
  /// and location (e.g. zone or region), and can be up to 40 characters with
  /// the following restrictions:
  ///
  /// * Lowercase letters, numbers, and hyphens only.
  /// * Must start with a letter.
  /// * Must end with a number or a letter.
  public var name: Swift.String = Swift.String()

  /// An optional description of this cluster.
  public var description: Swift.String = Swift.String()

  /// The number of nodes to create in this cluster. You must ensure that your
  /// Compute Engine [resource
  /// quota](https://cloud.google.com/compute/quotas)
  /// is sufficient for this number of instances. You must also have available
  /// firewall and routes quota.
  /// For requests, this field should only be used in lieu of a
  /// "node_pool" object, since this configuration (along with the
  /// "node_config") will be used to create a "NodePool" object with an
  /// auto-generated name. Do not use this and a node_pool at the same time.
  ///
  /// This field is deprecated, use node_pool.initial_node_count instead.
  @available(*, deprecated)
  public var initialNodeCount: Swift.Int32 = Swift.Int32()

  /// Parameters used in creating the cluster's nodes.
  /// For requests, this field should only be used in lieu of a
  /// "node_pool" object, since this configuration (along with the
  /// "initial_node_count") will be used to create a "NodePool" object with an
  /// auto-generated name. Do not use this and a node_pool at the same time.
  /// For responses, this field will be populated with the node configuration of
  /// the first node pool. (For configuration of each node pool, see
  /// `node_pool.config`)
  ///
  /// If unspecified, the defaults are used.
  /// This field is deprecated, use node_pool.config instead.
  @available(*, deprecated)
  public var nodeConfig: NodeConfig? = nil

  /// The authentication information for accessing the master endpoint.
  /// If unspecified, the defaults are used:
  /// For clusters before v1.12, if master_auth is unspecified, `username` will
  /// be set to "admin", a random password will be generated, and a client
  /// certificate will be issued.
  public var masterAuth: MasterAuth? = nil

  /// The logging service the cluster should use to write logs.
  /// Currently available options:
  ///
  /// * `logging.googleapis.com/kubernetes` - The Cloud Logging
  /// service with a Kubernetes-native resource model
  /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer
  ///   available as of GKE 1.15).
  /// * `none` - no logs will be exported from the cluster.
  ///
  /// If left as an empty string,`logging.googleapis.com/kubernetes` will be
  /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions.
  public var loggingService: Swift.String = Swift.String()

  /// The monitoring service the cluster should use to write metrics.
  /// Currently available options:
  ///
  /// * `monitoring.googleapis.com/kubernetes` - The Cloud Monitoring
  /// service with a Kubernetes-native resource model
  /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no
  ///   longer available as of GKE 1.15).
  /// * `none` - No metrics will be exported from the cluster.
  ///
  /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be
  /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions.
  public var monitoringService: Swift.String = Swift.String()

  /// The name of the Google Compute Engine
  /// [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks)
  /// to which the cluster is connected. If left unspecified, the `default`
  /// network will be used.
  public var network: Swift.String = Swift.String()

  /// The IP address range of the container pods in this cluster, in
  /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  /// notation (e.g. `10.96.0.0/14`). Leave blank to have
  /// one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
  public var clusterIpv4Cidr: Swift.String = Swift.String()

  /// Configurations for the various addons available to run in the cluster.
  public var addonsConfig: AddonsConfig? = nil

  /// The name of the Google Compute Engine
  /// [subnetwork](https://cloud.google.com/compute/docs/subnetworks)
  /// to which the cluster is connected.
  public var subnetwork: Swift.String = Swift.String()

  /// The node pools associated with this cluster.
  /// This field should not be set if "node_config" or "initial_node_count" are
  /// specified.
  public var nodePools: [NodePool] = []

  /// The list of Google Compute Engine
  /// [zones](https://cloud.google.com/compute/docs/zones#available)
  /// in which the cluster's nodes should be located.
  ///
  /// This field provides a default value if
  /// [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations)
  /// are not specified during node pool creation.
  ///
  /// Warning: changing cluster locations will update the
  /// [NodePool.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools#NodePool.FIELDS.locations)
  /// of all node pools and will result in nodes being added and/or removed.
  public var locations: [Swift.String] = []

  /// Kubernetes alpha features are enabled on this cluster. This includes alpha
  /// API groups (e.g. v1alpha1) and features that may not be production ready in
  /// the kubernetes version of the master and nodes.
  /// The cluster has no SLA for uptime and master/node upgrades are disabled.
  /// Alpha enabled clusters are automatically deleted thirty days after
  /// creation.
  public var enableKubernetesAlpha: Swift.Bool = Swift.Bool()

  /// The list of user specified Kubernetes feature gates.
  /// Each string represents the activation status of a feature gate (e.g.
  /// "featureX=true" or "featureX=false")
  public var alphaClusterFeatureGates: [Swift.String] = []

  /// The resource labels for the cluster to use to annotate any related
  /// Google Compute Engine resources.
  public var resourceLabels: [Swift.String: Swift.String] = [:]

  /// The fingerprint of the set of labels for this cluster.
  public var labelFingerprint: Swift.String = Swift.String()

  /// Configuration for the legacy ABAC authorization mode.
  public var legacyAbac: LegacyAbac? = nil

  /// Configuration options for the NetworkPolicy feature.
  public var networkPolicy: NetworkPolicy? = nil

  /// Configuration for cluster IP allocation.
  public var ipAllocationPolicy: IPAllocationPolicy? = nil

  /// The configuration options for master authorized networks feature.
  ///
  /// Deprecated: Use
  /// [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config]
  /// instead.
  ///
  /// [google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config]: <doc:ControlPlaneEndpointsConfig/IPEndpointsConfig/authorizedNetworksConfig>
  @available(*, deprecated)
  public var masterAuthorizedNetworksConfig: MasterAuthorizedNetworksConfig? = nil

  /// Configure the maintenance policy for this cluster.
  public var maintenancePolicy: MaintenancePolicy? = nil

  /// Configuration for Binary Authorization.
  public var binaryAuthorization: BinaryAuthorization? = nil

  /// Cluster-level autoscaling configuration.
  public var autoscaling: ClusterAutoscaling? = nil

  /// Configuration for cluster networking.
  public var networkConfig: NetworkConfig? = nil

  /// The default constraint on the maximum number of pods that can be run
  /// simultaneously on a node in the node pool of this cluster. Only honored
  /// if cluster created with IP Alias support.
  public var defaultMaxPodsConstraint: MaxPodsConstraint? = nil

  /// Configuration for exporting resource usages. Resource usage export is
  /// disabled when this config is unspecified.
  public var resourceUsageExportConfig: ResourceUsageExportConfig? = nil

  /// Configuration controlling RBAC group membership information.
  public var authenticatorGroupsConfig: AuthenticatorGroupsConfig? = nil

  /// Configuration for private cluster.
  public var privateClusterConfig: PrivateClusterConfig? = nil

  /// Configuration of etcd encryption.
  public var databaseEncryption: DatabaseEncryption? = nil

  /// Cluster-level Vertical Pod Autoscaling configuration.
  public var verticalPodAutoscaling: VerticalPodAutoscaling? = nil

  /// Shielded Nodes configuration.
  public var shieldedNodes: ShieldedNodes? = nil

  /// Release channel configuration. If left unspecified on cluster creation and
  /// a version is specified, the cluster is enrolled in the most mature release
  /// channel where the version is available (first checking STABLE, then
  /// REGULAR, and finally RAPID). Otherwise, if no release channel
  /// configuration and no version is specified, the cluster is enrolled in the
  /// REGULAR channel with its default version.
  public var releaseChannel: ReleaseChannel? = nil

  /// Configuration for the use of Kubernetes Service Accounts in IAM policies.
  public var workloadIdentityConfig: WorkloadIdentityConfig? = nil

  /// Configuration for issuance of mTLS keys and certificates to Kubernetes
  /// pods.
  public var meshCertificates: MeshCertificates? = nil

  /// Configuration for the fine-grained cost management feature.
  public var costManagementConfig: CostManagementConfig? = nil

  /// Notification configuration of the cluster.
  public var notificationConfig: NotificationConfig? = nil

  /// Configuration of Confidential Nodes.
  /// All the nodes in the cluster will be Confidential VM once enabled.
  public var confidentialNodes: ConfidentialNodes? = nil

  /// Configuration for Identity Service component.
  public var identityServiceConfig: IdentityServiceConfig? = nil

  /// Output only. Server-defined URL for the resource.
  public var selfLink: Swift.String = Swift.String()

  /// Output only. The name of the Google Compute Engine
  /// [zone](https://cloud.google.com/compute/docs/zones#available)
  /// in which the cluster resides. This field is deprecated, use location
  /// instead.
  @available(*, deprecated)
  public var zone: Swift.String = Swift.String()

  /// Output only. The IP address of this cluster's master endpoint.
  /// The endpoint can be accessed from the internet at
  /// `https://username:password@endpoint/`.
  ///
  /// See the `masterAuth` property of this resource for username and
  /// password information.
  public var endpoint: Swift.String = Swift.String()

  /// The initial Kubernetes version for this cluster.  Valid versions are those
  /// found in validMasterVersions returned by getServerConfig.  The version can
  /// be upgraded over time; such upgrades are reflected in
  /// currentMasterVersion and currentNodeVersion.
  ///
  /// 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 default Kubernetes version
  public var initialClusterVersion: Swift.String = Swift.String()

  /// Output only. The current software version of the master endpoint.
  public var currentMasterVersion: Swift.String = Swift.String()

  /// Output only. Deprecated, use
  /// [NodePools.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools)
  /// instead. The current version of the node software components. If they are
  /// currently at multiple versions because they're in the process of being
  /// upgraded, this reflects the minimum version of all nodes.
  @available(*, deprecated)
  public var currentNodeVersion: Swift.String = Swift.String()

  /// Output only. The time the cluster was created, in
  /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  public var createTime: Swift.String = Swift.String()

  /// Output only. The current status of this cluster.
  public var status: Cluster.Status = Cluster.Status()

  /// Output only. Deprecated. Use conditions instead.
  /// Additional information about the current status of this
  /// cluster, if available.
  @available(*, deprecated)
  public var statusMessage: Swift.String = Swift.String()

  /// Output only. The size of the address space on each node for hosting
  /// containers. This is provisioned from within the `container_ipv4_cidr`
  /// range. This field will only be set when cluster is in route-based network
  /// mode.
  public var nodeIpv4CidrSize: Swift.Int32 = Swift.Int32()

  /// Output only. The IP address range of the Kubernetes services in
  /// this cluster, in
  /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  /// notation (e.g. `1.2.3.4/29`). Service addresses are
  /// typically put in the last `/16` from the container CIDR.
  public var servicesIpv4Cidr: Swift.String = Swift.String()

  /// Output only. Deprecated. Use node_pools.instance_group_urls.
  @available(*, deprecated)
  public var instanceGroupUrls: [Swift.String] = []

  /// Output only. The number of nodes currently in the cluster. Deprecated.
  /// Call Kubernetes API directly to retrieve node information.
  @available(*, deprecated)
  public var currentNodeCount: Swift.Int32 = Swift.Int32()

  /// Output only. The time the cluster will be automatically
  /// deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  public var expireTime: Swift.String = Swift.String()

  /// Output only. The name of the Google Compute Engine
  /// [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
  /// or
  /// [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available)
  /// in which the cluster resides.
  public var location: Swift.String = Swift.String()

  /// Enable the ability to use Cloud TPUs in this cluster.
  /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
  /// date for 2VM TPU is 2025-04-25.
  @available(*, deprecated)
  public var enableTpu: Swift.Bool = Swift.Bool()

  /// Output only. The IP address range of the Cloud TPUs in this cluster, in
  /// [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  /// notation (e.g. `1.2.3.4/29`).
  /// This field is deprecated due to the deprecation of 2VM TPU. The end of life
  /// date for 2VM TPU is 2025-04-25.
  @available(*, deprecated)
  public var tpuIpv4CidrBlock: Swift.String = Swift.String()

  /// Which conditions caused the current cluster state.
  public var conditions: [StatusCondition] = []

  /// Autopilot configuration for the cluster.
  public var autopilot: Autopilot? = nil

  /// Output only. Unique id for the cluster.
  public var id: Swift.String = Swift.String()

  /// Default NodePool settings for the entire cluster. These settings are
  /// overridden if specified on the specific NodePool object.
  public var nodePoolDefaults: NodePoolDefaults? = nil

  /// Logging configuration for the cluster.
  public var loggingConfig: LoggingConfig? = nil

  /// Monitoring configuration for the cluster.
  public var monitoringConfig: MonitoringConfig? = nil

  /// Node pool configs that apply to all auto-provisioned node pools
  /// in autopilot clusters and node auto-provisioning enabled clusters.
  public var nodePoolAutoConfig: NodePoolAutoConfig? = nil

  /// The config for pod autoscaling.
  public var podAutoscaling: PodAutoscaling? = nil

  /// This checksum is computed by the server based on the value of cluster
  /// fields, and may be sent on update requests to ensure the client has an
  /// up-to-date value before proceeding.
  public var etag: Swift.String = Swift.String()

  /// Fleet information for the cluster.
  public var fleet: Fleet? = nil

  /// Optional. Enable/Disable Security Posture API features for the cluster.
  public var securityPostureConfig: SecurityPostureConfig? = nil

  /// Configuration for all cluster's control plane endpoints.
  public var controlPlaneEndpointsConfig: ControlPlaneEndpointsConfig? = nil

  /// Beta APIs Config
  public var enableK8SBetaApis: K8sBetaAPIConfig? = nil

  /// GKE Enterprise Configuration.
  ///
  /// Deprecated: GKE Enterprise features are now available without an Enterprise
  /// tier.
  @available(*, deprecated)
  public var enterpriseConfig: EnterpriseConfig? = nil

  /// Secret CSI driver configuration.
  public var secretManagerConfig: SecretManagerConfig? = nil

  /// Optional. Deprecated: Compliance Posture is no longer supported.
  /// For more details, see
  /// https://cloud.google.com/kubernetes-engine/docs/deprecations/posture-management-deprecation.
  ///
  /// Enable/Disable Compliance Posture features for the cluster.
  @available(*, deprecated)
  public var compliancePostureConfig: CompliancePostureConfig? = nil

  /// Output only. Reserved for future use.
  public var satisfiesPzs: Swift.Bool? = nil

  /// Output only. Reserved for future use.
  public var satisfiesPzi: Swift.Bool? = nil

  /// The Custom keys configuration for the cluster.
  public var userManagedKeysConfig: UserManagedKeysConfig? = nil

  /// RBACBindingConfig allows user to restrict ClusterRoleBindings an
  /// RoleBindings that can be created.
  public var rbacBindingConfig: RBACBindingConfig? = nil

  /// Configuration for GKE auto upgrades.
  public var gkeAutoUpgradeConfig: GkeAutoUpgradeConfig? = nil

  /// Configuration for limiting anonymous access to all endpoints except the
  /// health checks.
  public var anonymousAuthenticationConfig: AnonymousAuthenticationConfig? = nil

  /// Optional. Configuration for scheduled upgrades.
  public var scheduleUpgradeConfig: ScheduleUpgradeConfig? = nil

  /// Configuration for sync Secret Manager secrets as k8s secrets.
  public var secretSyncConfig: SecretSyncConfig? = nil

  /// Configuration for Managed OpenTelemetry pipeline.
  public var managedOpentelemetryConfig: ManagedOpenTelemetryConfig? = nil

  /// Configuration for control plane egress control.
  public var controlPlaneEgress: ControlPlaneEgress? = nil

  /// Configuration for Managed Machine Learning Diagnostics.
  public var managedMachineLearningDiagnosticsConfig: ManagedMachineLearningDiagnosticsConfig? = nil

  /// Optional. Configuration for Node Creation Mode.
  public var nodeCreationConfig: NodeCreationConfig? = 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
  }

  private enum CodingKeys: Swift.String, CodingKey {
    case name = "name"
    case description = "description"
    case initialNodeCount = "initialNodeCount"
    case nodeConfig = "nodeConfig"
    case masterAuth = "masterAuth"
    case loggingService = "loggingService"
    case monitoringService = "monitoringService"
    case network = "network"
    case clusterIpv4Cidr = "clusterIpv4Cidr"
    case addonsConfig = "addonsConfig"
    case subnetwork = "subnetwork"
    case nodePools = "nodePools"
    case locations = "locations"
    case enableKubernetesAlpha = "enableKubernetesAlpha"
    case alphaClusterFeatureGates = "alphaClusterFeatureGates"
    case resourceLabels = "resourceLabels"
    case labelFingerprint = "labelFingerprint"
    case legacyAbac = "legacyAbac"
    case networkPolicy = "networkPolicy"
    case ipAllocationPolicy = "ipAllocationPolicy"
    case masterAuthorizedNetworksConfig = "masterAuthorizedNetworksConfig"
    case maintenancePolicy = "maintenancePolicy"
    case binaryAuthorization = "binaryAuthorization"
    case autoscaling = "autoscaling"
    case networkConfig = "networkConfig"
    case defaultMaxPodsConstraint = "defaultMaxPodsConstraint"
    case resourceUsageExportConfig = "resourceUsageExportConfig"
    case authenticatorGroupsConfig = "authenticatorGroupsConfig"
    case privateClusterConfig = "privateClusterConfig"
    case databaseEncryption = "databaseEncryption"
    case verticalPodAutoscaling = "verticalPodAutoscaling"
    case shieldedNodes = "shieldedNodes"
    case releaseChannel = "releaseChannel"
    case workloadIdentityConfig = "workloadIdentityConfig"
    case meshCertificates = "meshCertificates"
    case costManagementConfig = "costManagementConfig"
    case notificationConfig = "notificationConfig"
    case confidentialNodes = "confidentialNodes"
    case identityServiceConfig = "identityServiceConfig"
    case selfLink = "selfLink"
    case zone = "zone"
    case endpoint = "endpoint"
    case initialClusterVersion = "initialClusterVersion"
    case currentMasterVersion = "currentMasterVersion"
    case currentNodeVersion = "currentNodeVersion"
    case createTime = "createTime"
    case status = "status"
    case statusMessage = "statusMessage"
    case nodeIpv4CidrSize = "nodeIpv4CidrSize"
    case servicesIpv4Cidr = "servicesIpv4Cidr"
    case instanceGroupUrls = "instanceGroupUrls"
    case currentNodeCount = "currentNodeCount"
    case expireTime = "expireTime"
    case location = "location"
    case enableTpu = "enableTpu"
    case tpuIpv4CidrBlock = "tpuIpv4CidrBlock"
    case conditions = "conditions"
    case autopilot = "autopilot"
    case id = "id"
    case nodePoolDefaults = "nodePoolDefaults"
    case loggingConfig = "loggingConfig"
    case monitoringConfig = "monitoringConfig"
    case nodePoolAutoConfig = "nodePoolAutoConfig"
    case podAutoscaling = "podAutoscaling"
    case etag = "etag"
    case fleet = "fleet"
    case securityPostureConfig = "securityPostureConfig"
    case controlPlaneEndpointsConfig = "controlPlaneEndpointsConfig"
    case enableK8SBetaApis = "enableK8sBetaApis"
    case enterpriseConfig = "enterpriseConfig"
    case secretManagerConfig = "secretManagerConfig"
    case compliancePostureConfig = "compliancePostureConfig"
    case satisfiesPzs = "satisfiesPzs"
    case satisfiesPzi = "satisfiesPzi"
    case userManagedKeysConfig = "userManagedKeysConfig"
    case rbacBindingConfig = "rbacBindingConfig"
    case gkeAutoUpgradeConfig = "gkeAutoUpgradeConfig"
    case anonymousAuthenticationConfig = "anonymousAuthenticationConfig"
    case scheduleUpgradeConfig = "scheduleUpgradeConfig"
    case secretSyncConfig = "secretSyncConfig"
    case managedOpentelemetryConfig = "managedOpentelemetryConfig"
    case controlPlaneEgress = "controlPlaneEgress"
    case managedMachineLearningDiagnosticsConfig = "managedMachineLearningDiagnosticsConfig"
    case nodeCreationConfig = "nodeCreationConfig"
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    self.name = try container.decode(Swift.String.self, forKey: .name)
    self.description = try container.decode(Swift.String.self, forKey: .description)
    self.initialNodeCount = try container.decode(Swift.Int32.self, forKey: .initialNodeCount)
    self.nodeConfig = try container.decodeIfPresent(NodeConfig.self, forKey: .nodeConfig)
    self.masterAuth = try container.decodeIfPresent(MasterAuth.self, forKey: .masterAuth)
    self.loggingService = try container.decode(Swift.String.self, forKey: .loggingService)
    self.monitoringService = try container.decode(Swift.String.self, forKey: .monitoringService)
    self.network = try container.decode(Swift.String.self, forKey: .network)
    self.clusterIpv4Cidr = try container.decode(Swift.String.self, forKey: .clusterIpv4Cidr)
    self.addonsConfig = try container.decodeIfPresent(AddonsConfig.self, forKey: .addonsConfig)
    self.subnetwork = try container.decode(Swift.String.self, forKey: .subnetwork)
    self.nodePools = try container.decode([NodePool].self, forKey: .nodePools)
    self.locations = try container.decode([Swift.String].self, forKey: .locations)
    self.enableKubernetesAlpha = try container.decode(
      Swift.Bool.self, forKey: .enableKubernetesAlpha)
    self.alphaClusterFeatureGates = try container.decode(
      [Swift.String].self, forKey: .alphaClusterFeatureGates)
    self.resourceLabels = try container.decode(
      [Swift.String: Swift.String].self, forKey: .resourceLabels)
    self.labelFingerprint = try container.decode(Swift.String.self, forKey: .labelFingerprint)
    self.legacyAbac = try container.decodeIfPresent(LegacyAbac.self, forKey: .legacyAbac)
    self.networkPolicy = try container.decodeIfPresent(NetworkPolicy.self, forKey: .networkPolicy)
    self.ipAllocationPolicy = try container.decodeIfPresent(
      IPAllocationPolicy.self, forKey: .ipAllocationPolicy)
    self.masterAuthorizedNetworksConfig = try container.decodeIfPresent(
      MasterAuthorizedNetworksConfig.self, forKey: .masterAuthorizedNetworksConfig)
    self.maintenancePolicy = try container.decodeIfPresent(
      MaintenancePolicy.self, forKey: .maintenancePolicy)
    self.binaryAuthorization = try container.decodeIfPresent(
      BinaryAuthorization.self, forKey: .binaryAuthorization)
    self.autoscaling = try container.decodeIfPresent(ClusterAutoscaling.self, forKey: .autoscaling)
    self.networkConfig = try container.decodeIfPresent(NetworkConfig.self, forKey: .networkConfig)
    self.defaultMaxPodsConstraint = try container.decodeIfPresent(
      MaxPodsConstraint.self, forKey: .defaultMaxPodsConstraint)
    self.resourceUsageExportConfig = try container.decodeIfPresent(
      ResourceUsageExportConfig.self, forKey: .resourceUsageExportConfig)
    self.authenticatorGroupsConfig = try container.decodeIfPresent(
      AuthenticatorGroupsConfig.self, forKey: .authenticatorGroupsConfig)
    self.privateClusterConfig = try container.decodeIfPresent(
      PrivateClusterConfig.self, forKey: .privateClusterConfig)
    self.databaseEncryption = try container.decodeIfPresent(
      DatabaseEncryption.self, forKey: .databaseEncryption)
    self.verticalPodAutoscaling = try container.decodeIfPresent(
      VerticalPodAutoscaling.self, forKey: .verticalPodAutoscaling)
    self.shieldedNodes = try container.decodeIfPresent(ShieldedNodes.self, forKey: .shieldedNodes)
    self.releaseChannel = try container.decodeIfPresent(
      ReleaseChannel.self, forKey: .releaseChannel)
    self.workloadIdentityConfig = try container.decodeIfPresent(
      WorkloadIdentityConfig.self, forKey: .workloadIdentityConfig)
    self.meshCertificates = try container.decodeIfPresent(
      MeshCertificates.self, forKey: .meshCertificates)
    self.costManagementConfig = try container.decodeIfPresent(
      CostManagementConfig.self, forKey: .costManagementConfig)
    self.notificationConfig = try container.decodeIfPresent(
      NotificationConfig.self, forKey: .notificationConfig)
    self.confidentialNodes = try container.decodeIfPresent(
      ConfidentialNodes.self, forKey: .confidentialNodes)
    self.identityServiceConfig = try container.decodeIfPresent(
      IdentityServiceConfig.self, forKey: .identityServiceConfig)
    self.selfLink = try container.decode(Swift.String.self, forKey: .selfLink)
    self.zone = try container.decode(Swift.String.self, forKey: .zone)
    self.endpoint = try container.decode(Swift.String.self, forKey: .endpoint)
    self.initialClusterVersion = try container.decode(
      Swift.String.self, forKey: .initialClusterVersion)
    self.currentMasterVersion = try container.decode(
      Swift.String.self, forKey: .currentMasterVersion)
    self.currentNodeVersion = try container.decode(Swift.String.self, forKey: .currentNodeVersion)
    self.createTime = try container.decode(Swift.String.self, forKey: .createTime)
    self.status = try container.decode(Cluster.Status.self, forKey: .status)
    self.statusMessage = try container.decode(Swift.String.self, forKey: .statusMessage)
    self.nodeIpv4CidrSize = try container.decode(Swift.Int32.self, forKey: .nodeIpv4CidrSize)
    self.servicesIpv4Cidr = try container.decode(Swift.String.self, forKey: .servicesIpv4Cidr)
    self.instanceGroupUrls = try container.decode([Swift.String].self, forKey: .instanceGroupUrls)
    self.currentNodeCount = try container.decode(Swift.Int32.self, forKey: .currentNodeCount)
    self.expireTime = try container.decode(Swift.String.self, forKey: .expireTime)
    self.location = try container.decode(Swift.String.self, forKey: .location)
    self.enableTpu = try container.decode(Swift.Bool.self, forKey: .enableTpu)
    self.tpuIpv4CidrBlock = try container.decode(Swift.String.self, forKey: .tpuIpv4CidrBlock)
    self.conditions = try container.decode([StatusCondition].self, forKey: .conditions)
    self.autopilot = try container.decodeIfPresent(Autopilot.self, forKey: .autopilot)
    self.id = try container.decode(Swift.String.self, forKey: .id)
    self.nodePoolDefaults = try container.decodeIfPresent(
      NodePoolDefaults.self, forKey: .nodePoolDefaults)
    self.loggingConfig = try container.decodeIfPresent(LoggingConfig.self, forKey: .loggingConfig)
    self.monitoringConfig = try container.decodeIfPresent(
      MonitoringConfig.self, forKey: .monitoringConfig)
    self.nodePoolAutoConfig = try container.decodeIfPresent(
      NodePoolAutoConfig.self, forKey: .nodePoolAutoConfig)
    self.podAutoscaling = try container.decodeIfPresent(
      PodAutoscaling.self, forKey: .podAutoscaling)
    self.etag = try container.decode(Swift.String.self, forKey: .etag)
    self.fleet = try container.decodeIfPresent(Fleet.self, forKey: .fleet)
    self.securityPostureConfig = try container.decodeIfPresent(
      SecurityPostureConfig.self, forKey: .securityPostureConfig)
    self.controlPlaneEndpointsConfig = try container.decodeIfPresent(
      ControlPlaneEndpointsConfig.self, forKey: .controlPlaneEndpointsConfig)
    self.enableK8SBetaApis = try container.decodeIfPresent(
      K8sBetaAPIConfig.self, forKey: .enableK8SBetaApis)
    self.enterpriseConfig = try container.decodeIfPresent(
      EnterpriseConfig.self, forKey: .enterpriseConfig)
    self.secretManagerConfig = try container.decodeIfPresent(
      SecretManagerConfig.self, forKey: .secretManagerConfig)
    self.compliancePostureConfig = try container.decodeIfPresent(
      CompliancePostureConfig.self, forKey: .compliancePostureConfig)
    self.satisfiesPzs = try container.decodeIfPresent(Swift.Bool.self, forKey: .satisfiesPzs)
    self.satisfiesPzi = try container.decodeIfPresent(Swift.Bool.self, forKey: .satisfiesPzi)
    self.userManagedKeysConfig = try container.decodeIfPresent(
      UserManagedKeysConfig.self, forKey: .userManagedKeysConfig)
    self.rbacBindingConfig = try container.decodeIfPresent(
      RBACBindingConfig.self, forKey: .rbacBindingConfig)
    self.gkeAutoUpgradeConfig = try container.decodeIfPresent(
      GkeAutoUpgradeConfig.self, forKey: .gkeAutoUpgradeConfig)
    self.anonymousAuthenticationConfig = try container.decodeIfPresent(
      AnonymousAuthenticationConfig.self, forKey: .anonymousAuthenticationConfig)
    self.scheduleUpgradeConfig = try container.decodeIfPresent(
      ScheduleUpgradeConfig.self, forKey: .scheduleUpgradeConfig)
    self.secretSyncConfig = try container.decodeIfPresent(
      SecretSyncConfig.self, forKey: .secretSyncConfig)
    self.managedOpentelemetryConfig = try container.decodeIfPresent(
      ManagedOpenTelemetryConfig.self, forKey: .managedOpentelemetryConfig)
    self.controlPlaneEgress = try container.decodeIfPresent(
      ControlPlaneEgress.self, forKey: .controlPlaneEgress)
    self.managedMachineLearningDiagnosticsConfig = try container.decodeIfPresent(
      ManagedMachineLearningDiagnosticsConfig.self, forKey: .managedMachineLearningDiagnosticsConfig
    )
    self.nodeCreationConfig = try container.decodeIfPresent(
      NodeCreationConfig.self, forKey: .nodeCreationConfig)
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.name, forKey: .name)
    try container.encode(self.description, forKey: .description)
    try container.encode(self.initialNodeCount, forKey: .initialNodeCount)
    try container.encode(self.nodeConfig, forKey: .nodeConfig)
    try container.encode(self.masterAuth, forKey: .masterAuth)
    try container.encode(self.loggingService, forKey: .loggingService)
    try container.encode(self.monitoringService, forKey: .monitoringService)
    try container.encode(self.network, forKey: .network)
    try container.encode(self.clusterIpv4Cidr, forKey: .clusterIpv4Cidr)
    try container.encode(self.addonsConfig, forKey: .addonsConfig)
    try container.encode(self.subnetwork, forKey: .subnetwork)
    try container.encode(self.nodePools, forKey: .nodePools)
    try container.encode(self.locations, forKey: .locations)
    try container.encode(self.enableKubernetesAlpha, forKey: .enableKubernetesAlpha)
    try container.encode(self.alphaClusterFeatureGates, forKey: .alphaClusterFeatureGates)
    try container.encode(self.resourceLabels, forKey: .resourceLabels)
    try container.encode(self.labelFingerprint, forKey: .labelFingerprint)
    try container.encode(self.legacyAbac, forKey: .legacyAbac)
    try container.encode(self.networkPolicy, forKey: .networkPolicy)
    try container.encode(self.ipAllocationPolicy, forKey: .ipAllocationPolicy)
    try container.encode(
      self.masterAuthorizedNetworksConfig, forKey: .masterAuthorizedNetworksConfig)
    try container.encode(self.maintenancePolicy, forKey: .maintenancePolicy)
    try container.encode(self.binaryAuthorization, forKey: .binaryAuthorization)
    try container.encode(self.autoscaling, forKey: .autoscaling)
    try container.encode(self.networkConfig, forKey: .networkConfig)
    try container.encode(self.defaultMaxPodsConstraint, forKey: .defaultMaxPodsConstraint)
    try container.encode(self.resourceUsageExportConfig, forKey: .resourceUsageExportConfig)
    try container.encode(self.authenticatorGroupsConfig, forKey: .authenticatorGroupsConfig)
    try container.encode(self.privateClusterConfig, forKey: .privateClusterConfig)
    try container.encode(self.databaseEncryption, forKey: .databaseEncryption)
    try container.encode(self.verticalPodAutoscaling, forKey: .verticalPodAutoscaling)
    try container.encode(self.shieldedNodes, forKey: .shieldedNodes)
    try container.encode(self.releaseChannel, forKey: .releaseChannel)
    try container.encode(self.workloadIdentityConfig, forKey: .workloadIdentityConfig)
    try container.encode(self.meshCertificates, forKey: .meshCertificates)
    try container.encode(self.costManagementConfig, forKey: .costManagementConfig)
    try container.encode(self.notificationConfig, forKey: .notificationConfig)
    try container.encode(self.confidentialNodes, forKey: .confidentialNodes)
    try container.encode(self.identityServiceConfig, forKey: .identityServiceConfig)
    try container.encode(self.selfLink, forKey: .selfLink)
    try container.encode(self.zone, forKey: .zone)
    try container.encode(self.endpoint, forKey: .endpoint)
    try container.encode(self.initialClusterVersion, forKey: .initialClusterVersion)
    try container.encode(self.currentMasterVersion, forKey: .currentMasterVersion)
    try container.encode(self.currentNodeVersion, forKey: .currentNodeVersion)
    try container.encode(self.createTime, forKey: .createTime)
    try container.encode(self.status, forKey: .status)
    try container.encode(self.statusMessage, forKey: .statusMessage)
    try container.encode(self.nodeIpv4CidrSize, forKey: .nodeIpv4CidrSize)
    try container.encode(self.servicesIpv4Cidr, forKey: .servicesIpv4Cidr)
    try container.encode(self.instanceGroupUrls, forKey: .instanceGroupUrls)
    try container.encode(self.currentNodeCount, forKey: .currentNodeCount)
    try container.encode(self.expireTime, forKey: .expireTime)
    try container.encode(self.location, forKey: .location)
    try container.encode(self.enableTpu, forKey: .enableTpu)
    try container.encode(self.tpuIpv4CidrBlock, forKey: .tpuIpv4CidrBlock)
    try container.encode(self.conditions, forKey: .conditions)
    try container.encode(self.autopilot, forKey: .autopilot)
    try container.encode(self.id, forKey: .id)
    try container.encode(self.nodePoolDefaults, forKey: .nodePoolDefaults)
    try container.encode(self.loggingConfig, forKey: .loggingConfig)
    try container.encode(self.monitoringConfig, forKey: .monitoringConfig)
    try container.encode(self.nodePoolAutoConfig, forKey: .nodePoolAutoConfig)
    try container.encode(self.podAutoscaling, forKey: .podAutoscaling)
    try container.encode(self.etag, forKey: .etag)
    try container.encode(self.fleet, forKey: .fleet)
    try container.encode(self.securityPostureConfig, forKey: .securityPostureConfig)
    try container.encode(self.controlPlaneEndpointsConfig, forKey: .controlPlaneEndpointsConfig)
    try container.encode(self.enableK8SBetaApis, forKey: .enableK8SBetaApis)
    try container.encode(self.enterpriseConfig, forKey: .enterpriseConfig)
    try container.encode(self.secretManagerConfig, forKey: .secretManagerConfig)
    try container.encode(self.compliancePostureConfig, forKey: .compliancePostureConfig)
    try container.encode(self.satisfiesPzs, forKey: .satisfiesPzs)
    try container.encode(self.satisfiesPzi, forKey: .satisfiesPzi)
    try container.encode(self.userManagedKeysConfig, forKey: .userManagedKeysConfig)
    try container.encode(self.rbacBindingConfig, forKey: .rbacBindingConfig)
    try container.encode(self.gkeAutoUpgradeConfig, forKey: .gkeAutoUpgradeConfig)
    try container.encode(self.anonymousAuthenticationConfig, forKey: .anonymousAuthenticationConfig)
    try container.encode(self.scheduleUpgradeConfig, forKey: .scheduleUpgradeConfig)
    try container.encode(self.secretSyncConfig, forKey: .secretSyncConfig)
    try container.encode(self.managedOpentelemetryConfig, forKey: .managedOpentelemetryConfig)
    try container.encode(self.controlPlaneEgress, forKey: .controlPlaneEgress)
    try container.encode(
      self.managedMachineLearningDiagnosticsConfig, forKey: .managedMachineLearningDiagnosticsConfig
    )
    try container.encode(self.nodeCreationConfig, forKey: .nodeCreationConfig)
  }

  /// The current status of the cluster.
  public enum Status: Codable, Equatable, Sendable {
    /// Not set.
    case unspecified
    /// The PROVISIONING state indicates the cluster is being created.
    case provisioning
    /// The RUNNING state indicates the cluster has been created and is fully
    /// usable.
    case running
    /// The RECONCILING state indicates that some work is actively being done on
    /// the cluster, such as upgrading the master or node software. Details can
    /// be found in the `statusMessage` field.
    case reconciling
    /// The STOPPING state indicates the cluster is being deleted.
    case stopping
    /// The ERROR state indicates the cluster is unusable. It will be
    /// automatically deleted. Details can be found in the `statusMessage` field.
    case error
    /// The DEGRADED state indicates the cluster requires user action to restore
    /// full functionality. Details can be found in the `statusMessage` field.
    case degraded
    /// Encodes an unknown integer value.
    ///
    /// The most common cause for an unknown values is for the service to send
    /// a value unknown to the library. We recommend you update your library to
    /// the latest version.
    case unknownIntValue(Int)
    /// Encodes an unknown string value.
    ///
    /// The most common cause for an unknown values is for the service to send
    /// a value unknown to the library. We recommend you update your library to
    /// the latest version.
    case unknownStringValue(String)

    public init() {
      self = .unspecified
    }

    /// Returns the integer value associated with the enumeration.
    ///
    /// If the enumeration was initialized with an unknown string value, this returns `nil`.
    public var intValue: Int? {
      switch self {
      case .unspecified: return 0
      case .provisioning: return 1
      case .running: return 2
      case .reconciling: return 3
      case .stopping: return 4
      case .error: return 5
      case .degraded: return 6
      case .unknownIntValue(let v): return v
      case .unknownStringValue: return nil
      }
    }

    /// Returns the string value (or name) associated with the enumeration.
    ///
    /// If the enumeration was initialized with an unknown integer value, this returns `nil`.
    public var stringValue: Swift.String? {
      switch self {
      case .unspecified: return "STATUS_UNSPECIFIED"
      case .provisioning: return "PROVISIONING"
      case .running: return "RUNNING"
      case .reconciling: return "RECONCILING"
      case .stopping: return "STOPPING"
      case .error: return "ERROR"
      case .degraded: return "DEGRADED"
      case .unknownIntValue: return nil
      case .unknownStringValue(let v): return v
      }
    }

    /// Initialize from a string value.
    ///
    /// If the value is unknown, this initializes to [`unknownStringValue`](doc:Status/unknownStringValue(_:)).
    public init(stringValue: Swift.String) {
      switch stringValue {
      case "STATUS_UNSPECIFIED": self = .unspecified
      case "PROVISIONING": self = .provisioning
      case "RUNNING": self = .running
      case "RECONCILING": self = .reconciling
      case "STOPPING": self = .stopping
      case "ERROR": self = .error
      case "DEGRADED": self = .degraded
      default: self = .unknownStringValue(stringValue)
      }
    }

    /// Initialize from an integer value.
    ///
    /// If the value is unknown, this initializes to [`unknownIntValue`](doc:Status/unknownIntValue(_:)).
    public init(intValue: Int) {
      switch intValue {
      case 0: self = .unspecified
      case 1: self = .provisioning
      case 2: self = .running
      case 3: self = .reconciling
      case 4: self = .stopping
      case 5: self = .error
      case 6: self = .degraded
      default: self = .unknownIntValue(intValue)
      }
    }

    public init(from decoder: Decoder) throws {
      let container = try decoder.singleValueContainer()
      if let v = try? container.decode(Int.self) {
        self.init(intValue: v)
        return
      }
      if let s = try? container.decode(String.self) {
        if let v = Int(s) {
          self.init(intValue: v)
        } else {
          self.init(stringValue: s)
        }
        return
      }
      throw DecodingError.dataCorruptedError(
        in: container, debugDescription: "Expected enum value, must be integer or string.")
    }

    public func encode(to encoder: Encoder) throws {
      var container = encoder.singleValueContainer()
      switch self {
      case .unspecified: return try container.encode(0)
      case .provisioning: return try container.encode(1)
      case .running: return try container.encode(2)
      case .reconciling: return try container.encode(3)
      case .stopping: return try container.encode(4)
      case .error: return try container.encode(5)
      case .degraded: return try container.encode(6)
      case .unknownIntValue(let v): return try container.encode(v)
      case .unknownStringValue(let v): return try container.encode(v)
      }
    }
  }

  public static var _anyTypeUrl: Swift.String {
    return "type.googleapis.com/google.container.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)
  }
}
