diff --git a/src/libs/Replicate/Generated/Replicate.Exceptions.g.cs b/src/libs/Replicate/Generated/Replicate.Exceptions.g.cs index 8bef3b2..b7821e6 100644 --- a/src/libs/Replicate/Generated/Replicate.Exceptions.g.cs +++ b/src/libs/Replicate/Generated/Replicate.Exceptions.g.cs @@ -43,7 +43,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// The HTTP status code of the response. - public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) + public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) { StatusCode = statusCode; } @@ -83,7 +83,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// The HTTP status code of the response. - public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) + public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } } diff --git a/src/libs/Replicate/Generated/Replicate.IReplicateApi.DeploymentsPredictionsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.IReplicateApi.DeploymentsPredictionsCreate.g.cs index 229e6c4..93b9c3e 100644 --- a/src/libs/Replicate/Generated/Replicate.IReplicateApi.DeploymentsPredictionsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.IReplicateApi.DeploymentsPredictionsCreate.g.cs @@ -70,7 +70,8 @@ public partial interface IReplicateApi /// This field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming. /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -88,7 +89,8 @@ public partial interface IReplicateApi /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// /// The token to cancel the operation with /// diff --git a/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsPredictionsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsPredictionsCreate.g.cs index 0a847f6..71d850c 100644 --- a/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsPredictionsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsPredictionsCreate.g.cs @@ -72,7 +72,8 @@ public partial interface IReplicateApi /// This field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming. /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -90,7 +91,8 @@ public partial interface IReplicateApi /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// /// The token to cancel the operation with /// diff --git a/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsCreate.g.cs index 0db205e..787c18a 100644 --- a/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsCreate.g.cs @@ -68,10 +68,12 @@ public partial interface IReplicateApi /// /// The ID of the model version that you want to run. This can be specified in two formats:
/// 1. Just the 64-character version ID: `9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
- /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426` + /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
+ /// Example: replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426 /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -90,7 +92,8 @@ public partial interface IReplicateApi /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// /// The token to cancel the operation with /// diff --git a/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionRequest.g.cs b/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionRequest.g.cs index 219630c..3d6160c 100644 --- a/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionRequest.g.cs +++ b/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionRequest.g.cs @@ -33,8 +33,10 @@ public sealed partial class SchemasPredictionRequest public bool? Stream { get; set; } /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler ///
+ /// https://example.com/my-webhook-handler [global::System.Text.Json.Serialization.JsonPropertyName("webhook")] public string? Webhook { get; set; } @@ -54,8 +56,10 @@ public sealed partial class SchemasPredictionRequest /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// + /// [start, completed] [global::System.Text.Json.Serialization.JsonPropertyName("webhook_events_filter")] public global::System.Collections.Generic.IList? WebhookEventsFilter { get; set; } @@ -86,7 +90,8 @@ public sealed partial class SchemasPredictionRequest /// This field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming. /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -104,7 +109,8 @@ public sealed partial class SchemasPredictionRequest /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Replicate/Generated/Replicate.Models.SchemasVersionPredictionRequest.g.cs b/src/libs/Replicate/Generated/Replicate.Models.SchemasVersionPredictionRequest.g.cs index fa7ac36..001f0c7 100644 --- a/src/libs/Replicate/Generated/Replicate.Models.SchemasVersionPredictionRequest.g.cs +++ b/src/libs/Replicate/Generated/Replicate.Models.SchemasVersionPredictionRequest.g.cs @@ -35,15 +35,19 @@ public sealed partial class SchemasVersionPredictionRequest /// /// The ID of the model version that you want to run. This can be specified in two formats:
/// 1. Just the 64-character version ID: `9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
- /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426` + /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
+ /// Example: replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426 ///
+ /// replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426 [global::System.Text.Json.Serialization.JsonPropertyName("version")] [global::System.Text.Json.Serialization.JsonRequired] public required string Version { get; set; } /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler ///
+ /// https://example.com/my-webhook-handler [global::System.Text.Json.Serialization.JsonPropertyName("webhook")] public string? Webhook { get; set; } @@ -64,8 +68,10 @@ public sealed partial class SchemasVersionPredictionRequest /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// + /// [start, completed] [global::System.Text.Json.Serialization.JsonPropertyName("webhook_events_filter")] public global::System.Collections.Generic.IList? WebhookEventsFilter { get; set; } @@ -98,10 +104,12 @@ public sealed partial class SchemasVersionPredictionRequest /// /// The ID of the model version that you want to run. This can be specified in two formats:
/// 1. Just the 64-character version ID: `9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
- /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426` + /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
+ /// Example: replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426 /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -120,7 +128,8 @@ public sealed partial class SchemasVersionPredictionRequest /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.AccountGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.AccountGet.g.cs index 6c6c0d4..40e56a5 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.AccountGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.AccountGet.g.cs @@ -115,8 +115,12 @@ partial void ProcessAccountGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.AccountGetResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -130,18 +134,24 @@ partial void ProcessAccountGetResponseContent( h => h.Value), }; } - - return - global::Replicate.AccountGetResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.AccountGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -154,16 +164,6 @@ partial void ProcessAccountGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.AccountGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsGet.g.cs index 976bd0f..3141856 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsGet.g.cs @@ -111,8 +111,9 @@ partial void ProcessCollectionsGetResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -126,15 +127,21 @@ partial void ProcessCollectionsGetResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -147,13 +154,6 @@ partial void ProcessCollectionsGetResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsList.g.cs index dc425e5..73017c6 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.CollectionsList.g.cs @@ -110,8 +110,9 @@ partial void ProcessCollectionsListResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -125,15 +126,21 @@ partial void ProcessCollectionsListResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -146,13 +153,6 @@ partial void ProcessCollectionsListResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsCreate.g.cs index 71c8dd1..2090cac 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsCreate.g.cs @@ -155,8 +155,12 @@ partial void ProcessDeploymentsCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -170,18 +174,24 @@ partial void ProcessDeploymentsCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -194,16 +204,6 @@ partial void ProcessDeploymentsCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsDelete.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsDelete.g.cs index c55b163..c699d13 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsDelete.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsDelete.g.cs @@ -112,8 +112,9 @@ partial void ProcessDeploymentsDeleteResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -127,15 +128,21 @@ partial void ProcessDeploymentsDeleteResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -148,13 +155,6 @@ partial void ProcessDeploymentsDeleteResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsGet.g.cs index f33c6d6..7871a5a 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsGet.g.cs @@ -143,8 +143,12 @@ partial void ProcessDeploymentsGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -158,18 +162,24 @@ partial void ProcessDeploymentsGetResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -182,16 +192,6 @@ partial void ProcessDeploymentsGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsList.g.cs index 1cbf5d7..ed1c628 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsList.g.cs @@ -137,8 +137,12 @@ partial void ProcessDeploymentsListResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.DeploymentsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -152,18 +156,24 @@ partial void ProcessDeploymentsListResponseContent( h => h.Value), }; } - - return - global::Replicate.DeploymentsListResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.DeploymentsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -176,16 +186,6 @@ partial void ProcessDeploymentsListResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.DeploymentsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsPredictionsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsPredictionsCreate.g.cs index 36c1363..b61a15b 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsPredictionsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsPredictionsCreate.g.cs @@ -150,8 +150,12 @@ partial void ProcessDeploymentsPredictionsCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -165,18 +169,24 @@ partial void ProcessDeploymentsPredictionsCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -189,16 +199,6 @@ partial void ProcessDeploymentsPredictionsCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } @@ -239,7 +239,8 @@ partial void ProcessDeploymentsPredictionsCreateResponseContent( /// This field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming. /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -257,7 +258,8 @@ partial void ProcessDeploymentsPredictionsCreateResponseContent( /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// /// The token to cancel the operation with /// diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsUpdate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsUpdate.g.cs index d668cfe..5ddcaa7 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsUpdate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.DeploymentsUpdate.g.cs @@ -161,8 +161,12 @@ partial void ProcessDeploymentsUpdateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -176,18 +180,24 @@ partial void ProcessDeploymentsUpdateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -200,16 +210,6 @@ partial void ProcessDeploymentsUpdateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesCreate.g.cs index e13ac03..d342375 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesCreate.g.cs @@ -128,20 +128,29 @@ partial void ProcessFilesCreateResponseContent( if ((int)__response.StatusCode == 413) { string? __content_413 = null; + global::System.Exception? __exception_413 = null; global::Replicate.FilesCreateResponse? __value_413 = null; - if (ReadResponseAsString) + try { - __content_413 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_413 = global::Replicate.FilesCreateResponse.FromJson(__content_413, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_413 = global::Replicate.FilesCreateResponse.FromJson(__content_413, JsonSerializerContext); + } + else + { + var __contentStream_413 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_413 = await global::Replicate.FilesCreateResponse.FromJsonStreamAsync(__contentStream_413, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_413 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_413 = await global::Replicate.FilesCreateResponse.FromJsonStreamAsync(__contentStream_413, JsonSerializerContext).ConfigureAwait(false); + __exception_413 = __ex; } throw new global::Replicate.ApiException( message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, statusCode: __response.StatusCode) { ResponseBody = __content_413, @@ -173,8 +182,12 @@ partial void ProcessFilesCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasFileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -188,18 +201,24 @@ partial void ProcessFilesCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasFileResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -212,16 +231,6 @@ partial void ProcessFilesCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDelete.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDelete.g.cs index fe8e517..a05f557 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDelete.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDelete.g.cs @@ -90,20 +90,29 @@ partial void ProcessFilesDeleteResponse( if ((int)__response.StatusCode == 404) { string? __content_404 = null; + global::System.Exception? __exception_404 = null; global::Replicate.FilesDeleteResponse? __value_404 = null; - if (ReadResponseAsString) + try { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::Replicate.FilesDeleteResponse.FromJson(__content_404, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_404 = global::Replicate.FilesDeleteResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_404 = await global::Replicate.FilesDeleteResponse.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_404 = await global::Replicate.FilesDeleteResponse.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + __exception_404 = __ex; } throw new global::Replicate.ApiException( message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, statusCode: __response.StatusCode) { ResponseBody = __content_404, @@ -131,8 +140,9 @@ partial void ProcessFilesDeleteResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,15 +156,21 @@ partial void ProcessFilesDeleteResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -167,13 +183,6 @@ partial void ProcessFilesDeleteResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDownload.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDownload.g.cs index 88b4a4b..7d944c3 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDownload.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesDownload.g.cs @@ -116,20 +116,29 @@ partial void ProcessFilesDownloadResponseContent( if ((int)__response.StatusCode == 404) { string? __content_404 = null; + global::System.Exception? __exception_404 = null; global::Replicate.FilesDownloadResponse? __value_404 = null; - if (ReadResponseAsString) + try { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::Replicate.FilesDownloadResponse.FromJson(__content_404, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_404 = global::Replicate.FilesDownloadResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_404 = await global::Replicate.FilesDownloadResponse.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_404 = await global::Replicate.FilesDownloadResponse.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + __exception_404 = __ex; } throw new global::Replicate.ApiException( message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, statusCode: __response.StatusCode) { ResponseBody = __content_404, @@ -157,8 +166,10 @@ partial void ProcessFilesDownloadResponseContent( try { __response.EnsureSuccessStatusCode(); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -171,16 +182,22 @@ partial void ProcessFilesDownloadResponseContent( h => h.Value), }; } - - return __content; } else { try { __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsByteArrayAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -193,14 +210,6 @@ partial void ProcessFilesDownloadResponseContent( h => h.Value), }; } - - var __content = await __response.Content.ReadAsByteArrayAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesGet.g.cs index 433de68..6857fa3 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesGet.g.cs @@ -95,20 +95,29 @@ partial void ProcessFilesGetResponseContent( if ((int)__response.StatusCode == 404) { string? __content_404 = null; + global::System.Exception? __exception_404 = null; global::Replicate.FilesGetResponse? __value_404 = null; - if (ReadResponseAsString) + try { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::Replicate.FilesGetResponse.FromJson(__content_404, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_404 = global::Replicate.FilesGetResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_404 = await global::Replicate.FilesGetResponse.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_404 = await global::Replicate.FilesGetResponse.FromJsonStreamAsync(__contentStream_404, JsonSerializerContext).ConfigureAwait(false); + __exception_404 = __ex; } throw new global::Replicate.ApiException( message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, statusCode: __response.StatusCode) { ResponseBody = __content_404, @@ -140,8 +149,12 @@ partial void ProcessFilesGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasFileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -155,18 +168,24 @@ partial void ProcessFilesGetResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasFileResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -179,16 +198,6 @@ partial void ProcessFilesGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesList.g.cs index 0d20dc7..4467d42 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.FilesList.g.cs @@ -107,8 +107,12 @@ partial void ProcessFilesListResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.FilesListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -122,18 +126,24 @@ partial void ProcessFilesListResponseContent( h => h.Value), }; } - - return - global::Replicate.FilesListResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.FilesListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -146,16 +156,6 @@ partial void ProcessFilesListResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.FilesListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.HardwareList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.HardwareList.g.cs index 41442ec..17a08ba 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.HardwareList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.HardwareList.g.cs @@ -114,8 +114,12 @@ partial void ProcessHardwareListResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -129,18 +133,24 @@ partial void ProcessHardwareListResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -153,16 +163,6 @@ partial void ProcessHardwareListResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsCreate.g.cs index 5d324d7..d19bfe2 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsCreate.g.cs @@ -140,8 +140,12 @@ partial void ProcessModelsCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -155,18 +159,24 @@ partial void ProcessModelsCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -179,16 +189,6 @@ partial void ProcessModelsCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsDelete.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsDelete.g.cs index a53bbaf..c703c88 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsDelete.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsDelete.g.cs @@ -114,8 +114,9 @@ partial void ProcessModelsDeleteResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -129,15 +130,21 @@ partial void ProcessModelsDeleteResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -150,13 +157,6 @@ partial void ProcessModelsDeleteResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsExamplesList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsExamplesList.g.cs index 1ebbe5d..82bada6 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsExamplesList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsExamplesList.g.cs @@ -121,8 +121,9 @@ partial void ProcessModelsExamplesListResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -136,15 +137,21 @@ partial void ProcessModelsExamplesListResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -157,13 +164,6 @@ partial void ProcessModelsExamplesListResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsGet.g.cs index 9d529e2..41c42e1 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsGet.g.cs @@ -158,8 +158,9 @@ partial void ProcessModelsGetResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -173,15 +174,21 @@ partial void ProcessModelsGetResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -194,13 +201,6 @@ partial void ProcessModelsGetResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsList.g.cs index b7620f5..9574975 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsList.g.cs @@ -108,8 +108,12 @@ partial void ProcessModelsListResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.ModelsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -123,18 +127,24 @@ partial void ProcessModelsListResponseContent( h => h.Value), }; } - - return - global::Replicate.ModelsListResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.ModelsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -147,16 +157,6 @@ partial void ProcessModelsListResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.ModelsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsPredictionsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsPredictionsCreate.g.cs index 20ef7a1..0722677 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsPredictionsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsPredictionsCreate.g.cs @@ -151,8 +151,12 @@ partial void ProcessModelsPredictionsCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -166,18 +170,24 @@ partial void ProcessModelsPredictionsCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -190,16 +200,6 @@ partial void ProcessModelsPredictionsCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } @@ -241,7 +241,8 @@ partial void ProcessModelsPredictionsCreateResponseContent( /// This field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming. /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -259,7 +260,8 @@ partial void ProcessModelsPredictionsCreateResponseContent( /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// /// The token to cancel the operation with /// diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsReadmeGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsReadmeGet.g.cs index bd186dd..e6afa32 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsReadmeGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsReadmeGet.g.cs @@ -106,17 +106,26 @@ partial void ProcessModelsReadmeGetResponseContent( if ((int)__response.StatusCode == 404) { string? __content_404 = null; - if (ReadResponseAsString) + global::System.Exception? __exception_404 = null; + try { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + if (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __exception_404 = __ex; } throw new global::Replicate.ApiException( message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, statusCode: __response.StatusCode) { ResponseBody = __content_404, @@ -147,8 +156,10 @@ partial void ProcessModelsReadmeGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -162,16 +173,22 @@ partial void ProcessModelsReadmeGetResponseContent( h => h.Value), }; } - - return __content; } else { try { __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -184,14 +201,6 @@ partial void ProcessModelsReadmeGetResponseContent( h => h.Value), }; } - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsDelete.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsDelete.g.cs index f14b98b..ac64454 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsDelete.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsDelete.g.cs @@ -123,8 +123,9 @@ partial void ProcessModelsVersionsDeleteResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -138,15 +139,21 @@ partial void ProcessModelsVersionsDeleteResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -159,13 +166,6 @@ partial void ProcessModelsVersionsDeleteResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsGet.g.cs index 3e0b98d..90b00a1 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsGet.g.cs @@ -150,8 +150,9 @@ partial void ProcessModelsVersionsGetResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -165,15 +166,21 @@ partial void ProcessModelsVersionsGetResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -186,13 +193,6 @@ partial void ProcessModelsVersionsGetResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsList.g.cs index 2c98c0c..340da05 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsVersionsList.g.cs @@ -123,8 +123,9 @@ partial void ProcessModelsVersionsListResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -138,15 +139,21 @@ partial void ProcessModelsVersionsListResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -159,13 +166,6 @@ partial void ProcessModelsVersionsListResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCancel.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCancel.g.cs index 6835c46..a6c7e3f 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCancel.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCancel.g.cs @@ -125,8 +125,12 @@ partial void ProcessPredictionsCancelResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -140,18 +144,24 @@ partial void ProcessPredictionsCancelResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -164,16 +174,6 @@ partial void ProcessPredictionsCancelResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCreate.g.cs index 47c4d5d..7cf7dbe 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsCreate.g.cs @@ -139,8 +139,12 @@ partial void ProcessPredictionsCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -154,18 +158,24 @@ partial void ProcessPredictionsCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -178,16 +188,6 @@ partial void ProcessPredictionsCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } @@ -229,10 +229,12 @@ partial void ProcessPredictionsCreateResponseContent( /// /// The ID of the model version that you want to run. This can be specified in two formats:
/// 1. Just the 64-character version ID: `9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
- /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426` + /// 2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`
+ /// Example: replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426 /// /// - /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting. + /// An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.
+ /// Example: https://example.com/my-webhook-handler /// /// /// By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:
@@ -251,7 +253,8 @@ partial void ProcessPredictionsCreateResponseContent( /// "webhook_events_filter": ["start", "completed"]
/// }
/// ```
- /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling. + /// Requests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.
+ /// Example: [start, completed] /// /// The token to cancel the operation with /// diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs index 8a3e799..0a85e81 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs @@ -151,8 +151,12 @@ partial void ProcessPredictionsGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -166,18 +170,24 @@ partial void ProcessPredictionsGetResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasPredictionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -190,16 +200,6 @@ partial void ProcessPredictionsGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasPredictionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsList.g.cs index f512e25..bf39945 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsList.g.cs @@ -163,8 +163,12 @@ partial void ProcessPredictionsListResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.PredictionsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -178,18 +182,24 @@ partial void ProcessPredictionsListResponseContent( h => h.Value), }; } - - return - global::Replicate.PredictionsListResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.PredictionsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -202,16 +212,6 @@ partial void ProcessPredictionsListResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.PredictionsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCancel.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCancel.g.cs index 0acfc61..3013a14 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCancel.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCancel.g.cs @@ -105,8 +105,12 @@ partial void ProcessTrainingsCancelResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasTrainingResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -120,18 +124,24 @@ partial void ProcessTrainingsCancelResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasTrainingResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasTrainingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -144,16 +154,6 @@ partial void ProcessTrainingsCancelResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasTrainingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCreate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCreate.g.cs index 6417e30..b25c759 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCreate.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsCreate.g.cs @@ -173,8 +173,12 @@ partial void ProcessTrainingsCreateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasTrainingResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -188,18 +192,24 @@ partial void ProcessTrainingsCreateResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasTrainingResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasTrainingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -212,16 +222,6 @@ partial void ProcessTrainingsCreateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasTrainingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs index 3d5e4c0..1c99e0e 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs @@ -150,8 +150,12 @@ partial void ProcessTrainingsGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasTrainingResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -165,18 +169,24 @@ partial void ProcessTrainingsGetResponseContent( h => h.Value), }; } - - return - global::Replicate.SchemasTrainingResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasTrainingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -189,16 +199,6 @@ partial void ProcessTrainingsGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.SchemasTrainingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsList.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsList.g.cs index 3067fa7..ec7b99a 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsList.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsList.g.cs @@ -147,8 +147,12 @@ partial void ProcessTrainingsListResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.TrainingsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -162,18 +166,24 @@ partial void ProcessTrainingsListResponseContent( h => h.Value), }; } - - return - global::Replicate.TrainingsListResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.TrainingsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -186,16 +196,6 @@ partial void ProcessTrainingsListResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.TrainingsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.WebhooksDefaultSecretGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.WebhooksDefaultSecretGet.g.cs index 4bea831..8b16d95 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.WebhooksDefaultSecretGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.WebhooksDefaultSecretGet.g.cs @@ -112,8 +112,12 @@ partial void ProcessWebhooksDefaultSecretGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Replicate.WebhooksDefaultSecretGetResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -127,18 +131,24 @@ partial void ProcessWebhooksDefaultSecretGetResponseContent( h => h.Value), }; } - - return - global::Replicate.WebhooksDefaultSecretGetResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.WebhooksDefaultSecretGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Replicate.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -151,16 +161,6 @@ partial void ProcessWebhooksDefaultSecretGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Replicate.WebhooksDefaultSecretGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Replicate/openapi.yaml b/src/libs/Replicate/openapi.yaml index 159d880..edd9640 100644 --- a/src/libs/Replicate/openapi.yaml +++ b/src/libs/Replicate/openapi.yaml @@ -1158,12 +1158,16 @@ components: input: type: object description: "The model's input as a JSON object. The input schema depends on what model you are running. To see the available inputs, click the \"API\" tab on the model you are running or [get the model version](#models.versions.get) and look at its `openapi_schema` property. For example, [stability-ai/sdxl](https://replicate.com/stability-ai/sdxl) takes `prompt` as an input.\n\nFiles should be passed as HTTP URLs or data URLs.\n\nUse an HTTP URL when:\n\n- you have a large file > 256kb\n- you want to be able to use the file multiple times\n- you want your prediction metadata to be associable with your input files\n\nUse a data URL when:\n\n- you have a small file <= 256kb\n- you don't want to upload and host the file somewhere\n- you don't need to use the file again (Replicate will not store it)\n" + example: + prompt: Tell me a joke + system_prompt: You are a helpful assistant stream: type: boolean description: "**This field is deprecated.**\n\nRequest a URL to receive streaming output using [server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).\n\nThis field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming.\n" webhook: type: string description: "An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.\n" + example: https://example.com/my-webhook-handler webhook_events_filter: type: array items: @@ -1174,6 +1178,9 @@ components: - completed type: string description: "By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:\n\n- `start`: immediately on prediction start\n- `output`: each time a prediction generates an output (note that predictions can generate multiple outputs)\n- `logs`: each time log output is generated by a prediction\n- `completed`: when the prediction reaches a terminal state (succeeded/canceled/failed)\n\nFor example, if you only wanted requests to be sent at the start and end of the prediction, you would provide:\n\n```json\n{\n \"input\": {\n \"text\": \"Alice\"\n },\n \"webhook\": \"https://example.com/my-webhook\",\n \"webhook_events_filter\": [\"start\", \"completed\"]\n}\n```\n\nRequests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.\n" + example: + - start + - completed additionalProperties: false schemas_prediction_response: required: @@ -1379,15 +1386,19 @@ components: input: type: object description: "The model's input as a JSON object. The input schema depends on what model you are running. To see the available inputs, click the \"API\" tab on the model you are running or [get the model version](#models.versions.get) and look at its `openapi_schema` property. For example, [stability-ai/sdxl](https://replicate.com/stability-ai/sdxl) takes `prompt` as an input.\n\nFiles should be passed as HTTP URLs or data URLs.\n\nUse an HTTP URL when:\n\n- you have a large file > 256kb\n- you want to be able to use the file multiple times\n- you want your prediction metadata to be associable with your input files\n\nUse a data URL when:\n\n- you have a small file <= 256kb\n- you don't want to upload and host the file somewhere\n- you don't need to use the file again (Replicate will not store it)\n" + example: + text: Alice stream: type: boolean description: "**This field is deprecated.**\n\nRequest a URL to receive streaming output using [server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).\n\nThis field is no longer needed as the returned prediction will always have a `stream` entry in its `url` property if the model supports streaming.\n" version: type: string description: "The ID of the model version that you want to run. This can be specified in two formats:\n\n1. Just the 64-character version ID: `9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`\n2. Full model identifier with version ID in the format `{owner}/{model}:{id}`. For example, `replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426`\n" + example: replicate/hello-world:9dcd6d78e7c6560c340d916fe32e9f24aabfa331e5cce95fe31f77fb03121426 webhook: type: string description: "An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.\n" + example: https://example.com/my-webhook-handler webhook_events_filter: type: array items: @@ -1398,6 +1409,9 @@ components: - completed type: string description: "By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:\n\n- `start`: immediately on prediction start\n- `output`: each time a prediction generates an output (note that predictions can generate multiple outputs)\n- `logs`: each time log output is generated by a prediction\n- `completed`: when the prediction reaches a terminal state (succeeded/canceled/failed)\n\nFor example, if you only wanted requests to be sent at the start and end of the prediction, you would provide:\n\n```json\n{\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"webhook\": \"https://example.com/my-webhook\",\n \"webhook_events_filter\": [\"start\", \"completed\"]\n}\n```\n\nRequests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.\n" + example: + - start + - completed additionalProperties: false parameters: parameters_prefer_header: