// 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 Dataproc job for running
/// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html)
/// applications on YARN.
public struct SparkRJob: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. The HCFS URI of the main R file to use as the driver.
  /// Must be a .R file.
  public var mainRFileUri: Swift.String = Swift.String()

  /// Optional. The arguments to pass to the driver.  Do not include arguments,
  /// such as `--conf`, that can be set as job properties, since a collision may
  /// occur that causes an incorrect job submission.
  public var args: [Swift.String] = []

  /// Optional. HCFS URIs of files to be placed in the working directory of
  /// each executor. Useful for naively parallel tasks.
  public var fileUris: [Swift.String] = []

  /// Optional. HCFS URIs of archives to be extracted into the working directory
  /// of each executor. Supported file types:
  /// .jar, .tar, .tar.gz, .tgz, and .zip.
  public var archiveUris: [Swift.String] = []

  /// Optional. A mapping of property names to values, used to configure SparkR.
  /// Properties that conflict with values set by the Dataproc API might be
  /// overwritten. Can include properties set in
  /// /etc/spark/conf/spark-defaults.conf and classes in user code.
  public var properties: [Swift.String: Swift.String] = [:]

  /// Optional. The runtime log config for job execution.
  public var loggingConfig: LoggingConfig? = nil

  /// Initialize a new instance of `SparkRJob`.
  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 = SparkRJob().with { $0.mainRFileUri = ... }
  /// ```
  public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
    var copy = self
    try config(&copy)
    return copy
  }

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