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

/// The authentication information for accessing the master endpoint.
/// Authentication can be done using HTTP basic auth or using client
/// certificates.
public struct MasterAuth: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// The username to use for HTTP basic authentication to the master endpoint.
  /// For clusters v1.6.0 and later, basic authentication can be disabled by
  /// leaving username unspecified (or setting it to the empty string).
  ///
  /// Warning: basic authentication is deprecated, and will be removed in GKE
  /// control plane versions 1.19 and newer. For a list of recommended
  /// authentication methods, see:
  /// https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
  @available(*, deprecated)
  public var username: Swift.String = Swift.String()

  /// The password to use for HTTP basic authentication to the master endpoint.
  /// Because the master endpoint is open to the Internet, you should create a
  /// strong password.  If a password is provided for cluster creation, username
  /// must be non-empty.
  ///
  /// Warning: basic authentication is deprecated, and will be removed in GKE
  /// control plane versions 1.19 and newer. For a list of recommended
  /// authentication methods, see:
  /// https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
  @available(*, deprecated)
  public var password: Swift.String = Swift.String()

  /// Configuration for client certificate authentication on the cluster. For
  /// clusters before v1.12, if no configuration is specified, a client
  /// certificate is issued.
  public var clientCertificateConfig: ClientCertificateConfig? = nil

  /// Output only. Base64-encoded public certificate that is the root of
  /// trust for the cluster.
  public var clusterCaCertificate: Swift.String = Swift.String()

  /// Output only. Base64-encoded public certificate used by clients to
  /// authenticate to the cluster endpoint. Issued only if
  /// client_certificate_config is set.
  public var clientCertificate: Swift.String = Swift.String()

  /// Output only. Base64-encoded private key used by clients to authenticate
  /// to the cluster endpoint.
  public var clientKey: Swift.String = Swift.String()

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