Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

137 changes: 137 additions & 0 deletions src/libs/Mistral/Generated/Mistral.BetaConnectorsClient.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@

#nullable enable

namespace Mistral
{
/// <summary>
/// (beta) Connectors<br/>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public sealed partial class BetaConnectorsClient : global::Mistral.IBetaConnectorsClient, global::System.IDisposable
{
/// <summary>
/// Production server
/// </summary>
public const string DefaultBaseUrl = "https://api.mistral.ai/";

private bool _disposeHttpClient = true;

/// <inheritdoc/>
public global::System.Net.Http.HttpClient HttpClient { get; }

/// <inheritdoc/>
public System.Uri? BaseUri => HttpClient.BaseAddress;

/// <inheritdoc/>
public global::System.Collections.Generic.List<global::Mistral.EndPointAuthorization> Authorizations { get; }

/// <inheritdoc/>
public bool ReadResponseAsString { get; set; }
#if DEBUG
= true;
#endif

/// <inheritdoc/>
public global::Mistral.AutoSDKClientOptions Options { get; }
/// <summary>
///
/// </summary>
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Mistral.SourceGenerationContext.Default;


/// <summary>
/// Creates a new instance of the BetaConnectorsClient.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="httpClient">The HttpClient instance. If not provided, a new one will be created.</param>
/// <param name="baseUri">The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.</param>
/// <param name="authorizations">The authorizations to use for the requests.</param>
/// <param name="disposeHttpClient">Dispose the HttpClient when the instance is disposed. True by default.</param>
public BetaConnectorsClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::Mistral.EndPointAuthorization>? authorizations = null,
bool disposeHttpClient = true) : this(
httpClient,
baseUri,
authorizations,
options: null,
disposeHttpClient: disposeHttpClient)
{
}

/// <summary>
/// Creates a new instance of the BetaConnectorsClient with explicit options but no base URL override.
/// Skips passing <c>baseUri</c> so the default base URL from the OpenAPI spec applies.
/// </summary>
/// <param name="httpClient">The HttpClient instance. If not provided, a new one will be created.</param>
/// <param name="authorizations">The authorizations to use for the requests.</param>
/// <param name="options">Client-wide request defaults such as headers, query parameters, retries, and timeout.</param>
/// <param name="disposeHttpClient">Dispose the HttpClient when the instance is disposed. True by default.</param>
public BetaConnectorsClient(
global::System.Net.Http.HttpClient? httpClient,
global::System.Collections.Generic.List<global::Mistral.EndPointAuthorization>? authorizations,
global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true) : this(
httpClient,
baseUri: null,
authorizations,
options,
disposeHttpClient: disposeHttpClient)
{
}

/// <summary>
/// Creates a new instance of the BetaConnectorsClient.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="httpClient">The HttpClient instance. If not provided, a new one will be created.</param>
/// <param name="baseUri">The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.</param>
/// <param name="authorizations">The authorizations to use for the requests.</param>
/// <param name="options">Client-wide request defaults such as headers, query parameters, retries, and timeout.</param>
/// <param name="disposeHttpClient">Dispose the HttpClient when the instance is disposed. True by default.</param>
public BetaConnectorsClient(
global::System.Net.Http.HttpClient? httpClient,
global::System.Uri? baseUri,
global::System.Collections.Generic.List<global::Mistral.EndPointAuthorization>? authorizations,
global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{

HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
Authorizations = authorizations ?? new global::System.Collections.Generic.List<global::Mistral.EndPointAuthorization>();
Options = options ?? new global::Mistral.AutoSDKClientOptions();
_disposeHttpClient = disposeHttpClient;

Initialized(HttpClient);
}

/// <inheritdoc/>
public void Dispose()
{
if (_disposeHttpClient)
{
HttpClient.Dispose();
}
}

partial void Initialized(
global::System.Net.Http.HttpClient client);
partial void PrepareArguments(
global::System.Net.Http.HttpClient client);
partial void PrepareRequest(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpRequestMessage request);
partial void ProcessResponse(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response);
partial void ProcessResponseContent(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response,
ref string content);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#nullable enable

namespace Mistral
{
public partial interface IBetaConnectorsClient
{
/// <summary>
/// Call Connector Tool<br/>
/// Call a tool on an MCP connector.
/// </summary>
/// <param name="toolName"></param>
/// <param name="credentialsName"></param>
/// <param name="connectorIdOrName"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Mistral.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.MCPToolCallResponse> CallConnectorToolAsync(
string toolName,
string connectorIdOrName,

global::Mistral.MCPToolCallRequest request,
string? credentialsName = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Call Connector Tool<br/>
/// Call a tool on an MCP connector.
/// </summary>
/// <param name="toolName"></param>
/// <param name="credentialsName"></param>
/// <param name="connectorIdOrName"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Mistral.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.AutoSDKHttpResponse<global::Mistral.MCPToolCallResponse>> CallConnectorToolAsResponseAsync(
string toolName,
string connectorIdOrName,

global::Mistral.MCPToolCallRequest request,
string? credentialsName = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Call Connector Tool<br/>
/// Call a tool on an MCP connector.
/// </summary>
/// <param name="toolName"></param>
/// <param name="credentialsName"></param>
/// <param name="connectorIdOrName"></param>
/// <param name="arguments"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.MCPToolCallResponse> CallConnectorToolAsync(
string toolName,
string connectorIdOrName,
string? credentialsName = default,
object? arguments = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#nullable enable

namespace Mistral
{
public partial interface IBetaConnectorsClient
{
/// <summary>
/// Create a new connector.<br/>
/// Create a new MCP connector. You can customize its visibility, url and auth type.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Mistral.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.Connector> CreateANewConnectorAsync(

global::Mistral.ConnectorMCPCreate request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create a new connector.<br/>
/// Create a new MCP connector. You can customize its visibility, url and auth type.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Mistral.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.AutoSDKHttpResponse<global::Mistral.Connector>> CreateANewConnectorAsResponseAsync(

global::Mistral.ConnectorMCPCreate request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create a new connector.<br/>
/// Create a new MCP connector. You can customize its visibility, url and auth type.
/// </summary>
/// <param name="name">
/// The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes.
/// </param>
/// <param name="description">
/// The description of the connector.
/// </param>
/// <param name="iconUrl">
/// The optional url of the icon you want to associate to the connector.
/// </param>
/// <param name="visibility">
/// Visibility of the connector. Use 'shared_workspace' for workspace scoped connectors, or 'private' for private connectors.<br/>
/// Default Value: shared_org
/// </param>
/// <param name="server">
/// The url of the MCP server.
/// </param>
/// <param name="headers">
/// Optional organization-level headers to be sent with the request to the mcp server.
/// </param>
/// <param name="authData">
/// Optional additional authentication data for the connector.
/// </param>
/// <param name="systemPrompt">
/// Optional system prompt for the connector.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.Connector> CreateANewConnectorAsync(
string name,
string description,
string server,
string? iconUrl = default,
global::Mistral.ResourceVisibility? visibility = default,
object? headers = default,
global::Mistral.AuthData? authData = default,
string? systemPrompt = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#nullable enable

namespace Mistral
{
public partial interface IBetaConnectorsClient
{
/// <summary>
/// Create or update organization credentials for a connector.<br/>
/// Create or update credentials at the organization level for a given connector.
/// </summary>
/// <param name="connectorIdOrName"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Mistral.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.MessageResponse> CreateOrUpdateOrganizationCredentialsForAConnectorAsync(
string connectorIdOrName,

global::Mistral.CredentialsCreateOrUpdate request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create or update organization credentials for a connector.<br/>
/// Create or update credentials at the organization level for a given connector.
/// </summary>
/// <param name="connectorIdOrName"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Mistral.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.AutoSDKHttpResponse<global::Mistral.MessageResponse>> CreateOrUpdateOrganizationCredentialsForAConnectorAsResponseAsync(
string connectorIdOrName,

global::Mistral.CredentialsCreateOrUpdate request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create or update organization credentials for a connector.<br/>
/// Create or update credentials at the organization level for a given connector.
/// </summary>
/// <param name="connectorIdOrName"></param>
/// <param name="name">
/// Name of the credentials. Use this name to access or modify your credentials.
/// </param>
/// <param name="isDefault">
/// Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged.
/// </param>
/// <param name="credentials">
/// The credential data (headers, bearer_token).
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Mistral.MessageResponse> CreateOrUpdateOrganizationCredentialsForAConnectorAsync(
string connectorIdOrName,
string name,
bool? isDefault = default,
global::Mistral.ConnectionCredentials? credentials = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Loading