Skip to content

Commit 0acf72d

Browse files
committed
Throwing NotSupported across the board
1 parent ccfd188 commit 0acf72d

File tree

18 files changed

+40
-19
lines changed

18 files changed

+40
-19
lines changed

sdk/communication/Azure.Communication.Email/src/EmailSendOperation.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ async ValueTask<OperationState<EmailSendResult>> IOperation<EmailSendResult>.Upd
184184
return OperationState<EmailSendResult>.Pending(rawResponse);
185185
}
186186

187+
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
188+
RehydrationToken IOperation<EmailSendResult>.GetRehydrationToken() =>
189+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
190+
187191
private static IDictionary<string, string> CreateAdditionalInformation(ErrorDetail error)
188192
{
189193
if (string.IsNullOrEmpty(error.ToString()))

sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/PostLedgerEntryOperation.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
7979
return OperationState.Pending(statusResponse);
8080
}
8181

82+
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
83+
RehydrationToken IOperation.GetRehydrationToken() =>
84+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
85+
8286
/// <summary>
8387
/// The transactionId of the posted ledger entry.
8488
/// </summary>

sdk/core/Azure.Core/src/Shared/OperationInternalBase.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ public Response WaitForCompletionResponse(CancellationToken cancellationToken)
185185
public Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken)
186186
=> WaitForCompletionResponseAsync(async: false, pollingInterval, _waitForCompletionResponseScopeName, cancellationToken).EnsureCompleted();
187187

188-
/// <summary>
189-
/// Get a token that can be used to rehydrate the operation.
190-
/// </summary>
191-
public RehydrationToken GetRehydrationToken(RequestMethod requestMethod, Uri startRequestUri, OperationFinalStateVia finalStateVia)
192-
=> NextLinkOperationImplementation.GetRehydrationToken(requestMethod, startRequestUri, RawResponse, finalStateVia);
193-
194188
protected async ValueTask<Response> WaitForCompletionResponseAsync(bool async, TimeSpan? pollingInterval, string scopeName, CancellationToken cancellationToken)
195189
{
196190
// If _responseLock has the value, lockOrValue will contain that value, and no lock is acquired.

sdk/keyvault/Azure.Security.KeyVault.Certificates/src/DeleteCertificateOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
116116
}
117117

118118
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
119-
RehydrationToken IOperation.GetRehydrationToken() => default;
119+
RehydrationToken IOperation.GetRehydrationToken() =>
120+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
120121
}
121122
}

sdk/keyvault/Azure.Security.KeyVault.Certificates/src/RecoverDeletedCertificateOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
106106
}
107107

108108
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
109-
RehydrationToken IOperation.GetRehydrationToken() => default;
109+
RehydrationToken IOperation.GetRehydrationToken() =>
110+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
110111
}
111112
}

sdk/keyvault/Azure.Security.KeyVault.Keys/src/DeleteKeyOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
116116
}
117117

118118
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
119-
RehydrationToken IOperation.GetRehydrationToken() => default;
119+
RehydrationToken IOperation.GetRehydrationToken() =>
120+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
120121
}
121122
}

sdk/keyvault/Azure.Security.KeyVault.Keys/src/RecoverDeletedKeyOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
106106
}
107107

108108
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
109-
RehydrationToken IOperation.GetRehydrationToken() => default;
109+
RehydrationToken IOperation.GetRehydrationToken() =>
110+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
110111
}
111112
}

sdk/keyvault/Azure.Security.KeyVault.Secrets/src/DeleteSecretOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
112112
}
113113

114114
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
115-
RehydrationToken IOperation.GetRehydrationToken() => default;
115+
RehydrationToken IOperation.GetRehydrationToken() =>
116+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
116117
}
117118
}

sdk/keyvault/Azure.Security.KeyVault.Secrets/src/RecoverDeletedSecretOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
102102
}
103103

104104
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
105-
RehydrationToken IOperation.GetRehydrationToken() => default;
105+
RehydrationToken IOperation.GetRehydrationToken() =>
106+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
106107
}
107108
}

sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperation.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ public ValueTask<OperationState> UpdateStateAsync(bool async, CancellationToken
119119
return new ValueTask<OperationState>(OnUpdateState(cancellationToken));
120120
}
121121

122+
RehydrationToken IOperation.GetRehydrationToken() =>
123+
throw new NotImplementedException();
124+
122125
public MockOperationInternal MockOperationInternal { get; }
123126

124127
public Func<CancellationToken, OperationState> OnUpdateState { get; set; }

sdk/resourcemanager/Azure.ResourceManager/tests/TestFramework/MockOperationOfT.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ ValueTask<OperationState<T>> IOperation<T>.UpdateStateAsync(bool async, Cancella
129129
return new ValueTask<OperationState<T>>(OnUpdateState(cancellationToken));
130130
}
131131

132+
RehydrationToken IOperation<T>.GetRehydrationToken() =>
133+
throw new NotImplementedException();
134+
132135
internal MockOperationInternal<T> MockOperationInternal { get; }
133136

134137
internal Func<CancellationToken, OperationState<T>> OnUpdateState { get; set; }

sdk/textanalytics/Azure.AI.TextAnalytics/src/AbstractiveSummarizeOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ async ValueTask<OperationState<AsyncPageable<AbstractiveSummarizeResultCollectio
296296
}
297297

298298
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
299-
RehydrationToken IOperation<AsyncPageable<AbstractiveSummarizeResultCollection>>.GetRehydrationToken() => default;
299+
RehydrationToken IOperation<AsyncPageable<AbstractiveSummarizeResultCollection>>.GetRehydrationToken() =>
300+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
300301
}
301302
}

sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeActionsOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ async ValueTask<OperationState<AsyncPageable<AnalyzeActionsResult>>> IOperation<
322322
}
323323

324324
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
325-
RehydrationToken IOperation<AsyncPageable<AnalyzeActionsResult>>.GetRehydrationToken() => default;
325+
RehydrationToken IOperation<AsyncPageable<AnalyzeActionsResult>>.GetRehydrationToken() =>
326+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
326327

327328
private AsyncPageable<AnalyzeActionsResult> CreateOperationValueAsync(CancellationToken cancellationToken = default)
328329
{

sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ async ValueTask<OperationState<AsyncPageable<AnalyzeHealthcareEntitiesResultColl
296296
}
297297

298298
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
299-
RehydrationToken IOperation<AsyncPageable<AnalyzeHealthcareEntitiesResultCollection>>.GetRehydrationToken() => default;
299+
RehydrationToken IOperation<AsyncPageable<AnalyzeHealthcareEntitiesResultCollection>>.GetRehydrationToken() =>
300+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
300301
}
301302
}

sdk/textanalytics/Azure.AI.TextAnalytics/src/ClassifyDocumentOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ async ValueTask<OperationState<AsyncPageable<ClassifyDocumentResultCollection>>>
296296
}
297297

298298
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
299-
RehydrationToken IOperation<AsyncPageable<ClassifyDocumentResultCollection>>.GetRehydrationToken() => default;
299+
RehydrationToken IOperation<AsyncPageable<ClassifyDocumentResultCollection>>.GetRehydrationToken() =>
300+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
300301
}
301302
}

sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractiveSummarizeOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ async ValueTask<OperationState<AsyncPageable<ExtractiveSummarizeResultCollection
296296
}
297297

298298
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
299-
RehydrationToken IOperation<AsyncPageable<ExtractiveSummarizeResultCollection>>.GetRehydrationToken() => default;
299+
RehydrationToken IOperation<AsyncPageable<ExtractiveSummarizeResultCollection>>.GetRehydrationToken() =>
300+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
300301
}
301302
}

sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeCustomEntitiesOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ async ValueTask<OperationState<AsyncPageable<RecognizeCustomEntitiesResultCollec
296296
}
297297

298298
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
299-
RehydrationToken IOperation<AsyncPageable<RecognizeCustomEntitiesResultCollection>>.GetRehydrationToken() => default;
299+
RehydrationToken IOperation<AsyncPageable<RecognizeCustomEntitiesResultCollection>>.GetRehydrationToken() =>
300+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
300301
}
301302
}

sdk/translation/Azure.AI.Translation.Document/src/DocumentTranslationOperation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ async ValueTask<OperationState<AsyncPageable<DocumentStatusResult>>> IOperation<
241241
}
242242

243243
// This method is never invoked since we don't override Operation<T>.GetRehydrationToken.
244-
RehydrationToken IOperation<AsyncPageable<DocumentStatusResult>>.GetRehydrationToken() => default;
244+
RehydrationToken IOperation<AsyncPageable<DocumentStatusResult>>.GetRehydrationToken() =>
245+
throw new NotSupportedException($"{nameof(GetRehydrationToken)} is not supported.");
245246

246247
private AsyncPageable<DocumentStatusResult> CreateOperationValueAsync(CancellationToken cancellationToken = default)
247248
{

0 commit comments

Comments
 (0)