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

/// ClusterUpdate describes an update to the cluster. Exactly one update can
/// be applied to a cluster with each request, so at most one field can be
/// provided.
public struct ClusterUpdate: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// 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 desiredNodeVersion: 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 desiredMonitoringService: Swift.String = Swift.String()

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

  /// The node pool to be upgraded. This field is mandatory if
  /// "desired_node_version", "desired_image_family" or
  /// "desired_node_pool_autoscaling" is specified and there is more than one
  /// node pool on the cluster.
  public var desiredNodePoolId: Swift.String = Swift.String()

  /// The desired image type for the node pool.
  /// NOTE: Set the "desired_node_pool" field as well.
  public var desiredImageType: Swift.String = Swift.String()

  /// The desired name of the image to use for this node.
  /// This is used to create clusters using a custom image.
  /// NOTE: Set the "desired_node_pool" field as well.
  public var desiredImage: Swift.String = Swift.String()

  /// The project containing the desired image to use for this node.
  /// This is used to create clusters using a custom image.
  /// NOTE: Set the "desired_node_pool" field as well.
  public var desiredImageProject: Swift.String = Swift.String()

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

  /// Configuration for Workload Identity.
  public var desiredWorkloadIdentityConfig: WorkloadIdentityConfig? = nil

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

  /// Configuration for Shielded Nodes.
  public var desiredShieldedNodes: ShieldedNodes? = nil

  /// The desired configuration for the fine-grained cost management feature.
  public var desiredCostManagementConfig: CostManagementConfig? = nil

  /// DNSConfig contains clusterDNS config for this cluster.
  public var desiredDnsConfig: DNSConfig? = nil

  /// Autoscaler configuration for the node pool specified in
  /// desired_node_pool_id. If there is only one pool in the
  /// cluster and desired_node_pool_id is not provided then
  /// the change applies to that single node pool.
  public var desiredNodePoolAutoscaling: NodePoolAutoscaling? = nil

  /// The desired list of Google Compute Engine
  /// [zones](https://cloud.google.com/compute/docs/zones#available)
  /// in which the cluster's nodes should be located.
  ///
  /// This list must always include the cluster's primary zone.
  ///
  /// Warning: changing cluster locations will update the locations of all node
  /// pools and will result in nodes being added and/or removed.
  public var desiredLocations: [Swift.String] = []

  /// The desired configuration options for master authorized networks feature.
  ///
  /// Deprecated: Use
  /// desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config
  /// instead.
  @available(*, deprecated)
  public var desiredMasterAuthorizedNetworksConfig: MasterAuthorizedNetworksConfig? = nil

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

  /// The desired configuration options for the Binary Authorization feature.
  public var desiredBinaryAuthorization: BinaryAuthorization? = 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 desiredLoggingService: Swift.String = Swift.String()

  /// The desired configuration for exporting resource usage.
  public var desiredResourceUsageExportConfig: ResourceUsageExportConfig? = nil

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

  /// The desired private cluster configuration. master_global_access_config is
  /// the only field that can be changed via this field.
  /// See also
  /// [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint]
  /// for modifying other fields within
  /// [PrivateClusterConfig][google.container.v1.PrivateClusterConfig].
  ///
  /// Deprecated: Use
  /// desired_control_plane_endpoints_config.ip_endpoints_config.global_access
  /// instead.
  ///
  /// [google.container.v1.ClusterUpdate.desired_enable_private_endpoint]: <doc:ClusterUpdate/desiredEnablePrivateEndpoint>
  /// [google.container.v1.PrivateClusterConfig]: <doc:PrivateClusterConfig>
  @available(*, deprecated)
  public var desiredPrivateClusterConfig: PrivateClusterConfig? = nil

  /// The desired config of Intra-node visibility.
  public var desiredIntraNodeVisibilityConfig: IntraNodeVisibilityConfig? = nil

  /// The desired status of whether to disable default sNAT for this cluster.
  public var desiredDefaultSnatStatus: DefaultSnatStatus? = nil

  /// The desired release channel configuration.
  public var desiredReleaseChannel: ReleaseChannel? = nil

  /// The desired L4 Internal Load Balancer Subsetting configuration.
  public var desiredL4IlbSubsettingConfig: ILBSubsettingConfig? = nil

  /// The desired datapath provider for the cluster.
  public var desiredDatapathProvider: DatapathProvider = DatapathProvider()

  /// The desired state of IPv6 connectivity to Google Services.
  public var desiredPrivateIpv6GoogleAccess: PrivateIPv6GoogleAccess = PrivateIPv6GoogleAccess()

  /// The desired notification configuration.
  public var desiredNotificationConfig: NotificationConfig? = nil

  /// The desired authenticator groups config for the cluster.
  public var desiredAuthenticatorGroupsConfig: AuthenticatorGroupsConfig? = nil

  /// The desired logging configuration.
  public var desiredLoggingConfig: LoggingConfig? = nil

  /// The desired monitoring configuration.
  public var desiredMonitoringConfig: MonitoringConfig? = nil

  /// The desired Identity Service component configuration.
  public var desiredIdentityServiceConfig: IdentityServiceConfig? = nil

  /// ServiceExternalIPsConfig specifies the config for the use of Services with
  /// ExternalIPs field.
  public var desiredServiceExternalIpsConfig: ServiceExternalIPsConfig? = nil

  /// Enable/Disable private endpoint for the cluster's master.
  ///
  /// Deprecated: Use
  /// desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint
  /// instead. Note that the value of enable_public_endpoint is reversed: if
  /// enable_private_endpoint is false, then enable_public_endpoint will be true.
  @available(*, deprecated)
  public var desiredEnablePrivateEndpoint: Swift.Bool? = nil

  /// Override the default setting of whether future created
  /// nodes have private IP addresses only, namely
  /// [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes]
  ///
  /// [google.container.v1.NetworkConfig.default_enable_private_nodes]: <doc:NetworkConfig/defaultEnablePrivateNodes>
  public var desiredDefaultEnablePrivateNodes: Swift.Bool? = nil

  /// [Control plane
  /// endpoints][google.container.v1.Cluster.control_plane_endpoints_config]
  /// configuration.
  ///
  /// [google.container.v1.Cluster.control_plane_endpoints_config]: <doc:Cluster/controlPlaneEndpointsConfig>
  public var desiredControlPlaneEndpointsConfig: ControlPlaneEndpointsConfig? = nil

  /// The Kubernetes version to change the master to.
  ///
  /// 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 desiredMasterVersion: Swift.String = Swift.String()

  /// The desired GCFS config for the cluster
  public var desiredGcfsConfig: GcfsConfig? = nil

  /// The desired network tags that apply to all auto-provisioned node pools
  /// in autopilot clusters and node auto-provisioning enabled clusters.
  public var desiredNodePoolAutoConfigNetworkTags: NetworkTags? = nil

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

  /// The desired config of Gateway API on this cluster.
  public var desiredGatewayApiConfig: GatewayAPIConfig? = nil

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

  /// The desired node pool logging configuration defaults for the cluster.
  public var desiredNodePoolLoggingConfig: NodePoolLoggingConfig? = nil

  /// The desired fleet configuration for the cluster.
  public var desiredFleet: Fleet? = nil

  /// The desired stack type of the cluster.
  /// If a stack type is provided and does not match the current stack type of
  /// the cluster, update will attempt to change the stack type to the new type.
  public var desiredStackType: StackType = StackType()

  /// The additional pod ranges to be added to the cluster. These pod ranges
  /// can be used by node pools to allocate pod IPs.
  public var additionalPodRangesConfig: AdditionalPodRangesConfig? = nil

  /// The additional pod ranges that are to be removed from the cluster.
  /// The pod ranges specified here must have been specified earlier in the
  /// 'additional_pod_ranges_config' argument.
  public var removedAdditionalPodRangesConfig: AdditionalPodRangesConfig? = nil

  /// Kubernetes open source beta apis enabled on the cluster. Only beta apis
  public var enableK8SBetaApis: K8sBetaAPIConfig? = nil

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

  /// The desired network performance config.
  public var desiredNetworkPerformanceConfig: NetworkConfig.ClusterNetworkPerformanceConfig? = nil

  /// Enable/Disable FQDN Network Policy for the cluster.
  public var desiredEnableFqdnNetworkPolicy: Swift.Bool? = nil

  /// WorkloadPolicyConfig is the configuration related to GCW workload policy
  public var desiredAutopilotWorkloadPolicyConfig: WorkloadPolicyConfig? = nil

  /// Desired Beta APIs to be enabled for cluster.
  public var desiredK8SBetaApis: K8sBetaAPIConfig? = nil

  /// The desired containerd config for the cluster.
  public var desiredContainerdConfig: ContainerdConfig? = nil

  /// Enable/Disable Multi-Networking for the cluster
  public var desiredEnableMultiNetworking: Swift.Bool? = nil

  /// The desired resource manager tags that apply to all auto-provisioned node
  /// pools in autopilot clusters and node auto-provisioning enabled clusters.
  public var desiredNodePoolAutoConfigResourceManagerTags: ResourceManagerTags? = nil

  /// Specify the details of in-transit encryption.
  public var desiredInTransitEncryptionConfig: InTransitEncryptionConfig? = nil

  /// Enable/Disable Cilium Clusterwide Network Policy for the cluster.
  public var desiredEnableCiliumClusterwideNetworkPolicy: Swift.Bool? = nil

  /// Enable/Disable Secret Manager Config.
  public var desiredSecretManagerConfig: SecretManagerConfig? = nil

  /// 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 desiredCompliancePostureConfig: CompliancePostureConfig? = nil

  /// The desired node kubelet config for the cluster.
  public var desiredNodeKubeletConfig: NodeKubeletConfig? = nil

  /// The desired node kubelet config for all auto-provisioned node pools
  /// in autopilot clusters and node auto-provisioning enabled clusters.
  public var desiredNodePoolAutoConfigKubeletConfig: NodeKubeletConfig? = nil

  /// The Custom keys configuration for the cluster.
  ///
  /// This field is deprecated.
  /// Use
  /// [ClusterUpdate.desired_user_managed_keys_config][google.container.v1.ClusterUpdate.desired_user_managed_keys_config]
  /// instead.
  ///
  /// [google.container.v1.ClusterUpdate.desired_user_managed_keys_config]: <doc:ClusterUpdate/desiredUserManagedKeysConfig>
  @available(*, deprecated)
  public var userManagedKeysConfig: UserManagedKeysConfig? = nil

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

  /// The desired config for additional subnetworks attached to the cluster.
  public var desiredAdditionalIpRangesConfig: DesiredAdditionalIPRangesConfig? = nil

  /// The desired enterprise configuration for the cluster.
  ///
  /// Deprecated: GKE Enterprise features are now available without an Enterprise
  /// tier.
  @available(*, deprecated)
  public var desiredEnterpriseConfig: DesiredEnterpriseConfig? = nil

  /// AutoIpamConfig contains all information related to Auto IPAM
  public var desiredAutoIpamConfig: AutoIpamConfig? = nil

  /// Enable/Disable L4 LB VPC firewall reconciliation for the cluster.
  public var desiredDisableL4LbFirewallReconciliation: Swift.Bool? = nil

  /// The desired Linux node config for all auto-provisioned node pools
  /// in autopilot clusters and node auto-provisioning enabled clusters.
  ///
  /// Currently only `cgroup_mode` can be set here.
  public var desiredNodePoolAutoConfigLinuxNodeConfig: LinuxNodeConfig? = nil

  /// The desired user managed keys config for the cluster.
  public var desiredUserManagedKeysConfig: UserManagedKeysConfig? = nil

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

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

  /// The desired network tier configuration for the cluster.
  public var desiredNetworkTierConfig: NetworkTierConfig? = nil

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

  /// The desired privileged admission config for the cluster.
  public var desiredPrivilegedAdmissionConfig: PrivilegedAdmissionConfig? = nil

  /// The desired control plane egress control config for the cluster.
  public var desiredControlPlaneEgress: ControlPlaneEgress? = nil

  /// The desired managed open telemetry configuration.
  public var desiredManagedOpentelemetryConfig: ManagedOpenTelemetryConfig? = nil

  /// The desired autopilot cluster policies that to be enforced in the cluster.
  public var desiredAutopilotClusterPolicyConfig: ClusterPolicyConfig? = nil

  /// The desired managed machine learning diagnostics configuration.
  public var desiredManagedMachineLearningDiagnosticsConfig:
    ManagedMachineLearningDiagnosticsConfig? = nil

  /// Optional. The desired NodeCreationConfig for the cluster.
  public var desiredNodeCreationConfig: NodeCreationConfig? = nil

  /// Initialize a new instance of `ClusterUpdate`.
  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 = ClusterUpdate().with { $0.desiredNodeVersion = ... }
  /// ```
  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 desiredNodeVersion = "desiredNodeVersion"
    case desiredMonitoringService = "desiredMonitoringService"
    case desiredAddonsConfig = "desiredAddonsConfig"
    case desiredNodePoolId = "desiredNodePoolId"
    case desiredImageType = "desiredImageType"
    case desiredImage = "desiredImage"
    case desiredImageProject = "desiredImageProject"
    case desiredDatabaseEncryption = "desiredDatabaseEncryption"
    case desiredWorkloadIdentityConfig = "desiredWorkloadIdentityConfig"
    case desiredMeshCertificates = "desiredMeshCertificates"
    case desiredShieldedNodes = "desiredShieldedNodes"
    case desiredCostManagementConfig = "desiredCostManagementConfig"
    case desiredDnsConfig = "desiredDnsConfig"
    case desiredNodePoolAutoscaling = "desiredNodePoolAutoscaling"
    case desiredLocations = "desiredLocations"
    case desiredMasterAuthorizedNetworksConfig = "desiredMasterAuthorizedNetworksConfig"
    case desiredClusterAutoscaling = "desiredClusterAutoscaling"
    case desiredBinaryAuthorization = "desiredBinaryAuthorization"
    case desiredLoggingService = "desiredLoggingService"
    case desiredResourceUsageExportConfig = "desiredResourceUsageExportConfig"
    case desiredVerticalPodAutoscaling = "desiredVerticalPodAutoscaling"
    case desiredPrivateClusterConfig = "desiredPrivateClusterConfig"
    case desiredIntraNodeVisibilityConfig = "desiredIntraNodeVisibilityConfig"
    case desiredDefaultSnatStatus = "desiredDefaultSnatStatus"
    case desiredReleaseChannel = "desiredReleaseChannel"
    case desiredL4IlbSubsettingConfig = "desiredL4ilbSubsettingConfig"
    case desiredDatapathProvider = "desiredDatapathProvider"
    case desiredPrivateIpv6GoogleAccess = "desiredPrivateIpv6GoogleAccess"
    case desiredNotificationConfig = "desiredNotificationConfig"
    case desiredAuthenticatorGroupsConfig = "desiredAuthenticatorGroupsConfig"
    case desiredLoggingConfig = "desiredLoggingConfig"
    case desiredMonitoringConfig = "desiredMonitoringConfig"
    case desiredIdentityServiceConfig = "desiredIdentityServiceConfig"
    case desiredServiceExternalIpsConfig = "desiredServiceExternalIpsConfig"
    case desiredEnablePrivateEndpoint = "desiredEnablePrivateEndpoint"
    case desiredDefaultEnablePrivateNodes = "desiredDefaultEnablePrivateNodes"
    case desiredControlPlaneEndpointsConfig = "desiredControlPlaneEndpointsConfig"
    case desiredMasterVersion = "desiredMasterVersion"
    case desiredGcfsConfig = "desiredGcfsConfig"
    case desiredNodePoolAutoConfigNetworkTags = "desiredNodePoolAutoConfigNetworkTags"
    case desiredPodAutoscaling = "desiredPodAutoscaling"
    case desiredGatewayApiConfig = "desiredGatewayApiConfig"
    case etag = "etag"
    case desiredNodePoolLoggingConfig = "desiredNodePoolLoggingConfig"
    case desiredFleet = "desiredFleet"
    case desiredStackType = "desiredStackType"
    case additionalPodRangesConfig = "additionalPodRangesConfig"
    case removedAdditionalPodRangesConfig = "removedAdditionalPodRangesConfig"
    case enableK8SBetaApis = "enableK8sBetaApis"
    case desiredSecurityPostureConfig = "desiredSecurityPostureConfig"
    case desiredNetworkPerformanceConfig = "desiredNetworkPerformanceConfig"
    case desiredEnableFqdnNetworkPolicy = "desiredEnableFqdnNetworkPolicy"
    case desiredAutopilotWorkloadPolicyConfig = "desiredAutopilotWorkloadPolicyConfig"
    case desiredK8SBetaApis = "desiredK8sBetaApis"
    case desiredContainerdConfig = "desiredContainerdConfig"
    case desiredEnableMultiNetworking = "desiredEnableMultiNetworking"
    case desiredNodePoolAutoConfigResourceManagerTags =
      "desiredNodePoolAutoConfigResourceManagerTags"
    case desiredInTransitEncryptionConfig = "desiredInTransitEncryptionConfig"
    case desiredEnableCiliumClusterwideNetworkPolicy = "desiredEnableCiliumClusterwideNetworkPolicy"
    case desiredSecretManagerConfig = "desiredSecretManagerConfig"
    case desiredCompliancePostureConfig = "desiredCompliancePostureConfig"
    case desiredNodeKubeletConfig = "desiredNodeKubeletConfig"
    case desiredNodePoolAutoConfigKubeletConfig = "desiredNodePoolAutoConfigKubeletConfig"
    case userManagedKeysConfig = "userManagedKeysConfig"
    case desiredRbacBindingConfig = "desiredRbacBindingConfig"
    case desiredAdditionalIpRangesConfig = "desiredAdditionalIpRangesConfig"
    case desiredEnterpriseConfig = "desiredEnterpriseConfig"
    case desiredAutoIpamConfig = "desiredAutoIpamConfig"
    case desiredDisableL4LbFirewallReconciliation = "desiredDisableL4LbFirewallReconciliation"
    case desiredNodePoolAutoConfigLinuxNodeConfig = "desiredNodePoolAutoConfigLinuxNodeConfig"
    case desiredUserManagedKeysConfig = "desiredUserManagedKeysConfig"
    case desiredAnonymousAuthenticationConfig = "desiredAnonymousAuthenticationConfig"
    case gkeAutoUpgradeConfig = "gkeAutoUpgradeConfig"
    case desiredNetworkTierConfig = "desiredNetworkTierConfig"
    case desiredSecretSyncConfig = "desiredSecretSyncConfig"
    case desiredPrivilegedAdmissionConfig = "desiredPrivilegedAdmissionConfig"
    case desiredControlPlaneEgress = "desiredControlPlaneEgress"
    case desiredManagedOpentelemetryConfig = "desiredManagedOpentelemetryConfig"
    case desiredAutopilotClusterPolicyConfig = "desiredAutopilotClusterPolicyConfig"
    case desiredManagedMachineLearningDiagnosticsConfig =
      "desiredManagedMachineLearningDiagnosticsConfig"
    case desiredNodeCreationConfig = "desiredNodeCreationConfig"
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    self.desiredNodeVersion = try container.decode(Swift.String.self, forKey: .desiredNodeVersion)
    self.desiredMonitoringService = try container.decode(
      Swift.String.self, forKey: .desiredMonitoringService)
    self.desiredAddonsConfig = try container.decodeIfPresent(
      AddonsConfig.self, forKey: .desiredAddonsConfig)
    self.desiredNodePoolId = try container.decode(Swift.String.self, forKey: .desiredNodePoolId)
    self.desiredImageType = try container.decode(Swift.String.self, forKey: .desiredImageType)
    self.desiredImage = try container.decode(Swift.String.self, forKey: .desiredImage)
    self.desiredImageProject = try container.decode(Swift.String.self, forKey: .desiredImageProject)
    self.desiredDatabaseEncryption = try container.decodeIfPresent(
      DatabaseEncryption.self, forKey: .desiredDatabaseEncryption)
    self.desiredWorkloadIdentityConfig = try container.decodeIfPresent(
      WorkloadIdentityConfig.self, forKey: .desiredWorkloadIdentityConfig)
    self.desiredMeshCertificates = try container.decodeIfPresent(
      MeshCertificates.self, forKey: .desiredMeshCertificates)
    self.desiredShieldedNodes = try container.decodeIfPresent(
      ShieldedNodes.self, forKey: .desiredShieldedNodes)
    self.desiredCostManagementConfig = try container.decodeIfPresent(
      CostManagementConfig.self, forKey: .desiredCostManagementConfig)
    self.desiredDnsConfig = try container.decodeIfPresent(DNSConfig.self, forKey: .desiredDnsConfig)
    self.desiredNodePoolAutoscaling = try container.decodeIfPresent(
      NodePoolAutoscaling.self, forKey: .desiredNodePoolAutoscaling)
    self.desiredLocations = try container.decode([Swift.String].self, forKey: .desiredLocations)
    self.desiredMasterAuthorizedNetworksConfig = try container.decodeIfPresent(
      MasterAuthorizedNetworksConfig.self, forKey: .desiredMasterAuthorizedNetworksConfig)
    self.desiredClusterAutoscaling = try container.decodeIfPresent(
      ClusterAutoscaling.self, forKey: .desiredClusterAutoscaling)
    self.desiredBinaryAuthorization = try container.decodeIfPresent(
      BinaryAuthorization.self, forKey: .desiredBinaryAuthorization)
    self.desiredLoggingService = try container.decode(
      Swift.String.self, forKey: .desiredLoggingService)
    self.desiredResourceUsageExportConfig = try container.decodeIfPresent(
      ResourceUsageExportConfig.self, forKey: .desiredResourceUsageExportConfig)
    self.desiredVerticalPodAutoscaling = try container.decodeIfPresent(
      VerticalPodAutoscaling.self, forKey: .desiredVerticalPodAutoscaling)
    self.desiredPrivateClusterConfig = try container.decodeIfPresent(
      PrivateClusterConfig.self, forKey: .desiredPrivateClusterConfig)
    self.desiredIntraNodeVisibilityConfig = try container.decodeIfPresent(
      IntraNodeVisibilityConfig.self, forKey: .desiredIntraNodeVisibilityConfig)
    self.desiredDefaultSnatStatus = try container.decodeIfPresent(
      DefaultSnatStatus.self, forKey: .desiredDefaultSnatStatus)
    self.desiredReleaseChannel = try container.decodeIfPresent(
      ReleaseChannel.self, forKey: .desiredReleaseChannel)
    self.desiredL4IlbSubsettingConfig = try container.decodeIfPresent(
      ILBSubsettingConfig.self, forKey: .desiredL4IlbSubsettingConfig)
    self.desiredDatapathProvider = try container.decode(
      DatapathProvider.self, forKey: .desiredDatapathProvider)
    self.desiredPrivateIpv6GoogleAccess = try container.decode(
      PrivateIPv6GoogleAccess.self, forKey: .desiredPrivateIpv6GoogleAccess)
    self.desiredNotificationConfig = try container.decodeIfPresent(
      NotificationConfig.self, forKey: .desiredNotificationConfig)
    self.desiredAuthenticatorGroupsConfig = try container.decodeIfPresent(
      AuthenticatorGroupsConfig.self, forKey: .desiredAuthenticatorGroupsConfig)
    self.desiredLoggingConfig = try container.decodeIfPresent(
      LoggingConfig.self, forKey: .desiredLoggingConfig)
    self.desiredMonitoringConfig = try container.decodeIfPresent(
      MonitoringConfig.self, forKey: .desiredMonitoringConfig)
    self.desiredIdentityServiceConfig = try container.decodeIfPresent(
      IdentityServiceConfig.self, forKey: .desiredIdentityServiceConfig)
    self.desiredServiceExternalIpsConfig = try container.decodeIfPresent(
      ServiceExternalIPsConfig.self, forKey: .desiredServiceExternalIpsConfig)
    self.desiredEnablePrivateEndpoint = try container.decodeIfPresent(
      Swift.Bool.self, forKey: .desiredEnablePrivateEndpoint)
    self.desiredDefaultEnablePrivateNodes = try container.decodeIfPresent(
      Swift.Bool.self, forKey: .desiredDefaultEnablePrivateNodes)
    self.desiredControlPlaneEndpointsConfig = try container.decodeIfPresent(
      ControlPlaneEndpointsConfig.self, forKey: .desiredControlPlaneEndpointsConfig)
    self.desiredMasterVersion = try container.decode(
      Swift.String.self, forKey: .desiredMasterVersion)
    self.desiredGcfsConfig = try container.decodeIfPresent(
      GcfsConfig.self, forKey: .desiredGcfsConfig)
    self.desiredNodePoolAutoConfigNetworkTags = try container.decodeIfPresent(
      NetworkTags.self, forKey: .desiredNodePoolAutoConfigNetworkTags)
    self.desiredPodAutoscaling = try container.decodeIfPresent(
      PodAutoscaling.self, forKey: .desiredPodAutoscaling)
    self.desiredGatewayApiConfig = try container.decodeIfPresent(
      GatewayAPIConfig.self, forKey: .desiredGatewayApiConfig)
    self.etag = try container.decode(Swift.String.self, forKey: .etag)
    self.desiredNodePoolLoggingConfig = try container.decodeIfPresent(
      NodePoolLoggingConfig.self, forKey: .desiredNodePoolLoggingConfig)
    self.desiredFleet = try container.decodeIfPresent(Fleet.self, forKey: .desiredFleet)
    self.desiredStackType = try container.decode(StackType.self, forKey: .desiredStackType)
    self.additionalPodRangesConfig = try container.decodeIfPresent(
      AdditionalPodRangesConfig.self, forKey: .additionalPodRangesConfig)
    self.removedAdditionalPodRangesConfig = try container.decodeIfPresent(
      AdditionalPodRangesConfig.self, forKey: .removedAdditionalPodRangesConfig)
    self.enableK8SBetaApis = try container.decodeIfPresent(
      K8sBetaAPIConfig.self, forKey: .enableK8SBetaApis)
    self.desiredSecurityPostureConfig = try container.decodeIfPresent(
      SecurityPostureConfig.self, forKey: .desiredSecurityPostureConfig)
    self.desiredNetworkPerformanceConfig = try container.decodeIfPresent(
      NetworkConfig.ClusterNetworkPerformanceConfig.self, forKey: .desiredNetworkPerformanceConfig)
    self.desiredEnableFqdnNetworkPolicy = try container.decodeIfPresent(
      Swift.Bool.self, forKey: .desiredEnableFqdnNetworkPolicy)
    self.desiredAutopilotWorkloadPolicyConfig = try container.decodeIfPresent(
      WorkloadPolicyConfig.self, forKey: .desiredAutopilotWorkloadPolicyConfig)
    self.desiredK8SBetaApis = try container.decodeIfPresent(
      K8sBetaAPIConfig.self, forKey: .desiredK8SBetaApis)
    self.desiredContainerdConfig = try container.decodeIfPresent(
      ContainerdConfig.self, forKey: .desiredContainerdConfig)
    self.desiredEnableMultiNetworking = try container.decodeIfPresent(
      Swift.Bool.self, forKey: .desiredEnableMultiNetworking)
    self.desiredNodePoolAutoConfigResourceManagerTags = try container.decodeIfPresent(
      ResourceManagerTags.self, forKey: .desiredNodePoolAutoConfigResourceManagerTags)
    self.desiredInTransitEncryptionConfig = try container.decodeIfPresent(
      InTransitEncryptionConfig.self, forKey: .desiredInTransitEncryptionConfig)
    self.desiredEnableCiliumClusterwideNetworkPolicy = try container.decodeIfPresent(
      Swift.Bool.self, forKey: .desiredEnableCiliumClusterwideNetworkPolicy)
    self.desiredSecretManagerConfig = try container.decodeIfPresent(
      SecretManagerConfig.self, forKey: .desiredSecretManagerConfig)
    self.desiredCompliancePostureConfig = try container.decodeIfPresent(
      CompliancePostureConfig.self, forKey: .desiredCompliancePostureConfig)
    self.desiredNodeKubeletConfig = try container.decodeIfPresent(
      NodeKubeletConfig.self, forKey: .desiredNodeKubeletConfig)
    self.desiredNodePoolAutoConfigKubeletConfig = try container.decodeIfPresent(
      NodeKubeletConfig.self, forKey: .desiredNodePoolAutoConfigKubeletConfig)
    self.userManagedKeysConfig = try container.decodeIfPresent(
      UserManagedKeysConfig.self, forKey: .userManagedKeysConfig)
    self.desiredRbacBindingConfig = try container.decodeIfPresent(
      RBACBindingConfig.self, forKey: .desiredRbacBindingConfig)
    self.desiredAdditionalIpRangesConfig = try container.decodeIfPresent(
      DesiredAdditionalIPRangesConfig.self, forKey: .desiredAdditionalIpRangesConfig)
    self.desiredEnterpriseConfig = try container.decodeIfPresent(
      DesiredEnterpriseConfig.self, forKey: .desiredEnterpriseConfig)
    self.desiredAutoIpamConfig = try container.decodeIfPresent(
      AutoIpamConfig.self, forKey: .desiredAutoIpamConfig)
    self.desiredDisableL4LbFirewallReconciliation = try container.decodeIfPresent(
      Swift.Bool.self, forKey: .desiredDisableL4LbFirewallReconciliation)
    self.desiredNodePoolAutoConfigLinuxNodeConfig = try container.decodeIfPresent(
      LinuxNodeConfig.self, forKey: .desiredNodePoolAutoConfigLinuxNodeConfig)
    self.desiredUserManagedKeysConfig = try container.decodeIfPresent(
      UserManagedKeysConfig.self, forKey: .desiredUserManagedKeysConfig)
    self.desiredAnonymousAuthenticationConfig = try container.decodeIfPresent(
      AnonymousAuthenticationConfig.self, forKey: .desiredAnonymousAuthenticationConfig)
    self.gkeAutoUpgradeConfig = try container.decodeIfPresent(
      GkeAutoUpgradeConfig.self, forKey: .gkeAutoUpgradeConfig)
    self.desiredNetworkTierConfig = try container.decodeIfPresent(
      NetworkTierConfig.self, forKey: .desiredNetworkTierConfig)
    self.desiredSecretSyncConfig = try container.decodeIfPresent(
      SecretSyncConfig.self, forKey: .desiredSecretSyncConfig)
    self.desiredPrivilegedAdmissionConfig = try container.decodeIfPresent(
      PrivilegedAdmissionConfig.self, forKey: .desiredPrivilegedAdmissionConfig)
    self.desiredControlPlaneEgress = try container.decodeIfPresent(
      ControlPlaneEgress.self, forKey: .desiredControlPlaneEgress)
    self.desiredManagedOpentelemetryConfig = try container.decodeIfPresent(
      ManagedOpenTelemetryConfig.self, forKey: .desiredManagedOpentelemetryConfig)
    self.desiredAutopilotClusterPolicyConfig = try container.decodeIfPresent(
      ClusterPolicyConfig.self, forKey: .desiredAutopilotClusterPolicyConfig)
    self.desiredManagedMachineLearningDiagnosticsConfig = try container.decodeIfPresent(
      ManagedMachineLearningDiagnosticsConfig.self,
      forKey: .desiredManagedMachineLearningDiagnosticsConfig)
    self.desiredNodeCreationConfig = try container.decodeIfPresent(
      NodeCreationConfig.self, forKey: .desiredNodeCreationConfig)
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.desiredNodeVersion, forKey: .desiredNodeVersion)
    try container.encode(self.desiredMonitoringService, forKey: .desiredMonitoringService)
    try container.encode(self.desiredAddonsConfig, forKey: .desiredAddonsConfig)
    try container.encode(self.desiredNodePoolId, forKey: .desiredNodePoolId)
    try container.encode(self.desiredImageType, forKey: .desiredImageType)
    try container.encode(self.desiredImage, forKey: .desiredImage)
    try container.encode(self.desiredImageProject, forKey: .desiredImageProject)
    try container.encode(self.desiredDatabaseEncryption, forKey: .desiredDatabaseEncryption)
    try container.encode(self.desiredWorkloadIdentityConfig, forKey: .desiredWorkloadIdentityConfig)
    try container.encode(self.desiredMeshCertificates, forKey: .desiredMeshCertificates)
    try container.encode(self.desiredShieldedNodes, forKey: .desiredShieldedNodes)
    try container.encode(self.desiredCostManagementConfig, forKey: .desiredCostManagementConfig)
    try container.encode(self.desiredDnsConfig, forKey: .desiredDnsConfig)
    try container.encode(self.desiredNodePoolAutoscaling, forKey: .desiredNodePoolAutoscaling)
    try container.encode(self.desiredLocations, forKey: .desiredLocations)
    try container.encode(
      self.desiredMasterAuthorizedNetworksConfig, forKey: .desiredMasterAuthorizedNetworksConfig)
    try container.encode(self.desiredClusterAutoscaling, forKey: .desiredClusterAutoscaling)
    try container.encode(self.desiredBinaryAuthorization, forKey: .desiredBinaryAuthorization)
    try container.encode(self.desiredLoggingService, forKey: .desiredLoggingService)
    try container.encode(
      self.desiredResourceUsageExportConfig, forKey: .desiredResourceUsageExportConfig)
    try container.encode(self.desiredVerticalPodAutoscaling, forKey: .desiredVerticalPodAutoscaling)
    try container.encode(self.desiredPrivateClusterConfig, forKey: .desiredPrivateClusterConfig)
    try container.encode(
      self.desiredIntraNodeVisibilityConfig, forKey: .desiredIntraNodeVisibilityConfig)
    try container.encode(self.desiredDefaultSnatStatus, forKey: .desiredDefaultSnatStatus)
    try container.encode(self.desiredReleaseChannel, forKey: .desiredReleaseChannel)
    try container.encode(self.desiredL4IlbSubsettingConfig, forKey: .desiredL4IlbSubsettingConfig)
    try container.encode(self.desiredDatapathProvider, forKey: .desiredDatapathProvider)
    try container.encode(
      self.desiredPrivateIpv6GoogleAccess, forKey: .desiredPrivateIpv6GoogleAccess)
    try container.encode(self.desiredNotificationConfig, forKey: .desiredNotificationConfig)
    try container.encode(
      self.desiredAuthenticatorGroupsConfig, forKey: .desiredAuthenticatorGroupsConfig)
    try container.encode(self.desiredLoggingConfig, forKey: .desiredLoggingConfig)
    try container.encode(self.desiredMonitoringConfig, forKey: .desiredMonitoringConfig)
    try container.encode(self.desiredIdentityServiceConfig, forKey: .desiredIdentityServiceConfig)
    try container.encode(
      self.desiredServiceExternalIpsConfig, forKey: .desiredServiceExternalIpsConfig)
    try container.encode(self.desiredEnablePrivateEndpoint, forKey: .desiredEnablePrivateEndpoint)
    try container.encode(
      self.desiredDefaultEnablePrivateNodes, forKey: .desiredDefaultEnablePrivateNodes)
    try container.encode(
      self.desiredControlPlaneEndpointsConfig, forKey: .desiredControlPlaneEndpointsConfig)
    try container.encode(self.desiredMasterVersion, forKey: .desiredMasterVersion)
    try container.encode(self.desiredGcfsConfig, forKey: .desiredGcfsConfig)
    try container.encode(
      self.desiredNodePoolAutoConfigNetworkTags, forKey: .desiredNodePoolAutoConfigNetworkTags)
    try container.encode(self.desiredPodAutoscaling, forKey: .desiredPodAutoscaling)
    try container.encode(self.desiredGatewayApiConfig, forKey: .desiredGatewayApiConfig)
    try container.encode(self.etag, forKey: .etag)
    try container.encode(self.desiredNodePoolLoggingConfig, forKey: .desiredNodePoolLoggingConfig)
    try container.encode(self.desiredFleet, forKey: .desiredFleet)
    try container.encode(self.desiredStackType, forKey: .desiredStackType)
    try container.encode(self.additionalPodRangesConfig, forKey: .additionalPodRangesConfig)
    try container.encode(
      self.removedAdditionalPodRangesConfig, forKey: .removedAdditionalPodRangesConfig)
    try container.encode(self.enableK8SBetaApis, forKey: .enableK8SBetaApis)
    try container.encode(self.desiredSecurityPostureConfig, forKey: .desiredSecurityPostureConfig)
    try container.encode(
      self.desiredNetworkPerformanceConfig, forKey: .desiredNetworkPerformanceConfig)
    try container.encode(
      self.desiredEnableFqdnNetworkPolicy, forKey: .desiredEnableFqdnNetworkPolicy)
    try container.encode(
      self.desiredAutopilotWorkloadPolicyConfig, forKey: .desiredAutopilotWorkloadPolicyConfig)
    try container.encode(self.desiredK8SBetaApis, forKey: .desiredK8SBetaApis)
    try container.encode(self.desiredContainerdConfig, forKey: .desiredContainerdConfig)
    try container.encode(self.desiredEnableMultiNetworking, forKey: .desiredEnableMultiNetworking)
    try container.encode(
      self.desiredNodePoolAutoConfigResourceManagerTags,
      forKey: .desiredNodePoolAutoConfigResourceManagerTags)
    try container.encode(
      self.desiredInTransitEncryptionConfig, forKey: .desiredInTransitEncryptionConfig)
    try container.encode(
      self.desiredEnableCiliumClusterwideNetworkPolicy,
      forKey: .desiredEnableCiliumClusterwideNetworkPolicy)
    try container.encode(self.desiredSecretManagerConfig, forKey: .desiredSecretManagerConfig)
    try container.encode(
      self.desiredCompliancePostureConfig, forKey: .desiredCompliancePostureConfig)
    try container.encode(self.desiredNodeKubeletConfig, forKey: .desiredNodeKubeletConfig)
    try container.encode(
      self.desiredNodePoolAutoConfigKubeletConfig, forKey: .desiredNodePoolAutoConfigKubeletConfig)
    try container.encode(self.userManagedKeysConfig, forKey: .userManagedKeysConfig)
    try container.encode(self.desiredRbacBindingConfig, forKey: .desiredRbacBindingConfig)
    try container.encode(
      self.desiredAdditionalIpRangesConfig, forKey: .desiredAdditionalIpRangesConfig)
    try container.encode(self.desiredEnterpriseConfig, forKey: .desiredEnterpriseConfig)
    try container.encode(self.desiredAutoIpamConfig, forKey: .desiredAutoIpamConfig)
    try container.encode(
      self.desiredDisableL4LbFirewallReconciliation,
      forKey: .desiredDisableL4LbFirewallReconciliation)
    try container.encode(
      self.desiredNodePoolAutoConfigLinuxNodeConfig,
      forKey: .desiredNodePoolAutoConfigLinuxNodeConfig)
    try container.encode(self.desiredUserManagedKeysConfig, forKey: .desiredUserManagedKeysConfig)
    try container.encode(
      self.desiredAnonymousAuthenticationConfig, forKey: .desiredAnonymousAuthenticationConfig)
    try container.encode(self.gkeAutoUpgradeConfig, forKey: .gkeAutoUpgradeConfig)
    try container.encode(self.desiredNetworkTierConfig, forKey: .desiredNetworkTierConfig)
    try container.encode(self.desiredSecretSyncConfig, forKey: .desiredSecretSyncConfig)
    try container.encode(
      self.desiredPrivilegedAdmissionConfig, forKey: .desiredPrivilegedAdmissionConfig)
    try container.encode(self.desiredControlPlaneEgress, forKey: .desiredControlPlaneEgress)
    try container.encode(
      self.desiredManagedOpentelemetryConfig, forKey: .desiredManagedOpentelemetryConfig)
    try container.encode(
      self.desiredAutopilotClusterPolicyConfig, forKey: .desiredAutopilotClusterPolicyConfig)
    try container.encode(
      self.desiredManagedMachineLearningDiagnosticsConfig,
      forKey: .desiredManagedMachineLearningDiagnosticsConfig)
    try container.encode(self.desiredNodeCreationConfig, forKey: .desiredNodeCreationConfig)
  }

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