mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Use interfaces for Polly retry policies (#20821)
This enables use of ResiliencePipelineBuilder which returns the interface when calling AsSyncPolicy / AsAsyncPolicy
This commit is contained in:
parent
7d9e1ecc22
commit
7f40ce0dd8
@ -19,23 +19,23 @@ namespace {{packageName}}.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
{{/useRestSharp}}
|
||||
{{#useHttpClient}}
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||
{{/useHttpClient}}
|
||||
}
|
||||
}
|
||||
|
@ -22,11 +22,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
public static ISyncPolicy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
public static IAsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user