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

#if Agents || Flows || Pages || Playbooks || Sessions || TestCases || TransitionRouteGroups
  import Foundation
  import GoogleCloudWkt

  /// Hierarchical advanced settings for agent/flow/page/fulfillment/parameter.
  /// Settings exposed at lower level overrides the settings exposed at higher
  /// level. Overriding occurs at the sub-setting level. For example, the
  /// playback_interruption_settings at fulfillment level only overrides the
  /// playback_interruption_settings at the agent level, leaving other settings
  /// at the agent level unchanged.
  ///
  /// DTMF settings does not override each other. DTMF settings set at different
  /// levels define DTMF detections running in parallel.
  ///
  /// Hierarchy: Agent->Flow->Page->Fulfillment/Parameter.
  public struct AdvancedSettings: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// If present, incoming audio is exported by Dialogflow to the configured
    /// Google Cloud Storage destination.
    /// Exposed at the following levels:
    /// - Agent level
    /// - Flow level
    public var audioExportGcsDestination: GcsDestination? = nil

    /// Settings for speech to text detection.
    /// Exposed at the following levels:
    /// - Agent level
    /// - Flow level
    /// - Page level
    /// - Parameter level
    public var speechSettings: AdvancedSettings.SpeechSettings? = nil

    /// Settings for DTMF.
    /// Exposed at the following levels:
    /// - Agent level
    /// - Flow level
    /// - Page level
    /// - Parameter level.
    public var dtmfSettings: AdvancedSettings.DtmfSettings? = nil

    /// Settings for logging.
    /// Settings for Dialogflow History, Contact Center messages, StackDriver logs,
    /// and speech logging.
    /// Exposed at the following levels:
    /// - Agent level.
    public var loggingSettings: AdvancedSettings.LoggingSettings? = nil

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

    /// Define behaviors of speech to text detection.
    public struct SpeechSettings: Codable, Equatable, GoogleCloudWkt._AnyPackable,
      Sendable
    {
      /// Sensitivity of the speech model that detects the end of speech.
      /// Scale from 0 to 100.
      public var endpointerSensitivity: Swift.Int32 = Swift.Int32()

      /// Timeout before detecting no speech.
      public var noSpeechTimeout: GoogleCloudWkt.Duration? = nil

      /// Use timeout based endpointing, interpreting endpointer sensitivity as
      /// seconds of timeout value.
      public var useTimeoutBasedEndpointing: Swift.Bool = Swift.Bool()

      /// Mapping from language to Speech-to-Text model. The mapped Speech-to-Text
      /// model will be selected for requests from its corresponding language.
      /// For more information, see
      /// [Speech
      /// models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
      public var models: [Swift.String: Swift.String] = [:]

      /// Initialize a new instance of `SpeechSettings`.
      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 = SpeechSettings().with { $0.endpointerSensitivity = ... }
      /// ```
      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.dialogflow.cx.v3.AdvancedSettings.SpeechSettings"
      }
      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)
      }
    }

    /// Define behaviors for DTMF (dual tone multi frequency).
    public struct DtmfSettings: Codable, Equatable, GoogleCloudWkt._AnyPackable,
      Sendable
    {
      /// If true, incoming audio is processed for DTMF (dual tone multi frequency)
      /// events. For example, if the caller presses a button on their telephone
      /// keypad and DTMF processing is enabled, Dialogflow will detect the
      /// event (e.g. a "3" was pressed) in the incoming audio and pass the event
      /// to the bot to drive business logic (e.g. when 3 is pressed, return the
      /// account balance).
      public var enabled: Swift.Bool = Swift.Bool()

      /// Max length of DTMF digits.
      public var maxDigits: Swift.Int32 = Swift.Int32()

      /// The digit that terminates a DTMF digit sequence.
      public var finishDigit: Swift.String = Swift.String()

      /// Interdigit timeout setting for matching dtmf input to regex.
      public var interdigitTimeoutDuration: GoogleCloudWkt.Duration? = nil

      /// Endpoint timeout setting for matching dtmf input to regex.
      public var endpointingTimeoutDuration: GoogleCloudWkt.Duration? = nil

      /// Initialize a new instance of `DtmfSettings`.
      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 = DtmfSettings().with { $0.enabled = ... }
      /// ```
      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.dialogflow.cx.v3.AdvancedSettings.DtmfSettings"
      }
      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)
      }
    }

    /// Define behaviors on logging.
    public struct LoggingSettings: Codable, Equatable, GoogleCloudWkt._AnyPackable,
      Sendable
    {
      /// Enables Google Cloud Logging.
      public var enableStackdriverLogging: Swift.Bool = Swift.Bool()

      /// Enables DF Interaction logging.
      public var enableInteractionLogging: Swift.Bool = Swift.Bool()

      /// Enables consent-based end-user input redaction, if true, a pre-defined
      /// session parameter `$session.params.conversation-redaction` will be
      /// used to determine if the utterance should be redacted.
      public var enableConsentBasedRedaction: Swift.Bool = Swift.Bool()

      /// Initialize a new instance of `LoggingSettings`.
      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 = LoggingSettings().with { $0.enableStackdriverLogging = ... }
      /// ```
      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.dialogflow.cx.v3.AdvancedSettings.LoggingSettings"
      }
      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.dialogflow.cx.v3.AdvancedSettings"
    }
    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)
    }
  }
#endif
