// 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 toolset that contains a list of tools that are offered by the MCP
/// server.
public struct McpToolset: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. The address of the MCP server, for example,
  /// "https://example.com/mcp/". If the server is built with the MCP SDK, the
  /// url should be suffixed with
  /// "/mcp/". Only Streamable HTTP transport based servers are supported. See
  /// https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http
  /// for more details.
  public var serverAddress: Swift.String = Swift.String()

  /// Optional. Authentication information required to access tools and execute a
  /// tool against the MCP server. For bearer token authentication, the token
  /// applies only to tool execution, not to listing tools. This requires that
  /// tools can be listed without authentication.
  public var apiAuthentication: ApiAuthentication? = nil

  /// Optional. Service Directory configuration for VPC-SC, used to resolve
  /// service names within a perimeter.
  public var serviceDirectoryConfig: ServiceDirectoryConfig? = nil

  /// Optional. The TLS configuration. Includes the custom server certificates
  /// that the client should trust.
  public var tlsConfig: TlsConfig? = nil

  /// Optional. The custom headers to send in the request to the MCP server. The
  /// values must be in the format `$context.variables.<name_of_variable>` and
  /// can be set in the session variables. See
  /// https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/open-api#openapi-injection
  /// for more details.
  public var customHeaders: [Swift.String: Swift.String] = [:]

  /// Optional. Overrides for individual tools within this toolset.
  /// This allows overriding specific details like descriptions, names,
  /// or pinning the tools' states so they aren't fully dynamic.
  public var toolOverrides: [McpToolOverride] = []

  /// Initialize a new instance of `McpToolset`.
  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 = McpToolset().with { $0.serverAddress = ... }
  /// ```
  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.ces.v1.McpToolset"
  }
  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)
  }
}
