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

/// Configuration for connections to an instance of GitHub Enterprise.
public struct GitHubEnterpriseConfig: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. The URI of the GitHub Enterprise host this connection is for.
  public var hostUri: Swift.String = Swift.String()

  /// Required. API Key used for authentication of webhook events.
  public var apiKey: Swift.String = Swift.String()

  /// Id of the GitHub App created from the manifest.
  public var appId: Swift.Int64 = Swift.Int64()

  /// The URL-friendly name of the GitHub App.
  public var appSlug: Swift.String = Swift.String()

  /// SecretManager resource containing the private key of the GitHub App,
  /// formatted as `projects/*/secrets/*/versions/*`.
  public var privateKeySecretVersion: Swift.String = Swift.String()

  /// SecretManager resource containing the webhook secret of the GitHub App,
  /// formatted as `projects/*/secrets/*/versions/*`.
  public var webhookSecretSecretVersion: Swift.String = Swift.String()

  /// ID of the installation of the GitHub App.
  public var appInstallationId: Swift.Int64 = Swift.Int64()

  /// Configuration for using Service Directory to privately connect to a GitHub
  /// Enterprise server. This should only be set if the GitHub Enterprise server
  /// is hosted on-premises and not reachable by public internet. If this field
  /// is left empty, calls to the GitHub Enterprise server will be made over the
  /// public internet.
  public var serviceDirectoryConfig: ServiceDirectoryConfig? = nil

  /// SSL certificate to use for requests to GitHub Enterprise.
  public var sslCa: Swift.String = Swift.String()

  /// Output only. GitHub Enterprise version installed at the host_uri.
  public var serverVersion: Swift.String = Swift.String()

  /// Initialize a new instance of `GitHubEnterpriseConfig`.
  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 = GitHubEnterpriseConfig().with { $0.hostUri = ... }
  /// ```
  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.devtools.cloudbuild.v2.GitHubEnterpriseConfig"
  }
  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)
  }
}
