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

  /// Request for ListSessions method.
  public struct ListSessionsRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Required. The data store resource name. Format:
    /// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
    public var parent: Swift.String = Swift.String()

    /// Maximum number of results to return. If unspecified, defaults
    /// to 50. Max allowed value is 1000.
    public var pageSize: Swift.Int32 = Swift.Int32()

    /// A page token, received from a previous `ListSessions` call.
    /// Provide this to retrieve the subsequent page.
    public var pageToken: Swift.String = Swift.String()

    /// A comma-separated list of fields to filter by, in EBNF grammar.
    /// The supported fields are:
    /// * `user_pseudo_id`
    /// * `state`
    /// * `display_name`
    /// * `starred`
    /// * `is_pinned`
    /// * `labels`
    /// * `create_time`
    /// * `update_time`
    ///
    /// Examples:
    /// "user_pseudo_id = some_id"
    /// "display_name = \"some_name\""
    /// "starred = true"
    /// "is_pinned=true AND (NOT labels:hidden)"
    /// "create_time > \"1970-01-01T12:00:00Z\""
    public var filter: Swift.String = Swift.String()

    /// A comma-separated list of fields to order by, sorted in ascending order.
    /// Use "desc" after a field name for descending.
    /// Supported fields:
    ///
    ///   * `update_time`
    ///   * `create_time`
    ///   * `session_name`
    ///   * `is_pinned`
    ///
    /// Example:
    ///
    /// * "update_time desc"
    /// * "create_time"
    /// * "is_pinned desc,update_time desc": list sessions by is_pinned first, then
    ///    by update_time.
    public var orderBy: Swift.String = Swift.String()

    /// Initialize a new instance of `ListSessionsRequest`.
    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 = ListSessionsRequest().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.discoveryengine.v1.ListSessionsRequest"
    }
    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
