From eeea6a346995b8eda6f4c9d55b1a35beffa5ee6e Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 8 Jan 2025 14:23:56 +0100 Subject: [PATCH] Mark a few deprecated methods as such These have been deprecated in the spec for years. --- csharp/Svix/MessageAttempt.cs | 4 ++++ go/message_attempt.go | 1 + java/lib/src/main/java/com/svix/MessageAttempt.java | 4 ++++ python/svix/api.py | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/csharp/Svix/MessageAttempt.cs b/csharp/Svix/MessageAttempt.cs index d9a4e2d2c..9472f5b74 100644 --- a/csharp/Svix/MessageAttempt.cs +++ b/csharp/Svix/MessageAttempt.cs @@ -265,6 +265,7 @@ public async Task ListAttemptsByMessageAsync(stri } // Deprecated + [Obsolete("Use ListAttemptsByMessage instead, passing the endpoint ID through options")] public ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default) { @@ -297,6 +298,7 @@ public ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appI } // Deprecated + [Obsolete("Use ListAttemptsByMessageAsync instead, passing the endpoint ID through options")] public async Task ListAttemptsForEndpointAsync(string appId, string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default) @@ -331,6 +333,7 @@ public async Task ListAttemptsForEndpoint } // Deprecated + [Obsolete("Use ListAttemptsByEndpoint or ListAttemptsByMessage instead")] public ListResponseMessageAttemptOut ListAttempts(string appId, string messageId, MessageAttemptListOptions options = null, string idempotencyKey = default) { @@ -364,6 +367,7 @@ public ListResponseMessageAttemptOut ListAttempts(string appId, string messageId } // Deprecated + [Obsolete("Use ListAttemptsByEndpointAsync or ListAttemptsByMessageAsync instead")] public async Task ListAttemptsAsync(string appId, string messageId, MessageAttemptListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default) { diff --git a/go/message_attempt.go b/go/message_attempt.go index ea66ba6e1..5295010cb 100644 --- a/go/message_attempt.go +++ b/go/message_attempt.go @@ -211,6 +211,7 @@ func (m *MessageAttempt) ListAttemptedDestinations(ctx context.Context, appId st return ret, nil } +// Deprecated: use `ListByMsg` instead, passing the endpoint ID through options func (m *MessageAttempt) ListAttemptsForEndpoint(ctx context.Context, appId string, msgId string, endpointId string, options *MessageAttemptListOptions) (*ListResponseMessageAttemptEndpointOut, error) { req := m.api.MessageAttemptAPI.V1MessageAttemptListByEndpointDeprecated(ctx, appId, msgId, endpointId) if options != nil { diff --git a/java/lib/src/main/java/com/svix/MessageAttempt.java b/java/lib/src/main/java/com/svix/MessageAttempt.java index b46a9050a..546c64028 100644 --- a/java/lib/src/main/java/com/svix/MessageAttempt.java +++ b/java/lib/src/main/java/com/svix/MessageAttempt.java @@ -118,6 +118,10 @@ public ListResponseMessageEndpointOut listAttemptedDestinations(final String app } } + /* + * @deprecated: use listByMsg instead, passing the endpoint ID through options + */ + @Deprecated public ListResponseMessageAttemptEndpointOut listAttemptsForEndpoint(final String appId, final String msgId, final String endpointId, final MessageAttemptListOptions options) throws ApiException { try { diff --git a/python/svix/api.py b/python/svix/api.py index 6ee073a6b..2431f6473 100644 --- a/python/svix/api.py +++ b/python/svix/api.py @@ -1267,6 +1267,9 @@ async def list_attempted_destinations( **options.to_dict(), ) + @deprecated( + reason="use list_by_msg instead, passing the endpoint id through options" + ) async def list_attempts_for_endpoint( self, app_id: str, @@ -1378,6 +1381,9 @@ def list_attempted_destinations( **options.to_dict(), ) + @deprecated( + reason="use list_by_msg instead, passing the endpoint id through options" + ) def list_attempts_for_endpoint( self, app_id: str,