// 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 Conversations
  import Foundation
  import GoogleCloudWkt

  /// The response message for
  /// [Conversations.SuggestConversationSummary][google.cloud.dialogflow.v2.Conversations.SuggestConversationSummary].
  ///
  /// [google.cloud.dialogflow.v2.Conversations.SuggestConversationSummary]: <doc:Conversations/suggestConversationSummary(request:)>
  public struct SuggestConversationSummaryResponse: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Generated summary.
    public var summary: SuggestConversationSummaryResponse.Summary? = nil

    /// The name of the latest conversation message used as context for
    /// compiling suggestion.
    ///
    /// Format: `projects/<Project ID>/locations/<Location
    /// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
    public var latestMessage: Swift.String = Swift.String()

    /// Number of messages prior to and including
    /// [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message]
    /// used to compile the suggestion. It may be smaller than the
    /// [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size]
    /// field in the request if there weren't that many messages in the
    /// conversation.
    ///
    /// [google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size]: <doc:SuggestConversationSummaryRequest/contextSize>
    /// [google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message]: <doc:SuggestConversationSummaryResponse/latestMessage>
    public var contextSize: Swift.Int32 = Swift.Int32()

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

    /// Generated summary for a conversation.
    public struct Summary: Codable, Equatable, GoogleCloudWkt._AnyPackable,
      Sendable
    {
      /// The summary content that is concatenated into one string.
      public var text: Swift.String = Swift.String()

      /// The summary content that is divided into sections. The key is the
      /// section's name and the value is the section's content. There is no
      /// specific format for the key or value.
      public var textSections: [Swift.String: Swift.String] = [:]

      /// Same as text_sections, but in an order that is consistent with the order
      /// of the sections in the generator.
      public var sortedTextSections: [SuggestConversationSummaryResponse.Summary.SummarySection] =
        []

      /// The name of the answer record. Format:
      /// "projects/<Project ID>/answerRecords/<Answer Record ID>"
      public var answerRecord: Swift.String = Swift.String()

      /// The baseline model version used to generate this summary. It is empty if
      /// a baseline model was not used to generate this summary.
      public var baselineModelVersion: Swift.String = Swift.String()

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

      /// A component of the generated summary.
      public struct SummarySection: Codable, Equatable, GoogleCloudWkt._AnyPackable,
        Sendable
      {
        /// Output only. Name of the section.
        public var section: Swift.String = Swift.String()

        /// Output only. Summary text for the section.
        public var summary: Swift.String = Swift.String()

        /// Initialize a new instance of `SummarySection`.
        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 = SummarySection().with { $0.section = ... }
        /// ```
        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.v2.SuggestConversationSummaryResponse.Summary.SummarySection"
        }
        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.v2.SuggestConversationSummaryResponse.Summary"
      }
      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.v2.SuggestConversationSummaryResponse"
    }
    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
