diff --git a/sdk/core/Azure.Core/src/HttpMessage.cs b/sdk/core/Azure.Core/src/HttpMessage.cs index 75752eebedaf..8820aa44c8d4 100644 --- a/sdk/core/Azure.Core/src/HttpMessage.cs +++ b/sdk/core/Azure.Core/src/HttpMessage.cs @@ -60,7 +60,7 @@ public Response Response public bool HasResponse => _response != null; /// - /// The instance to use for response classification during pipeline invocation. + /// The to be used during the processing. /// public CancellationToken CancellationToken { get; internal set; } diff --git a/sdk/core/Azure.Core/src/Operation{T}.cs b/sdk/core/Azure.Core/src/Operation{T}.cs index 16efbe0b591f..a3af9ca68f1b 100644 --- a/sdk/core/Azure.Core/src/Operation{T}.cs +++ b/sdk/core/Azure.Core/src/Operation{T}.cs @@ -53,8 +53,8 @@ public abstract class Operation where T : notnull /// /// Periodically calls the server till the long-running operation completes. /// - /// - /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. /// /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. /// @@ -68,8 +68,8 @@ public abstract class Operation where T : notnull /// The interval can change based on information returned from the server. /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. /// - /// - /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. /// /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. /// @@ -78,8 +78,8 @@ public abstract class Operation where T : notnull /// /// Calls the server to get updated status of the long-running operation. /// - /// - /// + /// A used for the service call. + /// The HTTP response received from the server. /// /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. /// @@ -88,8 +88,8 @@ public abstract class Operation where T : notnull /// /// Calls the server to get updated status of the long-running operation. /// - /// - /// + /// A used for the service call. + /// The HTTP response received from the server. /// /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. /// diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/CopyModelOperation.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/CopyModelOperation.cs index a16a4309b45e..b3dbcba4d92a 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/CopyModelOperation.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/CopyModelOperation.cs @@ -43,10 +43,18 @@ public class CopyModelOperation : Operation private RequestFailedException _requestFailedException; - /// + /// + /// Gets an ID representing the operation that can be used to poll for the status + /// of the long-running operation. + /// public override string Id { get; } - /// + /// + /// Final result of the long-running operation. + /// + /// + /// This property can be accessed only after the operation completes successfully (HasValue is true). + /// public override CustomFormModelInfo Value { get @@ -60,10 +68,14 @@ public override CustomFormModelInfo Value } } - /// + /// + /// Returns true if the long-running operation completed. + /// public override bool HasCompleted => _hasCompleted; - /// + /// + /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// public override bool HasValue => _value != null; /// @@ -129,22 +141,62 @@ internal CopyModelOperation(ServiceRestClient serviceClient, ClientDiagnostics d Id = string.Join("/", substrs, substrs.Length - 3, 3); } - /// + /// + /// The last HTTP response received from the server. + /// + /// + /// The last response returned from the server during the lifecycle of this instance. + /// An instance of sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods. + /// Responses from these requests can be accessed using GetRawResponse. + /// public override Response GetRawResponse() => _response; - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// + /// The interval between status requests to the server. + /// The interval can change based on information returned from the server. + /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); @@ -152,8 +204,8 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// Calls the server to get updated status of the long-running operation. /// /// When true, the method will be executed asynchronously; otherwise, it will execute synchronously. - /// A controlling the request lifetime. - /// The HTTP response from the service. + /// A used for the service call. + /// The HTTP response received from the server. private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken) { if (!_hasCompleted) diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeContentOperation.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeContentOperation.cs index 6d84af9b1f1b..46c734579982 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeContentOperation.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeContentOperation.cs @@ -34,10 +34,18 @@ public class RecognizeContentOperation : Operation /// true if the long-running operation has completed. Otherwise, false. private bool _hasCompleted; - /// + /// + /// Gets an ID representing the operation that can be used to poll for the status + /// of the long-running operation. + /// public override string Id { get; } - /// + /// + /// Final result of the long-running operation. + /// + /// + /// This property can be accessed only after the operation completes successfully (HasValue is true). + /// public override FormPageCollection Value { get @@ -51,10 +59,14 @@ public override FormPageCollection Value } } - /// + /// + /// Returns true if the long-running operation completed. + /// public override bool HasCompleted => _hasCompleted; - /// + /// + /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// public override bool HasValue => _value != null; /// @@ -87,22 +99,62 @@ internal RecognizeContentOperation(ServiceRestClient serviceClient, ClientDiagno Id = operationLocation.Split('/').Last(); } - /// + /// + /// The last HTTP response received from the server. + /// + /// + /// The last response returned from the server during the lifecycle of this instance. + /// An instance of sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods. + /// Responses from these requests can be accessed using GetRawResponse. + /// public override Response GetRawResponse() => _response; - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// + /// The interval between status requests to the server. + /// The interval can change based on information returned from the server. + /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); @@ -110,8 +162,8 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// Calls the server to get updated status of the long-running operation. /// /// When true, the method will be executed asynchronously; otherwise, it will execute synchronously. - /// A controlling the request lifetime. - /// The HTTP response from the service. + /// A used for the service call. + /// The HTTP response received from the server. private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken) { if (!_hasCompleted) diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeCustomFormsOperation.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeCustomFormsOperation.cs index 18e73c2fce3d..221261ca35e4 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeCustomFormsOperation.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeCustomFormsOperation.cs @@ -40,10 +40,18 @@ public class RecognizeCustomFormsOperation : Operation private RequestFailedException _requestFailedException; - /// + /// + /// Gets an ID representing the operation that can be used to poll for the status + /// of the long-running operation. + /// public override string Id { get; } - /// + /// + /// Final result of the long-running operation. + /// + /// + /// This property can be accessed only after the operation completes successfully (HasValue is true). + /// public override RecognizedFormCollection Value { get @@ -57,20 +65,50 @@ public override RecognizedFormCollection Value } } - /// + /// + /// Returns true if the long-running operation completed. + /// public override bool HasCompleted => _hasCompleted; - /// + /// + /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// public override bool HasValue => _value != null; - /// + /// + /// The last HTTP response received from the server. + /// + /// + /// The last response returned from the server during the lifecycle of this instance. + /// An instance of sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods. + /// Responses from these requests can be accessed using GetRawResponse. + /// public override Response GetRawResponse() => _response; - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// + /// The interval between status requests to the server. + /// The interval can change based on information returned from the server. + /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); @@ -127,11 +165,25 @@ public RecognizeCustomFormsOperation(string operationId, FormRecognizerClient cl Id = operationId; } - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); @@ -139,8 +191,8 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// Calls the server to get updated status of the long-running operation. /// /// When true, the method will be executed asynchronously; otherwise, it will execute synchronously. - /// A controlling the request lifetime. - /// The HTTP response from the service. + /// A used for the service call. + /// The HTTP response received from the server. private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken) { if (!_hasCompleted) diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeReceiptsOperation.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeReceiptsOperation.cs index f1579b407465..4f5f9e534b74 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeReceiptsOperation.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizeReceiptsOperation.cs @@ -33,10 +33,18 @@ public class RecognizeReceiptsOperation : Operation /// true if the long-running operation has completed. Otherwise, false. private bool _hasCompleted; - /// + /// + /// Gets an ID representing the operation that can be used to poll for the status + /// of the long-running operation. + /// public override string Id { get; } - /// + /// + /// Final result of the long-running operation. + /// + /// + /// This property can be accessed only after the operation completes successfully (HasValue is true). + /// public override RecognizedReceiptCollection Value { get @@ -50,13 +58,24 @@ public override RecognizedReceiptCollection Value } } - /// + /// + /// Returns true if the long-running operation completed. + /// public override bool HasCompleted => _hasCompleted; - /// + /// + /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// public override bool HasValue => _value != null; - /// + /// + /// The last HTTP response received from the server. + /// + /// + /// The last response returned from the server during the lifecycle of this instance. + /// An instance of sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods. + /// Responses from these requests can be accessed using GetRawResponse. + /// public override Response GetRawResponse() => _response; /// @@ -89,19 +108,52 @@ internal RecognizeReceiptsOperation(ServiceRestClient serviceClient, ClientDiagn Id = operationLocation.Split('/').Last(); } - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// + /// The interval between status requests to the server. + /// The interval can change based on information returned from the server. + /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); @@ -109,8 +161,8 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// Calls the server to get updated status of the long-running operation. /// /// When true, the method will be executed asynchronously; otherwise, it will execute synchronously. - /// A controlling the request lifetime. - /// The HTTP response from the service. + /// A used for the service call. + /// The HTTP response received from the server. private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken) { if (!_hasCompleted) diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/TrainingOperation.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/TrainingOperation.cs index 142fbad17c1f..41acaacf3366 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/TrainingOperation.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/TrainingOperation.cs @@ -34,10 +34,18 @@ public class TrainingOperation : Operation /// true if the long-running operation has completed. Otherwise, false. private bool _hasCompleted; - /// + /// + /// Gets an ID representing the operation that can be used to poll for the status + /// of the long-running operation. + /// public override string Id { get; } - /// + /// + /// Final result of the long-running operation. + /// + /// + /// This property can be accessed only after the operation completes successfully (HasValue is true). + /// public override CustomFormModel Value { get @@ -51,20 +59,50 @@ public override CustomFormModel Value } } - /// + /// + /// Returns true if the long-running operation completed. + /// public override bool HasCompleted => _hasCompleted; - /// + /// + /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// public override bool HasValue => _value != null; - /// + /// + /// The last HTTP response received from the server. + /// + /// + /// The last response returned from the server during the lifecycle of this instance. + /// An instance of sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods. + /// Responses from these requests can be accessed using GetRawResponse. + /// public override Response GetRawResponse() => _response; - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); - /// + /// + /// Periodically calls the server till the long-running operation completes. + /// + /// + /// The interval between status requests to the server. + /// The interval can change based on information returned from the server. + /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. + /// + /// A used for the periodical service calls. + /// The last HTTP response received from the server. + /// + /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); @@ -90,11 +128,25 @@ public TrainingOperation(string operationId, FormTrainingClient client) _serviceClient = client.ServiceClient; } - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); - /// + /// + /// Calls the server to get updated status of the long-running operation. + /// + /// A used for the service call. + /// The HTTP response received from the server. + /// + /// This operation will update the value returned from GetRawResponse and might update HasCompleted, HasValue, and Value. + /// public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); @@ -102,8 +154,8 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// Calls the server to get updated status of the long-running operation. /// /// When true, the method will be executed asynchronously; otherwise, it will execute synchronously. - /// A controlling the request lifetime. - /// The HTTP response from the service. + /// A used for the service call. + /// The HTTP response received from the server. private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken) { if (!_hasCompleted) diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs index 43fe776ca1cb..14b86bc96ddb 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs @@ -58,6 +58,7 @@ public async Task TestGetRoleAssignment() } [Test] + [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/12599")] public async Task TestCreateAndDeleteRoleAssignment() { string sqlAdminRoleId = "7af0c69a-a548-47d6-aea3-d00e69bd83aa";