// 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 request for sending an AdaptiveMt translation query.
public struct AdaptiveMtTranslateRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. Location to make a regional call.
  ///
  /// Format: `projects/{project-number-or-id}/locations/{location-id}`.
  public var parent: Swift.String = Swift.String()

  /// Required. The resource name for the dataset to use for adaptive MT.
  /// `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
  public var dataset: Swift.String = Swift.String()

  /// Required. The content of the input in string format.
  public var content: [Swift.String] = []

  /// The format of the source text.
  public var mimeType: Swift.String = Swift.String()

  /// Configuration for caller provided reference sentences.
  public var referenceSentenceConfig: AdaptiveMtTranslateRequest.ReferenceSentenceConfig? = nil

  /// 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: AdaptiveMtTranslateRequest.GlossaryConfig? = nil

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

  /// A pair of sentences used as reference in source and target languages.
  public struct ReferenceSentencePair: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Source sentence in the sentence pair.
    public var sourceSentence: Swift.String = Swift.String()

    /// Target sentence in the sentence pair.
    public var targetSentence: Swift.String = Swift.String()

    /// Initialize a new instance of `ReferenceSentencePair`.
    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 = ReferenceSentencePair().with { $0.sourceSentence = ... }
    /// ```
    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.AdaptiveMtTranslateRequest.ReferenceSentencePair"
    }
    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)
    }
  }

  /// A list of reference sentence pairs.
  public struct ReferenceSentencePairList: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Reference sentence pairs.
    public var referenceSentencePairs: [AdaptiveMtTranslateRequest.ReferenceSentencePair] = []

    /// Initialize a new instance of `ReferenceSentencePairList`.
    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 = ReferenceSentencePairList().with { $0.referenceSentencePairs = ... }
    /// ```
    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.AdaptiveMtTranslateRequest.ReferenceSentencePairList"
    }
    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)
    }
  }

  /// Message of caller-provided reference configuration.
  public struct ReferenceSentenceConfig: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Reference sentences pair lists. Each list will be used as the references
    /// to translate the sentence under "content" field at the corresponding
    /// index. Length of the list is required to be equal to the length of
    /// "content" field.
    public var referenceSentencePairLists: [AdaptiveMtTranslateRequest.ReferenceSentencePairList] =
      []

    /// Source language code.
    public var sourceLanguageCode: Swift.String = Swift.String()

    /// Target language code.
    public var targetLanguageCode: Swift.String = Swift.String()

    /// Initialize a new instance of `ReferenceSentenceConfig`.
    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 = ReferenceSentenceConfig().with { $0.referenceSentencePairLists = ... }
    /// ```
    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.AdaptiveMtTranslateRequest.ReferenceSentenceConfig"
    }
    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)
    }
  }

  /// Configures which glossary is used for a specific target language and
  /// defines
  /// options for applying that glossary.
  public struct GlossaryConfig: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Required. The `glossary` to be applied for this translation.
    ///
    /// The format depends on the glossary:
    ///
    /// - User-provided custom glossary:
    ///   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
    public var glossary: Swift.String = Swift.String()

    /// Optional. Indicates match is case insensitive. The default value is
    /// `false` if missing.
    public var ignoreCase: Swift.Bool = Swift.Bool()

    /// Optional. If set to true, the glossary will be used for contextual
    /// translation.
    public var contextualTranslationEnabled: Swift.Bool = Swift.Bool()

    /// Initialize a new instance of `GlossaryConfig`.
    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 = GlossaryConfig().with { $0.glossary = ... }
    /// ```
    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.AdaptiveMtTranslateRequest.GlossaryConfig"
    }
    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)
    }
  }

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