Skip to content

Commit c6bda21

Browse files
committed
feat: mark Watch methods as obsolete to prepare for future deprecation
1 parent 6de5558 commit c6bda21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/KubernetesClient/WatcherExt.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static class WatcherExt
1616
/// The action to invoke when the server closes the connection.
1717
/// </param>
1818
/// <returns>a watch object</returns>
19+
[Obsolete("This method will be deprecated in future versions.")]
1920
public static Watcher<T> Watch<T, L>(
2021
this Task<HttpOperationResponse<L>> responseTask,
2122
Action<WatchEventType, T> onEvent,
@@ -52,6 +53,7 @@ private static Func<Task<TextReader>> MakeStreamReaderCreator<T, L>(Task<HttpOpe
5253
/// The action to invoke when the server closes the connection.
5354
/// </param>
5455
/// <returns>a watch object</returns>
56+
[Obsolete("This method will be deprecated in future versions.")]
5557
public static Watcher<T> Watch<T, L>(
5658
this HttpOperationResponse<L> response,
5759
Action<WatchEventType, T> onEvent,
@@ -71,6 +73,7 @@ public static Watcher<T> Watch<T, L>(
7173
/// <param name="onError">a callback when any exception was caught during watching</param>
7274
/// <param name="cancellationToken">cancellation token</param>
7375
/// <returns>IAsyncEnumerable of watch events</returns>
76+
[Obsolete("This method will be deprecated in future versions.")]
7477
public static IAsyncEnumerable<(WatchEventType, T)> WatchAsync<T, L>(
7578
this Task<HttpOperationResponse<L>> responseTask,
7679
Action<Exception> onError = null,

src/LibKubernetesGenerator/templates/IOperations.cs.template

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public partial interface I{{name}}Operations
2525
/// <param name="cancellationToken">
2626
/// A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
2727
/// </param>
28-
{{if IfParamContains api.operation "watch"}}
29-
[Obsolete("This method will be deprecated in future versions. Please use the Watch method instead.")]
30-
{{end}}
3128
Task<HttpOperationResponse{{GetReturnType api.operation "<>"}}> {{GetOperationId api.operation "WithHttpMessagesAsync"}}(
3229
{{ for parameter in api.operation.parameters}}
3330
{{GetDotNetTypeOpenApiParameter parameter}} {{GetDotNetNameOpenApiParameter parameter "true"}},

0 commit comments

Comments
 (0)