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
36 changes: 36 additions & 0 deletions src/libs/Replicate/Generated/Replicate.IReplicateApi.Search.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#nullable enable

namespace Replicate
{
public partial interface IReplicateApi
{
/// <summary>
/// Search models, collections, and docs (beta)<br/>
/// Search for public models, collections, and docs using a text query.<br/>
/// For models, the response includes all model data, plus a new `metadata` object with the following fields:<br/>
/// - `generated_description`: A longer and more detailed AI-generated description of the model<br/>
/// - `tags`: An array of tags for the model<br/>
/// - `score`: A score for the model's relevance to the search query<br/>
/// Example cURL request:<br/>
/// ```console<br/>
/// curl -s \<br/>
/// -H "Authorization: Bearer $REPLICATE_API_TOKEN" \<br/>
/// "https://api.replicate.com/v1/search?query=nano+banana"<br/>
/// ```<br/>
/// Note: This search API is currently in beta and may change in future versions.
/// </summary>
/// <param name="query">
/// Example: nano banana
/// </param>
/// <param name="limit">
/// Default Value: 20<br/>
/// Example: 10
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Replicate.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Replicate.SchemasSearchResponse> SearchAsync(
string query,
int? limit = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
172 changes: 108 additions & 64 deletions src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public sealed partial class SchemasModelResponse
[global::System.Text.Json.Serialization.JsonPropertyName("github_url")]
public string? GithubUrl { get; set; }

/// <summary>
/// Boolean indicating whether the model is officially maintained by Replicate. Official models are always on, have stable API interfaces, and predictable pricing.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("is_official")]
public bool? IsOfficial { get; set; }

/// <summary>
/// The model's latest version
/// </summary>
Expand Down Expand Up @@ -102,6 +108,9 @@ public sealed partial class SchemasModelResponse
/// <param name="githubUrl">
/// A URL for the model's source code on GitHub
/// </param>
/// <param name="isOfficial">
/// Boolean indicating whether the model is officially maintained by Replicate. Official models are always on, have stable API interfaces, and predictable pricing.
/// </param>
/// <param name="latestVersion">
/// The model's latest version
/// </param>
Expand Down Expand Up @@ -134,6 +143,7 @@ public SchemasModelResponse(
object? defaultExample,
string? description,
string? githubUrl,
bool? isOfficial,
object? latestVersion,
string? licenseUrl,
string? name,
Expand All @@ -147,6 +157,7 @@ public SchemasModelResponse(
this.DefaultExample = defaultExample;
this.Description = description;
this.GithubUrl = githubUrl;
this.IsOfficial = isOfficial;
this.LatestVersion = latestVersion;
this.LicenseUrl = licenseUrl;
this.Name = name;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Replicate
{
public sealed partial class SchemasPageResponse
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::Replicate.SchemasPageResponse? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Replicate.SchemasPageResponse),
jsonSerializerContext) as global::Replicate.SchemasPageResponse;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::Replicate.SchemasPageResponse? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Replicate.SchemasPageResponse>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Replicate.SchemasPageResponse?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::Replicate.SchemasPageResponse),
jsonSerializerContext).ConfigureAwait(false)) as global::Replicate.SchemasPageResponse;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::Replicate.SchemasPageResponse?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Replicate.SchemasPageResponse?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

#nullable enable

namespace Replicate
{
/// <summary>
///
/// </summary>
public sealed partial class SchemasPageResponse
{
/// <summary>
/// URL path to the page
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("href")]
[global::System.Text.Json.Serialization.JsonRequired]
public required string Href { get; set; }

/// <summary>
/// Title of the page
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("name")]
[global::System.Text.Json.Serialization.JsonRequired]
public required string Name { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();

/// <summary>
/// Initializes a new instance of the <see cref="SchemasPageResponse" /> class.
/// </summary>
/// <param name="href">
/// URL path to the page
/// </param>
/// <param name="name">
/// Title of the page
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public SchemasPageResponse(
string href,
string name)
{
this.Href = href ?? throw new global::System.ArgumentNullException(nameof(href));
this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name));
}

/// <summary>
/// Initializes a new instance of the <see cref="SchemasPageResponse" /> class.
/// </summary>
public SchemasPageResponse()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Replicate
{
public sealed partial class SchemasSearchCollectionResponse
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::Replicate.SchemasSearchCollectionResponse? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Replicate.SchemasSearchCollectionResponse),
jsonSerializerContext) as global::Replicate.SchemasSearchCollectionResponse;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::Replicate.SchemasSearchCollectionResponse? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Replicate.SchemasSearchCollectionResponse>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Replicate.SchemasSearchCollectionResponse?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::Replicate.SchemasSearchCollectionResponse),
jsonSerializerContext).ConfigureAwait(false)) as global::Replicate.SchemasSearchCollectionResponse;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::Replicate.SchemasSearchCollectionResponse?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Replicate.SchemasSearchCollectionResponse?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Loading