forked from loafle/openapi-generator-original
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:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user