// 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 document translation request.
public struct TranslateDocumentRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. Location to make a regional call.
  ///
  /// Format: `projects/{project-number-or-id}/locations/{location-id}`.
  ///
  /// For global calls, use `projects/{project-number-or-id}/locations/global` or
  /// `projects/{project-number-or-id}`.
  ///
  /// Non-global location is required for requests using AutoML models or custom
  /// glossaries.
  ///
  /// Models and glossaries must be within the same region (have the same
  /// location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
  public var parent: Swift.String = Swift.String()

  /// Optional. The ISO-639 language code of the input document if known, for
  /// example, "en-US" or "sr-Latn". Supported language codes are listed in
  /// [Language Support](https://cloud.google.com/translate/docs/languages). If
  /// the source language isn't specified, the API attempts to identify the
  /// source language automatically and returns the source language within the
  /// response. Source language must be specified if the request contains a
  /// glossary or a custom model.
  public var sourceLanguageCode: Swift.String = Swift.String()

  /// Required. The ISO-639 language code to use for translation of the input
  /// document, set to one of the language codes listed in [Language
  /// Support](https://cloud.google.com/translate/docs/languages).
  public var targetLanguageCode: Swift.String = Swift.String()

  /// Required. Input configurations.
  public var documentInputConfig: DocumentInputConfig? = nil

  /// Optional. Output configurations.
  /// Defines if the output file should be stored within Cloud Storage as well
  /// as the desired output format. If not provided the translated file will
  /// only be returned through a byte-stream and its output mime type will be
  /// the same as the input file's mime type.
  public var documentOutputConfig: DocumentOutputConfig? = nil

  /// Optional. The `model` type requested for this translation.
  ///
  /// The format depends on model type:
  ///
  /// - AutoML Translation models:
  ///   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
  ///
  /// - General (built-in) models:
  ///   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
  ///
  ///
  /// If not provided, the default Google model (NMT) will be used for
  /// translation.
  public var model: Swift.String = Swift.String()

  /// Optional. Glossary to be applied. The glossary must be within the same
  /// region (have the same location-id) as the model, otherwise an
  /// INVALID_ARGUMENT (400) error is returned.
  public var glossaryConfig: TranslateTextGlossaryConfig? = nil

  /// Optional. The labels with user-defined metadata for the request.
  ///
  /// Label keys and values can be no longer than 63 characters (Unicode
  /// codepoints), can only contain lowercase letters, numeric characters,
  /// underscores and dashes. International characters are allowed. Label values
  /// are optional. Label keys must start with a letter.
  ///
  /// See https://cloud.google.com/translate/docs/advanced/labels for more
  /// information.
  public var labels: [Swift.String: Swift.String] = [:]

  /// Optional. This flag is to support user customized attribution.
  /// If not provided, the default is `Machine Translated by Google`.
  /// Customized attribution should follow rules in
  /// https://cloud.google.com/translate/attribution#attribution_and_logos
  public var customizedAttribution: Swift.String = Swift.String()

  /// Optional. is_translate_native_pdf_only field for external customers.
  /// If true, the page limit of online native pdf translation is 300 and only
  /// native pdf pages will be translated.
  public var isTranslateNativePdfOnly: Swift.Bool = Swift.Bool()

  /// Optional. If true, use the text removal server to remove the shadow text on
  /// background image for native pdf translation.
  /// Shadow removal feature can only be enabled when
  /// is_translate_native_pdf_only: false && pdf_native_only: false
  public var enableShadowRemovalNativePdf: Swift.Bool = Swift.Bool()

  /// Optional. If true, enable auto rotation correction in DVS.
  public var enableRotationCorrection: Swift.Bool = Swift.Bool()

  /// Initialize a new instance of `TranslateDocumentRequest`.
  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 = TranslateDocumentRequest().with { $0.parent = ... }
  /// ```
  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.translation.v3.TranslateDocumentRequest"
  }
  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)
  }
}
