From c5ca5b092ebb18b661cbc414e19d69a6d7f21252 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:06:24 +0800 Subject: [PATCH 01/18] Upgrade analyzer version to 0.1.1-dev.20230613.1 --- eng/Packages.Data.props | 2 +- .../Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index a8770493c99c..7205df595812 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -172,7 +172,7 @@ --> - + diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs index b52fffe46c6f..d955459481a5 100644 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs +++ b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/GlobalSuppressions.cs @@ -4,5 +4,4 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Usage", "AZC0007: A client type should have a public constructor with equivalent parameters that doesn't take a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")] -[assembly: SuppressMessage("Usage", "AZC0006: A client type should have a public constructor with equivalent parameters that takes a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")] -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file +[assembly: SuppressMessage("Usage", "AZC0006: A client type should have a public constructor with equivalent parameters that takes a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")] \ No newline at end of file From 81d6a5dc18be08c486608f7bf3df102cfaa436fe Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:11:04 +0800 Subject: [PATCH 02/18] Update --- .../Azure.AI.ContentSafety/src/Azure.AI.ContentSafety.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/src/Azure.AI.ContentSafety.csproj b/sdk/contentsafety/Azure.AI.ContentSafety/src/Azure.AI.ContentSafety.csproj index 9aa4692e8235..b729a371df6b 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/src/Azure.AI.ContentSafety.csproj +++ b/sdk/contentsafety/Azure.AI.ContentSafety/src/Azure.AI.ContentSafety.csproj @@ -6,7 +6,6 @@ Azure ContentSafety $(RequiredTargetFrameworks) true - $(NoWarn);AZC0002 true From e1215ed5401c6ba693477f22e7241d3405375713 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:27:34 +0800 Subject: [PATCH 03/18] Update --- .../src/ConfigurationClient.cs | 2 ++ .../src/GlobalSuppressions.cs | 6 +++++ .../src/CallAutomationClient.cs | 8 ++++++ .../src/CallAutomationClient.cs | 4 +++ ...Azure.Communication.Chat.netstandard2.0.cs | 2 +- .../src/ChatClient.cs | 2 +- ....Communication.JobRouter.netstandard2.0.cs | 26 +++++++++---------- .../src/JobRouterAdministrationClient.cs | 18 ++++++------- .../src/JobRouterClient.cs | 8 +++--- .../src/GlobalSuppressions.cs | 6 +++++ .../src/ContainerRegistryClient.cs | 4 +++ .../src/GlobalSuppressions.cs | 1 - .../src/GlobalSuppressions.cs | 1 + .../src/MapsRenderingClient.cs | 4 +++ .../src/LogsQueryClient.cs | 2 ++ .../src/GlobalSuppressions.cs | 6 ----- .../src/GlobalSuppressions.cs | 6 ----- .../src/GlobalSuppressions.cs | 6 ----- .../src/GlobalSuppressions.cs | 1 - .../src/GlobalSuppressions.cs | 6 ----- .../src/GlobalSuppressions.cs | 6 ----- .../src/RemoteRenderingClient.cs | 4 +++ .../src/GlobalSuppressions.cs | 6 +++++ .../src/BlobBatchClient.cs | 2 ++ .../src/GlobalSuppressions.cs | 7 +++++ .../src/GlobalSuppressions.cs | 7 +++++ .../src/GlobalSuppressions.cs | 6 +++++ .../src/GlobalSuppressions.cs | 7 +++++ .../src/GlobalSuppressions.cs | 10 ------- .../src/GlobalSuppressions.cs | 6 +++++ .../Azure.Template/src/GlobalSuppressions.cs | 11 -------- .../Azure.AI.TextAnalytics.netstandard2.0.cs | 4 +-- .../src/TextAnalyticsClient.cs | 4 +-- .../src/GlobalSuppressions.cs | 1 + 34 files changed, 115 insertions(+), 85 deletions(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs create mode 100644 sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs delete mode 100644 sdk/purview/Azure.Analytics.Purview.Account/src/GlobalSuppressions.cs delete mode 100644 sdk/purview/Azure.Analytics.Purview.Administration/src/GlobalSuppressions.cs delete mode 100644 sdk/purview/Azure.Analytics.Purview.Scanning/src/GlobalSuppressions.cs delete mode 100644 sdk/purview/Azure.Analytics.Purview.Sharing/src/GlobalSuppressions.cs delete mode 100644 sdk/purview/Azure.Analytics.Purview.Workflows/src/GlobalSuppressions.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs create mode 100644 sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs create mode 100644 sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs create mode 100644 sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs create mode 100644 sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs delete mode 100644 sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/GlobalSuppressions.cs create mode 100644 sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs delete mode 100644 sdk/template/Azure.Template/src/GlobalSuppressions.cs diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs index 70b28ec87108..22c91c6fe58a 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs @@ -1396,7 +1396,9 @@ private Response ToCreateResponse(string key, string label, MatchConditions requ /// Adds an external synchronization token to ensure service requests receive up-to-date values. /// /// The synchronization token value. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual void UpdateSyncToken(string token) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Argument.AssertNotNull(token, nameof(token)); _syncTokenPolicy.AddToken(token); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..d140f3430694 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs index 274b40d38985..84133a92959d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs @@ -746,7 +746,9 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal /// Initializes a new instance of CallConnection. . /// The call connection id for the GetCallConnection instance. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallConnection GetCallConnection(string callConnectionId) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallConnection)}"); scope.Start(); @@ -762,7 +764,9 @@ public virtual CallConnection GetCallConnection(string callConnectionId) } /// Initializes a new instance of GetCallRecording. . +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallRecording GetCallRecording() +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallRecording)}"); scope.Start(); @@ -778,7 +782,9 @@ public virtual CallRecording GetCallRecording() } /// Get Call Automation's EventProcessor for handling Call Automation's event more easily. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallAutomationEventProcessor GetEventProcessor() +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetEventProcessor)}"); scope.Start(); @@ -797,7 +803,9 @@ public virtual CallAutomationEventProcessor GetEventProcessor() /// Get source identity used by Call Automation client. /// /// +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CommunicationUserIdentifier GetSourceIdentity() +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetSourceIdentity)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs b/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs index 7818abb58da6..3637920e5255 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs @@ -430,7 +430,9 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal /// Initializes a new instance of CallConnection. . /// The call connection id for the GetCallConnection instance. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallConnection GetCallConnection(string callConnectionId) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallConnection)}"); scope.Start(); @@ -446,7 +448,9 @@ public virtual CallConnection GetCallConnection(string callConnectionId) } /// Initializes a new instance of GetCallRecording. . +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallRecording GetCallRecording() +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallRecording)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.Chat/api/Azure.Communication.Chat.netstandard2.0.cs b/sdk/communication/Azure.Communication.Chat/api/Azure.Communication.Chat.netstandard2.0.cs index f5606b918d2e..c3c42c482118 100644 --- a/sdk/communication/Azure.Communication.Chat/api/Azure.Communication.Chat.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.Chat/api/Azure.Communication.Chat.netstandard2.0.cs @@ -10,7 +10,7 @@ public partial class ChatClient protected ChatClient() { } public ChatClient(System.Uri endpoint, Azure.Communication.CommunicationTokenCredential communicationTokenCredential, Azure.Communication.Chat.ChatClientOptions options = null) { } public virtual Azure.Response CreateChatThread(string topic, System.Collections.Generic.IEnumerable participants, string idempotencyToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateChatThreadAsync(string topic, System.Collections.Generic.IEnumerable participants = null, string idempotencyToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateChatThreadAsync(string topic, System.Collections.Generic.IEnumerable participants, string idempotencyToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DeleteChatThread(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteChatThreadAsync(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Communication.Chat.ChatThreadClient GetChatThreadClient(string threadId) { throw null; } diff --git a/sdk/communication/Azure.Communication.Chat/src/ChatClient.cs b/sdk/communication/Azure.Communication.Chat/src/ChatClient.cs index 6d9e52c9a4dc..504f690db4c6 100644 --- a/sdk/communication/Azure.Communication.Chat/src/ChatClient.cs +++ b/sdk/communication/Azure.Communication.Chat/src/ChatClient.cs @@ -56,7 +56,7 @@ protected ChatClient() /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. /// The cancellation token for the task. /// The server returned an error. See for details returned from the server. - public virtual async Task> CreateChatThreadAsync(string topic, IEnumerable participants = null, string idempotencyToken = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateChatThreadAsync(string topic, IEnumerable participants, string idempotencyToken = null, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatClient)}.{nameof(CreateChatThread)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs index 8dd1e78d2282..1eddac65a64a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs @@ -257,7 +257,7 @@ public JobRouterAdministrationClient(System.Uri endpoint, Azure.Core.TokenCreden public virtual System.Threading.Tasks.Task> CreateClassificationPolicyAsync(Azure.Communication.JobRouter.CreateClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateDistributionPolicy(Azure.Communication.JobRouter.CreateDistributionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateDistributionPolicyAsync(Azure.Communication.JobRouter.CreateDistributionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateExceptionPolicy(Azure.Communication.JobRouter.CreateExceptionPolicyOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateExceptionPolicy(Azure.Communication.JobRouter.CreateExceptionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateExceptionPolicyAsync(Azure.Communication.JobRouter.CreateExceptionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateQueue(Azure.Communication.JobRouter.CreateQueueOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateQueueAsync(Azure.Communication.JobRouter.CreateQueueOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -286,21 +286,21 @@ public JobRouterAdministrationClient(System.Uri endpoint, Azure.Core.TokenCreden public virtual Azure.Pageable GetQueues(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetQueuesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateClassificationPolicy(Azure.Communication.JobRouter.UpdateClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateClassificationPolicy(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateClassificationPolicy(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> UpdateClassificationPolicyAsync(Azure.Communication.JobRouter.UpdateClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateClassificationPolicyAsync(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateClassificationPolicyAsync(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual Azure.Response UpdateDistributionPolicy(Azure.Communication.JobRouter.UpdateDistributionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateDistributionPolicy(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateDistributionPolicy(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> UpdateDistributionPolicyAsync(Azure.Communication.JobRouter.UpdateDistributionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateDistributionPolicyAsync(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateDistributionPolicyAsync(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual Azure.Response UpdateExceptionPolicy(Azure.Communication.JobRouter.UpdateExceptionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateExceptionPolicy(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateExceptionPolicy(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> UpdateExceptionPolicyAsync(Azure.Communication.JobRouter.UpdateExceptionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateExceptionPolicyAsync(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateExceptionPolicyAsync(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual Azure.Response UpdateQueue(Azure.Communication.JobRouter.UpdateQueueOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateQueue(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateQueue(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> UpdateQueueAsync(Azure.Communication.JobRouter.UpdateQueueOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateQueueAsync(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateQueueAsync(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } } public partial class JobRouterClient { @@ -346,13 +346,13 @@ public JobRouterClient(System.Uri endpoint, Azure.Core.TokenCredential credentia public virtual Azure.Response UnassignJob(Azure.Communication.JobRouter.UnassignJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UnassignJobAsync(Azure.Communication.JobRouter.UnassignJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateJob(Azure.Communication.JobRouter.UpdateJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> UpdateJobAsync(Azure.Communication.JobRouter.UpdateJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual Azure.Response UpdateWorker(Azure.Communication.JobRouter.UpdateWorkerOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateWorker(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateWorker(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> UpdateWorkerAsync(Azure.Communication.JobRouter.UpdateWorkerOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateWorkerAsync(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateWorkerAsync(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } } public partial class JobRouterClientOptions : Azure.Core.ClientOptions { diff --git a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs index 3bb46f5b2639..3884613e52f9 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs @@ -249,7 +249,7 @@ public virtual Response UpdateClassificationPolicy( public virtual async Task UpdateClassificationPolicyAsync( string classificationPolicyId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateClassificationPolicy)}"); scope.Start(); @@ -276,7 +276,7 @@ public virtual async Task UpdateClassificationPolicyAsync( public virtual Response UpdateClassificationPolicy( string classificationPolicyId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateClassificationPolicy)}"); scope.Start(); @@ -607,7 +607,7 @@ public virtual Response UpdateDistributionPolicy( public virtual async Task UpdateDistributionPolicyAsync( string distributionPolicyId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateDistributionPolicy)}"); scope.Start(); @@ -634,7 +634,7 @@ public virtual async Task UpdateDistributionPolicyAsync( public virtual Response UpdateDistributionPolicy( string distributionPolicyId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateDistributionPolicy)}"); scope.Start(); @@ -877,7 +877,7 @@ public virtual async Task> CreateExceptionPolicyAsync( /// (Optional) The cancellation token to use. /// The server returned an error. See for details returned from the server. public virtual Response CreateExceptionPolicy( - CreateExceptionPolicyOptions options = default, + CreateExceptionPolicyOptions options, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(CreateExceptionPolicy)}"); @@ -983,7 +983,7 @@ public virtual Response UpdateExceptionPolicy( public virtual async Task UpdateExceptionPolicyAsync( string exceptionPolicyId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateExceptionPolicy)}"); scope.Start(); @@ -1010,7 +1010,7 @@ public virtual async Task UpdateExceptionPolicyAsync( public virtual Response UpdateExceptionPolicy( string exceptionPolicyId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateExceptionPolicy)}"); scope.Start(); @@ -1360,7 +1360,7 @@ public virtual Response DeleteExceptionPolicy(string exceptionPolicyId, Cancella public virtual async Task UpdateQueueAsync( string queueId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateQueue)}"); scope.Start(); @@ -1388,7 +1388,7 @@ public virtual async Task UpdateQueueAsync( public virtual Response UpdateQueue( string queueId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateQueue)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs index b989ccd55f55..e65a6e7b35c2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs @@ -443,7 +443,7 @@ public virtual Response UpdateJob( public virtual async Task UpdateJobAsync( string jobId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateJob)}"); scope.Start(); @@ -470,7 +470,7 @@ public virtual async Task UpdateJobAsync( public virtual Response UpdateJob( string jobId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateJob)}"); scope.Start(); @@ -1370,7 +1370,7 @@ public virtual Response UpdateWorker( public virtual async Task UpdateWorkerAsync( string workerId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateWorker)}"); scope.Start(); @@ -1397,7 +1397,7 @@ public virtual async Task UpdateWorkerAsync( public virtual Response UpdateWorker( string workerId, RequestContent content, - RequestContext context = null) + RequestContext context) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateWorker)}"); scope.Start(); diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..d140f3430694 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index c341cd0c531d..cce6ace6ff83 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -255,7 +255,9 @@ public virtual Response DeleteRepository(string repositoryName, CancellationToke /// A new for the desired repository. /// Thrown when is null. /// Thrown when is empty. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual ContainerRepository GetRepository(string repositoryName) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Argument.AssertNotNullOrEmpty(repositoryName, nameof(repositoryName)); @@ -276,7 +278,9 @@ public virtual ContainerRepository GetRepository(string repositoryName) /// Thrown when is empty. /// Thrown when is null. /// Thrown when is empty. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual RegistryArtifact GetArtifact(string repositoryName, string tagOrDigest) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Argument.AssertNotNullOrEmpty(repositoryName, nameof(repositoryName)); Argument.AssertNotNullOrEmpty(tagOrDigest, nameof(tagOrDigest)); diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs index 4766e38cc993..90b4113d13f0 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/GlobalSuppressions.cs @@ -3,7 +3,6 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Usage", "AZC0002:DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.", Justification = "CancellationToken can be passed through RequestOptions")] [assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Data, Azure.DigitalTwins, Azure.IoT, Azure.Learn, Azure.Media, Azure.Management, Azure.Messaging, Azure.ResourceManager, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Azure.Identity, Microsoft.Extensions.Azure", Justification = "Temporary while awaiting namespace group approval", Scope = "namespace", Target = "~N:Azure.Developer.DevCenter")] [assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "False positives on minimal constructors", Scope = "namespaceanddescendants", Target = "~N:Azure.Developer.DevCenter")] [assembly: SuppressMessage("Usage", "AZC0006:DO provide constructor overloads that allow specifying additional options.", Justification = "False positives on options constructors", Scope = "namespaceanddescendants", Target = "~N:Azure.Developer.DevCenter")] diff --git a/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs b/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs index e4d23f35b57a..cee36e89e7a0 100644 --- a/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs +++ b/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs @@ -4,3 +4,4 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Data, Azure.DigitalTwins, Azure.IoT, Azure.Learn, Azure.Media, Azure.Management, Azure.Messaging, Azure.ResourceManager, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Azure.Identity, Microsoft.Extensions.Azure", Justification = "", Scope = "namespace", Target = "~N:Azure.Developer.LoadTesting")] +[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] diff --git a/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs b/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs index 7c0ef70d8500..8d11386974f2 100644 --- a/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs +++ b/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs @@ -780,7 +780,9 @@ private static GeoPosition GlobalPixelToPosition(GeoPosition pixel, double zoom, /// Zoom level /// The size of the tiles in the tile pyramid. /// A tile index contains the tile X, Y index and zoom level. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public static MapTileIndex PositionToTileXY(GeoPosition position, int zoom, int tileSize) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { var latitude = Clip(position.Latitude, MinLatitude, MaxLatitude); var longitude = Clip(position.Longitude, MinLongitude, MaxLongitude); @@ -803,7 +805,9 @@ public static MapTileIndex PositionToTileXY(GeoPosition position, int zoom, int /// Tile X, Y coordinate and zoom level /// The size of the tiles in the tile pyramid. /// A bounding box of the tile defined as an array of numbers in the format of GeoBoundingBox. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public static GeoBoundingBox TileXYToBoundingBox(MapTileIndex mapTileIndex, int tileSize) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { //Top left corner pixel coordinates var x1 = (double)(mapTileIndex.X * tileSize); diff --git a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs index 19aae1aaf37e..8dc6c5e18602 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs @@ -499,7 +499,9 @@ public virtual async Task> QueryResourceAsync(Resource /// /// An interpolated query string. /// A valid Kusto query. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public static string CreateQuery(FormattableString query) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { if (query == null) { return null; } diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/GlobalSuppressions.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/GlobalSuppressions.cs deleted file mode 100644 index 00a46f8e98e0..000000000000 --- a/sdk/purview/Azure.Analytics.Purview.Account/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/GlobalSuppressions.cs b/sdk/purview/Azure.Analytics.Purview.Administration/src/GlobalSuppressions.cs deleted file mode 100644 index 00a46f8e98e0..000000000000 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Scanning/src/GlobalSuppressions.cs b/sdk/purview/Azure.Analytics.Purview.Scanning/src/GlobalSuppressions.cs deleted file mode 100644 index 00a46f8e98e0..000000000000 --- a/sdk/purview/Azure.Analytics.Purview.Scanning/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Share/src/GlobalSuppressions.cs b/sdk/purview/Azure.Analytics.Purview.Share/src/GlobalSuppressions.cs index 9792bd4514fa..3ea70ef70e08 100644 --- a/sdk/purview/Azure.Analytics.Purview.Share/src/GlobalSuppressions.cs +++ b/sdk/purview/Azure.Analytics.Purview.Share/src/GlobalSuppressions.cs @@ -3,5 +3,4 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Usage", "AZC0002:DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.", Justification = "CancellationToken can be passed through RequestOptions")] [assembly: SuppressMessage("Usage", "AZC0016:Invalid ServiceVersion member name.", Justification = "Generated code: https://github.com/Azure/autorest.csharp/issues/1524")] \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Sharing/src/GlobalSuppressions.cs b/sdk/purview/Azure.Analytics.Purview.Sharing/src/GlobalSuppressions.cs deleted file mode 100644 index 00a46f8e98e0..000000000000 --- a/sdk/purview/Azure.Analytics.Purview.Sharing/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/src/GlobalSuppressions.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/src/GlobalSuppressions.cs deleted file mode 100644 index 00a46f8e98e0..000000000000 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file diff --git a/sdk/remoterendering/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs b/sdk/remoterendering/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs index 2ff346aaafcd..1fc8275bbf4a 100644 --- a/sdk/remoterendering/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs +++ b/sdk/remoterendering/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs @@ -167,7 +167,9 @@ public virtual async Task> GetConversionAsync(string c /// Gets a list of all conversions. /// The cancellation token to use. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual Pageable GetConversions(CancellationToken cancellationToken = default) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Page FirstPageFunc(int? pageSizeHint) { @@ -204,7 +206,9 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// Gets a list of all conversions. /// The cancellation token to use. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual AsyncPageable GetConversionsAync(CancellationToken cancellationToken = default) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { async Task> FirstPageFunc(int? pageSizeHint) { diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs b/sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..fdd94f09b27c --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs b/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs index 9d61ea16aefd..0396bce580a2 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs @@ -288,7 +288,9 @@ private BlobServiceClientInternals() { } /// that can be submitted together via . /// /// A new . +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual BlobBatch CreateBatch() => new BlobBatch(this); +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. /// /// Submit a of sub-operations. diff --git a/sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..39b174b7c37b --- /dev/null +++ b/sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] +[assembly: SuppressMessage("Usage", "AZC0002: Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..39b174b7c37b --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] +[assembly: SuppressMessage("Usage", "AZC0002: Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..fdd94f09b27c --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..39b174b7c37b --- /dev/null +++ b/sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] +[assembly: SuppressMessage("Usage", "AZC0002: Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter.", Justification = "")] \ No newline at end of file diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/GlobalSuppressions.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/GlobalSuppressions.cs deleted file mode 100644 index 4e1148a759d4..000000000000 --- a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/GlobalSuppressions.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs b/sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..9ad37d79417b --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] diff --git a/sdk/template/Azure.Template/src/GlobalSuppressions.cs b/sdk/template/Azure.Template/src/GlobalSuppressions.cs deleted file mode 100644 index 529ab947db09..000000000000 --- a/sdk/template/Azure.Template/src/GlobalSuppressions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")] diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs index b4645d9a63b8..893dd42a1a0e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs @@ -1133,7 +1133,7 @@ public TextAnalyticsClient(System.Uri endpoint, Azure.Core.TokenCredential crede public virtual Azure.AI.TextAnalytics.AnalyzeActionsOperation AnalyzeActions(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsActions actions, string language = null, Azure.AI.TextAnalytics.AnalyzeActionsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AnalyzeActionsAsync(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsActions actions, Azure.AI.TextAnalytics.AnalyzeActionsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AnalyzeActionsAsync(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsActions actions, string language = null, Azure.AI.TextAnalytics.AnalyzeActionsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation AnalyzeHealthcareEntities(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation AnalyzeHealthcareEntities(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation AnalyzeHealthcareEntities(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AnalyzeHealthcareEntitiesAsync(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AnalyzeHealthcareEntitiesAsync(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1214,7 +1214,7 @@ public TextAnalyticsClient(System.Uri endpoint, Azure.Core.TokenCredential crede [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task StartAnalyzeActionsAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsActions actions, string language = null, Azure.AI.TextAnalytics.AnalyzeActionsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs index 7f874dd9fd71..31c8109f3f16 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs @@ -1838,7 +1838,7 @@ public virtual AnalyzeHealthcareEntitiesOperation AnalyzeHealthcareEntities(Wait /// This method is only supported in service API version v3.1 and newer. /// Service returned a non-success /// status code. - public virtual AnalyzeHealthcareEntitiesOperation AnalyzeHealthcareEntities(WaitUntil waitUntil, IEnumerable documents, AnalyzeHealthcareEntitiesOptions options, CancellationToken cancellationToken = default) + public virtual AnalyzeHealthcareEntitiesOperation AnalyzeHealthcareEntities(WaitUntil waitUntil, IEnumerable documents, AnalyzeHealthcareEntitiesOptions options = default, CancellationToken cancellationToken = default) { options?.CheckSupported(ServiceVersion); return _serviceClient.AnalyzeHealthcareEntities(waitUntil, documents, options, cancellationToken); @@ -1956,7 +1956,7 @@ public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities /// Service returned a non-success /// status code. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities(IEnumerable documents, AnalyzeHealthcareEntitiesOptions options, CancellationToken cancellationToken = default) + public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities(IEnumerable documents, AnalyzeHealthcareEntitiesOptions options = default, CancellationToken cancellationToken = default) { options?.CheckSupported(ServiceVersion); return _serviceClient.StartAnalyzeHealthcareEntities(documents, options, cancellationToken); diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs index b6f456d951a1..a2c30bc3962a 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs @@ -4,3 +4,4 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Usage", "AZC0002:DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.", Justification = "CancellationToken can be passed through RequestOptions")] +[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "CancellationToken can be passed through RequestOptions")] From 0adff3b4025d6bdbe3521041af1286f540917449 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:36:15 +0800 Subject: [PATCH 04/18] Update --- eng/Packages.Data.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 932a11ff3948..87f84404cc1f 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -174,7 +174,7 @@ --> - + From c07d7d1528a9beedd991ac618c126d72abf06de2 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:39:30 +0800 Subject: [PATCH 05/18] Update --- eng/Packages.Data.props | 2 +- .../tests/RouterClients/DistributionPolicyLiveTests.cs | 2 +- .../tests/RouterClients/JobQueueLiveTests.cs | 2 +- .../tests/Samples/ClassificationPolicyCrudOps.cs | 2 +- .../tests/Samples/ClassificationPolicyCrudOpsAsync.cs | 2 +- .../tests/Samples/DistributionPolicyCrudOps.cs | 2 +- .../tests/Samples/DistributionPolicyCrudOpsAsync.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 87f84404cc1f..1f72bb020a37 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -174,7 +174,7 @@ --> - + diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs index fe89cf06ae96..fcf37ec7703d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs @@ -291,7 +291,7 @@ public async Task CreateDistributionPolicyAndRemoveAProperty() var updatedDistributionPolicyResponse = await routerClient.UpdateDistributionPolicyAsync(bestWorkerModeDistributionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); var retrievedPolicy = await routerClient.GetDistributionPolicyAsync(bestWorkerModeDistributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs index eda57d394cae..c61a7961fc68 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs @@ -90,7 +90,7 @@ public async Task CreateQueueAndRemoveProperty() Assert.False(string.IsNullOrWhiteSpace(createQueueResponse.Value.Name)); var updatedQueueResponse = - await routerClient.UpdateQueueAsync(queueId, RequestContent.Create(new { Name = (string?)null })); + await routerClient.UpdateQueueAsync(queueId, RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); var queriedQueue = await routerClient.GetQueueAsync(queueId); Assert.True(string.IsNullOrWhiteSpace(queriedQueue.Value.Name)); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs index 718ce82dd31f..2f636a47b373 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs @@ -75,7 +75,7 @@ public void ClassificationPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp Response updatedClassificationPolicyWithoutName = routerAdministrationClient.UpdateClassificationPolicy(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedClassificationPolicyWithoutName = routerAdministrationClient.GetClassificationPolicy(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs index 3409d4472647..8adabe9b9a25 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs @@ -75,7 +75,7 @@ public async Task ClassificationPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp_Async Response updatedClassificationPolicyWithoutName = await routerAdministrationClient.UpdateClassificationPolicyAsync(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedClassificationPolicyWithoutName = await routerAdministrationClient.GetClassificationPolicyAsync(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs index 7b068ce3eb90..8476ef31cca0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs @@ -51,7 +51,7 @@ public void DistributionPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp Response updatedDistributionPolicyWithoutName = routerAdministrationClient.UpdateDistributionPolicy(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedDistributionPolicyWithoutName = routerAdministrationClient.GetDistributionPolicy(distributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs index fbe8b8364933..0ba77151f8a0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs @@ -51,7 +51,7 @@ public async Task DistributionPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp_Async Response updatedDistributionPolicyWithoutName = await routerAdministrationClient.UpdateDistributionPolicyAsync(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedDistributionPolicyWithoutName = await routerAdministrationClient.GetDistributionPolicyAsync(distributionPolicyId); From 56d9071cbb16663d7cf9c6b2504eea296e37fb66 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:13:19 +0800 Subject: [PATCH 06/18] Update --- .../src/Generated/QuestionAnsweringAuthoringClient.cs | 4 ++++ .../src/GlobalSuppressions.cs | 6 ------ .../samples/ClassificationPolicyCrud.md | 2 +- .../samples/ClassificationPolicyCrudAsync.md | 2 +- .../samples/DistributionPolicyCrud.md | 2 +- .../samples/DistributionPolicyCrudAsync.md | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs index be0bc6164017..115c99fbdd4a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs @@ -1218,7 +1218,9 @@ public virtual Operation Export(WaitUntil waitUntil, string projectN /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. /// +#pragma warning disable AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. public virtual async Task> ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, string assetKind = null, RequestContext context = null) +#pragma warning restore AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); @@ -1257,7 +1259,9 @@ public virtual async Task> ImportAsync(WaitUntil waitUntil /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. /// +#pragma warning disable AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, string assetKind = null, RequestContext context = null) +#pragma warning restore AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs deleted file mode 100644 index d140f3430694..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md index 4ace09537e62..3d102b4baa6d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md @@ -86,7 +86,7 @@ Console.WriteLine($"Classification policy successfully update with new prioritiz ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp Response updatedClassificationPolicyWithoutName = routerAdministrationClient.UpdateClassificationPolicy(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedClassificationPolicyWithoutName = routerAdministrationClient.GetClassificationPolicy(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md index 3793ed7c53fd..cb0e40ccdf3f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md @@ -86,7 +86,7 @@ Console.WriteLine($"Classification policy successfully update with new prioritiz ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp_Async Response updatedClassificationPolicyWithoutName = await routerAdministrationClient.UpdateClassificationPolicyAsync(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedClassificationPolicyWithoutName = await routerAdministrationClient.GetClassificationPolicyAsync(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md index 30aab052eec5..c197d416fd9b 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md @@ -59,7 +59,7 @@ Console.WriteLine($"Distribution policy successfully update with new distributio ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp Response updatedDistributionPolicyWithoutName = routerAdministrationClient.UpdateDistributionPolicy(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedDistributionPolicyWithoutName = routerAdministrationClient.GetDistributionPolicy(distributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md index e0ea59aa0c0a..ec8d41419052 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md @@ -59,7 +59,7 @@ Console.WriteLine($"Distribution policy successfully update with new distributio ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp_Async Response updatedDistributionPolicyWithoutName = await routerAdministrationClient.UpdateDistributionPolicyAsync(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); Response queriedDistributionPolicyWithoutName = await routerAdministrationClient.GetDistributionPolicyAsync(distributionPolicyId); From 08b896fa69b9f38c32361aa433df33a01f363a09 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Tue, 18 Jul 2023 13:26:34 +0800 Subject: [PATCH 07/18] Update --- .../samples/ExceptionPolicyCrud.md | 2 +- .../samples/ExceptionPolicyCrudAsync.md | 2 +- .../Azure.Communication.JobRouter/samples/JobQueueCrud.md | 2 +- .../Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md | 2 +- .../Azure.Communication.JobRouter/samples/RouterJobCrud.md | 2 +- .../Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md | 2 +- .../tests/RouterClients/ClassificationPolicyLiveTests.cs | 2 +- .../tests/RouterClients/ExceptionPolicyLiveTests.cs | 2 +- .../tests/RouterClients/RouterJobLiveTests.cs | 2 +- .../tests/Samples/ExceptionPolicyCrudOps.cs | 2 +- .../tests/Samples/ExceptionPolicyCrudOpsAsync.cs | 2 +- .../tests/Samples/JobQueueCrudOps.cs | 2 +- .../tests/Samples/JobQueueCrudOpsAsync.cs | 2 +- .../tests/Samples/RouterJobCrudOps.cs | 2 +- .../tests/Samples/RouterJobCrudOpsAsync.cs | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md index 370169557aba..c671cf3ba611 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md @@ -148,7 +148,7 @@ Console.WriteLine($"`EscalateJobOnWaitTimeExceededTrigger2Min` rule has been suc ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateExceptionPolicyRemoveProp // we are going to remove Name Response updateExceptionPolicyWithoutName = routerClient.UpdateExceptionPolicy(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedExceptionPolicyWithoutName = routerClient.GetExceptionPolicy(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md index 10ef749381f1..2f234d1cc121 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md @@ -148,7 +148,7 @@ Console.WriteLine($"`EscalateJobOnWaitTimeExceededTrigger2Min` rule has been suc ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateExceptionPolicyRemoveProp_Async // we are going to remove Name Response updateExceptionPolicyWithoutName = await routerClient.UpdateExceptionPolicyAsync(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedExceptionPolicyWithoutName = await routerClient.GetExceptionPolicyAsync(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md index d777180b141d..4f31152682ab 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md @@ -61,7 +61,7 @@ Response updatedJobQueue = routerAdministrationClient.Update ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp Response updatedJobQueueWithoutName = routerAdministrationClient.UpdateQueue(jobQueueId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedJobQueueWithoutName = routerAdministrationClient.GetQueue(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md index ee2a71f42d07..3c94c7a6ee5d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md @@ -62,7 +62,7 @@ Response updatedJobQueue = await routerAdministrationClient. ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp_Async Response updatedJobQueueWithoutName = await routerAdministrationClient.UpdateQueueAsync(jobQueueId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedJobQueueWithoutName = await routerAdministrationClient.GetQueueAsync(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md index e68cd503bbcf..4cfc2c735acd 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md @@ -100,7 +100,7 @@ Console.WriteLine($"Job has been successfully updated. Current value of channelR ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp Response updatedJobWithoutChannelReference = routerClient.UpdateJob(jobId, - RequestContent.Create(new { ChannelReference = (string?)null })); + RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); Response queriedJobWithoutChannelReference = routerClient.GetJob(jobId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md index af8c6bcdd45f..7743813428f9 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md @@ -101,7 +101,7 @@ Console.WriteLine($"Job has been successfully updated. Current value of channelR ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp_Async Response updatedJobWithoutChannelReference = await routerClient.UpdateJobAsync(jobId, - RequestContent.Create(new { ChannelReference = (string?)null })); + RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); Response queriedJobWithoutChannelReference = await routerClient.GetJobAsync(jobId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs index 2e3ac7494198..98fc36f9c8d4 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs @@ -243,7 +243,7 @@ public async Task CreateClassificationPolicyAndRemoveAProperty() Assert.False(string.IsNullOrWhiteSpace(createClassificationPolicyResponse.Value.Name)); var updatedPolicyResponse = await routerClient.UpdateClassificationPolicyAsync(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); var retrievedPolicy = await routerClient.GetClassificationPolicyAsync(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs index 406b56c7bd96..e2db1d6b8d49 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs @@ -231,7 +231,7 @@ public async Task CreateExceptionPolicyAndRemoveProperty() Assert.False(string.IsNullOrWhiteSpace(createExceptionPolicyResponse.Value.Name)); var updatedExpcetionPolicyResponse = await routerClient.UpdateExceptionPolicyAsync(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); var retrievedPolicy = await routerClient.GetExceptionPolicyAsync(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs index 26399b47f0d2..0a2eaee06e97 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs @@ -401,7 +401,7 @@ public async Task CreateJobAndRemoveProperty() var createJob1 = createJob1Response.Value; AddForCleanup(new Task(async () => await routerClient.DeleteJobAsync(createJob1.Id))); - var updatedJob1Response = await routerClient.UpdateJobAsync(createJob1.Id, RequestContent.Create(new { ChannelReference = (string?)null })); + var updatedJob1Response = await routerClient.UpdateJobAsync(createJob1.Id, RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); var retrievedJob = await routerClient.GetJobAsync(jobId1); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs index ae5f3ab916c8..ee0a34896758 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs @@ -99,7 +99,7 @@ public void DistributionPolicyCrud() // we are going to remove Name Response updateExceptionPolicyWithoutName = routerClient.UpdateExceptionPolicy(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedExceptionPolicyWithoutName = routerClient.GetExceptionPolicy(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs index 635c5421039c..a1f6a9e34774 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs @@ -99,7 +99,7 @@ public async Task DistributionPolicyCrud() // we are going to remove Name Response updateExceptionPolicyWithoutName = await routerClient.UpdateExceptionPolicyAsync(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedExceptionPolicyWithoutName = await routerClient.GetExceptionPolicyAsync(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs index b572e4efcf87..1ef83e294b4f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs @@ -62,7 +62,7 @@ public void JobQueueCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp Response updatedJobQueueWithoutName = routerAdministrationClient.UpdateQueue(jobQueueId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedJobQueueWithoutName = routerAdministrationClient.GetQueue(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs index f5e301cb2630..54970b91d25d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs @@ -62,7 +62,7 @@ public async Task JobQueueCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp_Async Response updatedJobQueueWithoutName = await routerAdministrationClient.UpdateQueueAsync(jobQueueId, - RequestContent.Create(new { Name = (string?)null })); + RequestContent.Create(new { Name = (string?)null }), new RequestContext()); Response queriedJobQueueWithoutName = await routerAdministrationClient.GetQueueAsync(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs index fc8559d82ee9..58682baaa789 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs @@ -92,7 +92,7 @@ public void RouterCrudOps() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp Response updatedJobWithoutChannelReference = routerClient.UpdateJob(jobId, - RequestContent.Create(new { ChannelReference = (string?)null })); + RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); Response queriedJobWithoutChannelReference = routerClient.GetJob(jobId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs index 7f5dbac689aa..2084ec4c5d28 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs @@ -93,7 +93,7 @@ await routerAdministrationClient.CreateDistributionPolicyAsync(new CreateDistrib #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp_Async Response updatedJobWithoutChannelReference = await routerClient.UpdateJobAsync(jobId, - RequestContent.Create(new { ChannelReference = (string?)null })); + RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); Response queriedJobWithoutChannelReference = await routerClient.GetJobAsync(jobId); From 90a0baf9c42f8cb7f999ed8891e1fe776423b3de Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Tue, 18 Jul 2023 14:16:48 +0800 Subject: [PATCH 08/18] Update --- eng/Packages.Data.props | 2 +- .../src/Generated/QuestionAnsweringAuthoringClient.cs | 4 ---- .../src/GlobalSuppressions.cs | 5 +++++ 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index a1968f18fb3a..07ff32863e4c 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -174,7 +174,7 @@ --> - + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs index 115c99fbdd4a..be0bc6164017 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs @@ -1218,9 +1218,7 @@ public virtual Operation Export(WaitUntil waitUntil, string projectN /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. /// -#pragma warning disable AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. public virtual async Task> ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, string assetKind = null, RequestContext context = null) -#pragma warning restore AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); @@ -1259,9 +1257,7 @@ public virtual async Task> ImportAsync(WaitUntil waitUntil /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. /// -#pragma warning disable AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, string assetKind = null, RequestContext context = null) -#pragma warning restore AZC0018 // Protocol method should have `requestContext` as the last parameter and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods. { Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..4129779023a8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] From 4df596e346b802d862a5b4454ee28219bf39a279 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:30:02 +0800 Subject: [PATCH 09/18] Update --- eng/Packages.Data.props | 2 +- .../src/GlobalSuppressions.cs | 5 ----- .../src/GlobalSuppressions.cs | 6 ------ .../Azure.Developer.LoadTesting/src/GlobalSuppressions.cs | 1 - 4 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs delete mode 100644 sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 07ff32863e4c..8c0746a53697 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -174,7 +174,7 @@ --> - + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs deleted file mode 100644 index 4129779023a8..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/GlobalSuppressions.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs deleted file mode 100644 index d140f3430694..000000000000 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] \ No newline at end of file diff --git a/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs b/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs index cee36e89e7a0..e4d23f35b57a 100644 --- a/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs +++ b/sdk/loadtestservice/Azure.Developer.LoadTesting/src/GlobalSuppressions.cs @@ -4,4 +4,3 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Data, Azure.DigitalTwins, Azure.IoT, Azure.Learn, Azure.Media, Azure.Management, Azure.Messaging, Azure.ResourceManager, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Azure.Identity, Microsoft.Extensions.Azure", Justification = "", Scope = "namespace", Target = "~N:Azure.Developer.LoadTesting")] -[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")] From 6e97987cd1eedec37f5ce45401ce88e0daec9b95 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 27 Jul 2023 11:36:37 +0800 Subject: [PATCH 10/18] update --- ....Communication.JobRouter.netstandard2.0.cs | 24 +++++++++---------- .../samples/ExceptionPolicyCrud.md | 2 +- .../samples/ExceptionPolicyCrudAsync.md | 2 +- .../samples/JobQueueCrud.md | 2 +- .../samples/JobQueueCrudAsync.md | 2 +- .../samples/RouterJobCrudAsync.md | 2 +- .../src/JobRouterAdministrationClient.cs | 16 ++++++------- .../src/JobRouterClient.cs | 8 +++---- .../ClassificationPolicyLiveTests.cs | 2 +- .../RouterClients/ExceptionPolicyLiveTests.cs | 2 +- .../tests/RouterClients/RouterJobLiveTests.cs | 2 +- .../tests/Samples/ExceptionPolicyCrudOps.cs | 2 +- .../Samples/ExceptionPolicyCrudOpsAsync.cs | 2 +- .../tests/Samples/JobQueueCrudOps.cs | 2 +- .../tests/Samples/JobQueueCrudOpsAsync.cs | 2 +- .../tests/Samples/RouterJobCrudOpsAsync.cs | 2 +- 16 files changed, 37 insertions(+), 37 deletions(-) diff --git a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs index 184b985a55d0..8a4ed79b7a87 100644 --- a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs @@ -286,21 +286,21 @@ public JobRouterAdministrationClient(System.Uri endpoint, Azure.Core.TokenCreden public virtual Azure.Pageable GetQueues(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetQueuesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateClassificationPolicy(Azure.Communication.JobRouter.UpdateClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateClassificationPolicy(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual Azure.Response UpdateClassificationPolicy(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> UpdateClassificationPolicyAsync(Azure.Communication.JobRouter.UpdateClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateClassificationPolicyAsync(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task UpdateClassificationPolicyAsync(string classificationPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateDistributionPolicy(Azure.Communication.JobRouter.UpdateDistributionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateDistributionPolicy(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual Azure.Response UpdateDistributionPolicy(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> UpdateDistributionPolicyAsync(Azure.Communication.JobRouter.UpdateDistributionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateDistributionPolicyAsync(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task UpdateDistributionPolicyAsync(string distributionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateExceptionPolicy(Azure.Communication.JobRouter.UpdateExceptionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateExceptionPolicy(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual Azure.Response UpdateExceptionPolicy(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> UpdateExceptionPolicyAsync(Azure.Communication.JobRouter.UpdateExceptionPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateExceptionPolicyAsync(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task UpdateExceptionPolicyAsync(string exceptionPolicyId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateQueue(Azure.Communication.JobRouter.UpdateQueueOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateQueue(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual Azure.Response UpdateQueue(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> UpdateQueueAsync(Azure.Communication.JobRouter.UpdateQueueOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateQueueAsync(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task UpdateQueueAsync(string queueId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } public partial class JobRouterClient { @@ -346,13 +346,13 @@ public JobRouterClient(System.Uri endpoint, Azure.Core.TokenCredential credentia public virtual Azure.Response UnassignJob(Azure.Communication.JobRouter.UnassignJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UnassignJobAsync(Azure.Communication.JobRouter.UnassignJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateJob(Azure.Communication.JobRouter.UpdateJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual Azure.Response UpdateJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> UpdateJobAsync(Azure.Communication.JobRouter.UpdateJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task UpdateJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateWorker(Azure.Communication.JobRouter.UpdateWorkerOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateWorker(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual Azure.Response UpdateWorker(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> UpdateWorkerAsync(Azure.Communication.JobRouter.UpdateWorkerOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateWorkerAsync(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task UpdateWorkerAsync(string workerId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } public partial class JobRouterClientOptions : Azure.Core.ClientOptions { diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md index c671cf3ba611..370169557aba 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrud.md @@ -148,7 +148,7 @@ Console.WriteLine($"`EscalateJobOnWaitTimeExceededTrigger2Min` rule has been suc ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateExceptionPolicyRemoveProp // we are going to remove Name Response updateExceptionPolicyWithoutName = routerClient.UpdateExceptionPolicy(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedExceptionPolicyWithoutName = routerClient.GetExceptionPolicy(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md index 2f234d1cc121..10ef749381f1 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ExceptionPolicyCrudAsync.md @@ -148,7 +148,7 @@ Console.WriteLine($"`EscalateJobOnWaitTimeExceededTrigger2Min` rule has been suc ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateExceptionPolicyRemoveProp_Async // we are going to remove Name Response updateExceptionPolicyWithoutName = await routerClient.UpdateExceptionPolicyAsync(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedExceptionPolicyWithoutName = await routerClient.GetExceptionPolicyAsync(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md index 4f31152682ab..d777180b141d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrud.md @@ -61,7 +61,7 @@ Response updatedJobQueue = routerAdministrationClient.Update ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp Response updatedJobQueueWithoutName = routerAdministrationClient.UpdateQueue(jobQueueId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedJobQueueWithoutName = routerAdministrationClient.GetQueue(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md index 3c94c7a6ee5d..ee2a71f42d07 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/JobQueueCrudAsync.md @@ -62,7 +62,7 @@ Response updatedJobQueue = await routerAdministrationClient. ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp_Async Response updatedJobQueueWithoutName = await routerAdministrationClient.UpdateQueueAsync(jobQueueId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedJobQueueWithoutName = await routerAdministrationClient.GetQueueAsync(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md index e423c47321e6..c3796b3603d2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md @@ -101,7 +101,7 @@ Console.WriteLine($"Job has been successfully updated. Current value of channelR ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp_Async Response updatedJobWithoutChannelReference = await routerClient.UpdateJobAsync(jobId, - RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); + RequestContent.Create(new { ChannelReference = (string?)null })); Response queriedJobWithoutChannelReference = await routerClient.GetJobAsync(jobId); diff --git a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs index 3884613e52f9..0ae1b79a3097 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterAdministrationClient.cs @@ -249,7 +249,7 @@ public virtual Response UpdateClassificationPolicy( public virtual async Task UpdateClassificationPolicyAsync( string classificationPolicyId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateClassificationPolicy)}"); scope.Start(); @@ -276,7 +276,7 @@ public virtual async Task UpdateClassificationPolicyAsync( public virtual Response UpdateClassificationPolicy( string classificationPolicyId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateClassificationPolicy)}"); scope.Start(); @@ -607,7 +607,7 @@ public virtual Response UpdateDistributionPolicy( public virtual async Task UpdateDistributionPolicyAsync( string distributionPolicyId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateDistributionPolicy)}"); scope.Start(); @@ -634,7 +634,7 @@ public virtual async Task UpdateDistributionPolicyAsync( public virtual Response UpdateDistributionPolicy( string distributionPolicyId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateDistributionPolicy)}"); scope.Start(); @@ -983,7 +983,7 @@ public virtual Response UpdateExceptionPolicy( public virtual async Task UpdateExceptionPolicyAsync( string exceptionPolicyId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateExceptionPolicy)}"); scope.Start(); @@ -1010,7 +1010,7 @@ public virtual async Task UpdateExceptionPolicyAsync( public virtual Response UpdateExceptionPolicy( string exceptionPolicyId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateExceptionPolicy)}"); scope.Start(); @@ -1360,7 +1360,7 @@ public virtual Response DeleteExceptionPolicy(string exceptionPolicyId, Cancella public virtual async Task UpdateQueueAsync( string queueId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateQueue)}"); scope.Start(); @@ -1388,7 +1388,7 @@ public virtual async Task UpdateQueueAsync( public virtual Response UpdateQueue( string queueId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterAdministrationClient)}.{nameof(UpdateQueue)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs index f7c0bf41da72..697b5a6c19e2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs @@ -444,7 +444,7 @@ public virtual Response UpdateJob( public virtual async Task UpdateJobAsync( string jobId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateJob)}"); scope.Start(); @@ -471,7 +471,7 @@ public virtual async Task UpdateJobAsync( public virtual Response UpdateJob( string jobId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateJob)}"); scope.Start(); @@ -1361,7 +1361,7 @@ public virtual Response UpdateWorker( public virtual async Task UpdateWorkerAsync( string workerId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateWorker)}"); scope.Start(); @@ -1388,7 +1388,7 @@ public virtual async Task UpdateWorkerAsync( public virtual Response UpdateWorker( string workerId, RequestContent content, - RequestContext context) + RequestContext context = null) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(JobRouterClient)}.{nameof(UpdateWorker)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs index 98fc36f9c8d4..2e3ac7494198 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ClassificationPolicyLiveTests.cs @@ -243,7 +243,7 @@ public async Task CreateClassificationPolicyAndRemoveAProperty() Assert.False(string.IsNullOrWhiteSpace(createClassificationPolicyResponse.Value.Name)); var updatedPolicyResponse = await routerClient.UpdateClassificationPolicyAsync(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); var retrievedPolicy = await routerClient.GetClassificationPolicyAsync(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs index e2db1d6b8d49..406b56c7bd96 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/ExceptionPolicyLiveTests.cs @@ -231,7 +231,7 @@ public async Task CreateExceptionPolicyAndRemoveProperty() Assert.False(string.IsNullOrWhiteSpace(createExceptionPolicyResponse.Value.Name)); var updatedExpcetionPolicyResponse = await routerClient.UpdateExceptionPolicyAsync(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); var retrievedPolicy = await routerClient.GetExceptionPolicyAsync(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs index 7b957802cda7..6ad4f4176a0f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterJobLiveTests.cs @@ -401,7 +401,7 @@ public async Task CreateJobAndRemoveProperty() var createJob1 = createJob1Response.Value; AddForCleanup(new Task(async () => await routerClient.DeleteJobAsync(createJob1.Id))); - var updatedJob1Response = await routerClient.UpdateJobAsync(createJob1.Id, RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); + var updatedJob1Response = await routerClient.UpdateJobAsync(createJob1.Id, RequestContent.Create(new { ChannelReference = (string?)null })); var retrievedJob = await routerClient.GetJobAsync(jobId1); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs index ee0a34896758..ae5f3ab916c8 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOps.cs @@ -99,7 +99,7 @@ public void DistributionPolicyCrud() // we are going to remove Name Response updateExceptionPolicyWithoutName = routerClient.UpdateExceptionPolicy(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedExceptionPolicyWithoutName = routerClient.GetExceptionPolicy(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs index a1f6a9e34774..635c5421039c 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ExceptionPolicyCrudOpsAsync.cs @@ -99,7 +99,7 @@ public async Task DistributionPolicyCrud() // we are going to remove Name Response updateExceptionPolicyWithoutName = await routerClient.UpdateExceptionPolicyAsync(exceptionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedExceptionPolicyWithoutName = await routerClient.GetExceptionPolicyAsync(exceptionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs index 1ef83e294b4f..b572e4efcf87 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOps.cs @@ -62,7 +62,7 @@ public void JobQueueCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp Response updatedJobQueueWithoutName = routerAdministrationClient.UpdateQueue(jobQueueId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedJobQueueWithoutName = routerAdministrationClient.GetQueue(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs index 54970b91d25d..f5e301cb2630 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/JobQueueCrudOpsAsync.cs @@ -62,7 +62,7 @@ public async Task JobQueueCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateQueueRemoveProp_Async Response updatedJobQueueWithoutName = await routerAdministrationClient.UpdateQueueAsync(jobQueueId, - RequestContent.Create(new { Name = (string?)null }), new RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedJobQueueWithoutName = await routerAdministrationClient.GetQueueAsync(jobQueueId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs index d9b807bc4794..e3a75ee40482 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs @@ -93,7 +93,7 @@ await routerAdministrationClient.CreateDistributionPolicyAsync(new CreateDistrib #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp_Async Response updatedJobWithoutChannelReference = await routerClient.UpdateJobAsync(jobId, - RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); + RequestContent.Create(new { ChannelReference = (string?)null })); Response queriedJobWithoutChannelReference = await routerClient.GetJobAsync(jobId); From 20913a8efa29b37322b57fffad15b95eff2c5db9 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 27 Jul 2023 11:39:56 +0800 Subject: [PATCH 11/18] update --- .../samples/ClassificationPolicyCrud.md | 2 +- .../samples/ClassificationPolicyCrudAsync.md | 2 +- .../samples/DistributionPolicyCrud.md | 2 +- .../samples/DistributionPolicyCrudAsync.md | 2 +- .../tests/RouterClients/DistributionPolicyLiveTests.cs | 2 +- .../tests/RouterClients/JobQueueLiveTests.cs | 2 +- .../tests/Samples/ClassificationPolicyCrudOps.cs | 2 +- .../tests/Samples/ClassificationPolicyCrudOpsAsync.cs | 2 +- .../tests/Samples/DistributionPolicyCrudOps.cs | 2 +- .../tests/Samples/DistributionPolicyCrudOpsAsync.cs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md index 3d102b4baa6d..4ace09537e62 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrud.md @@ -86,7 +86,7 @@ Console.WriteLine($"Classification policy successfully update with new prioritiz ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp Response updatedClassificationPolicyWithoutName = routerAdministrationClient.UpdateClassificationPolicy(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedClassificationPolicyWithoutName = routerAdministrationClient.GetClassificationPolicy(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md index cb0e40ccdf3f..3793ed7c53fd 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/ClassificationPolicyCrudAsync.md @@ -86,7 +86,7 @@ Console.WriteLine($"Classification policy successfully update with new prioritiz ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp_Async Response updatedClassificationPolicyWithoutName = await routerAdministrationClient.UpdateClassificationPolicyAsync(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedClassificationPolicyWithoutName = await routerAdministrationClient.GetClassificationPolicyAsync(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md index c197d416fd9b..30aab052eec5 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrud.md @@ -59,7 +59,7 @@ Console.WriteLine($"Distribution policy successfully update with new distributio ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp Response updatedDistributionPolicyWithoutName = routerAdministrationClient.UpdateDistributionPolicy(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedDistributionPolicyWithoutName = routerAdministrationClient.GetDistributionPolicy(distributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md index ec8d41419052..e0ea59aa0c0a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/DistributionPolicyCrudAsync.md @@ -59,7 +59,7 @@ Console.WriteLine($"Distribution policy successfully update with new distributio ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp_Async Response updatedDistributionPolicyWithoutName = await routerAdministrationClient.UpdateDistributionPolicyAsync(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedDistributionPolicyWithoutName = await routerAdministrationClient.GetDistributionPolicyAsync(distributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs index fcf37ec7703d..fe89cf06ae96 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/DistributionPolicyLiveTests.cs @@ -291,7 +291,7 @@ public async Task CreateDistributionPolicyAndRemoveAProperty() var updatedDistributionPolicyResponse = await routerClient.UpdateDistributionPolicyAsync(bestWorkerModeDistributionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); var retrievedPolicy = await routerClient.GetDistributionPolicyAsync(bestWorkerModeDistributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs index 0fa0d395f1d6..863b83a5b059 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/JobQueueLiveTests.cs @@ -107,7 +107,7 @@ public async Task CreateQueueAndRemoveProperty() Assert.False(string.IsNullOrWhiteSpace(createQueueResponse.Value.Name)); var updatedQueueResponse = - await routerClient.UpdateQueueAsync(queueId, RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + await routerClient.UpdateQueueAsync(queueId, RequestContent.Create(new { Name = (string?)null })); var queriedQueue = await routerClient.GetQueueAsync(queueId); Assert.True(string.IsNullOrWhiteSpace(queriedQueue.Value.Name)); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs index 2f636a47b373..718ce82dd31f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOps.cs @@ -75,7 +75,7 @@ public void ClassificationPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp Response updatedClassificationPolicyWithoutName = routerAdministrationClient.UpdateClassificationPolicy(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedClassificationPolicyWithoutName = routerAdministrationClient.GetClassificationPolicy(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs index 8adabe9b9a25..3409d4472647 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/ClassificationPolicyCrudOpsAsync.cs @@ -75,7 +75,7 @@ public async Task ClassificationPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateClassificationPolicyRemoveProp_Async Response updatedClassificationPolicyWithoutName = await routerAdministrationClient.UpdateClassificationPolicyAsync(classificationPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedClassificationPolicyWithoutName = await routerAdministrationClient.GetClassificationPolicyAsync(classificationPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs index 8476ef31cca0..7b068ce3eb90 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOps.cs @@ -51,7 +51,7 @@ public void DistributionPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp Response updatedDistributionPolicyWithoutName = routerAdministrationClient.UpdateDistributionPolicy(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedDistributionPolicyWithoutName = routerAdministrationClient.GetDistributionPolicy(distributionPolicyId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs index 0ba77151f8a0..fbe8b8364933 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/DistributionPolicyCrudOpsAsync.cs @@ -51,7 +51,7 @@ public async Task DistributionPolicyCrud() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateDistributionPolicyRemoveProp_Async Response updatedDistributionPolicyWithoutName = await routerAdministrationClient.UpdateDistributionPolicyAsync(distributionPolicyId, - RequestContent.Create(new { Name = (string?)null }), new Azure.RequestContext()); + RequestContent.Create(new { Name = (string?)null })); Response queriedDistributionPolicyWithoutName = await routerAdministrationClient.GetDistributionPolicyAsync(distributionPolicyId); From ced9931933c69f263bec4ffe53c79ce1f3882682 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:36:32 +0800 Subject: [PATCH 12/18] Update --- .../Azure.Communication.JobRouter/samples/RouterJobCrud.md | 2 +- .../tests/Samples/RouterJobCrudOps.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md index 790deca05153..ab15e90bc7a1 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md @@ -100,7 +100,7 @@ Console.WriteLine($"Job has been successfully updated. Current value of channelR ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp Response updatedJobWithoutChannelReference = routerClient.UpdateJob(jobId, - RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); + RequestContent.Create(new { ChannelReference = (string?)null })); Response queriedJobWithoutChannelReference = routerClient.GetJob(jobId); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs index cf56d715ebfe..ec9abe73fc1a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs @@ -92,7 +92,7 @@ public void RouterCrudOps() #region Snippet:Azure_Communication_JobRouter_Tests_Samples_Crud_UpdateJobRemoveProp Response updatedJobWithoutChannelReference = routerClient.UpdateJob(jobId, - RequestContent.Create(new { ChannelReference = (string?)null }), new RequestContext()); + RequestContent.Create(new { ChannelReference = (string?)null })); Response queriedJobWithoutChannelReference = routerClient.GetJob(jobId); From 42ebc54f64ed901f9d54a6822968789d7a5cb878 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:16:45 +0800 Subject: [PATCH 13/18] Update --- eng/Packages.Data.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 9c5251db9107..257f9b661d6a 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -175,7 +175,7 @@ --> - + From 23cd6ba806f862276928765fcfa9d56a52a094f6 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 27 Jul 2023 14:34:14 +0800 Subject: [PATCH 14/18] update --- eng/Packages.Data.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 257f9b661d6a..64bc92310497 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -175,7 +175,7 @@ --> - + From 4a3979343f31242574037c1f0e90dd0f33fe9886 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:28:48 +0800 Subject: [PATCH 15/18] update --- .../src/ContainerRegistryClient.cs | 4 ---- .../src/MapsRenderingClient.cs | 4 ---- .../Azure.Monitor.Query/src/LogsQueryClient.cs | 2 -- .../src/GlobalSuppressions.cs | 6 ------ .../src/DataLakeFileClient.cs | 4 ++++ .../src/GlobalSuppressions.cs | 7 ------- .../src/GlobalSuppressions.cs | 6 ------ .../src/GlobalSuppressions.cs | 7 ------- .../Azure.Storage.Queues/src/QueueClient.cs | 8 ++++++++ .../Azure.Data.Tables/src/GlobalSuppressions.cs | 6 ------ .../src/GlobalSuppressions.cs | 1 - .../src/WebPubSubServiceClient_extensions.cs | 16 ++++++++++++++++ 12 files changed, 28 insertions(+), 43 deletions(-) delete mode 100644 sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs delete mode 100644 sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs delete mode 100644 sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs delete mode 100644 sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs delete mode 100644 sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index cce6ace6ff83..c341cd0c531d 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -255,9 +255,7 @@ public virtual Response DeleteRepository(string repositoryName, CancellationToke /// A new for the desired repository. /// Thrown when is null. /// Thrown when is empty. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual ContainerRepository GetRepository(string repositoryName) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Argument.AssertNotNullOrEmpty(repositoryName, nameof(repositoryName)); @@ -278,9 +276,7 @@ public virtual ContainerRepository GetRepository(string repositoryName) /// Thrown when is empty. /// Thrown when is null. /// Thrown when is empty. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual RegistryArtifact GetArtifact(string repositoryName, string tagOrDigest) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Argument.AssertNotNullOrEmpty(repositoryName, nameof(repositoryName)); Argument.AssertNotNullOrEmpty(tagOrDigest, nameof(tagOrDigest)); diff --git a/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs b/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs index 8d11386974f2..7c0ef70d8500 100644 --- a/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs +++ b/sdk/maps/Azure.Maps.Rendering/src/MapsRenderingClient.cs @@ -780,9 +780,7 @@ private static GeoPosition GlobalPixelToPosition(GeoPosition pixel, double zoom, /// Zoom level /// The size of the tiles in the tile pyramid. /// A tile index contains the tile X, Y index and zoom level. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public static MapTileIndex PositionToTileXY(GeoPosition position, int zoom, int tileSize) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { var latitude = Clip(position.Latitude, MinLatitude, MaxLatitude); var longitude = Clip(position.Longitude, MinLongitude, MaxLongitude); @@ -805,9 +803,7 @@ public static MapTileIndex PositionToTileXY(GeoPosition position, int zoom, int /// Tile X, Y coordinate and zoom level /// The size of the tiles in the tile pyramid. /// A bounding box of the tile defined as an array of numbers in the format of GeoBoundingBox. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public static GeoBoundingBox TileXYToBoundingBox(MapTileIndex mapTileIndex, int tileSize) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { //Top left corner pixel coordinates var x1 = (double)(mapTileIndex.X * tileSize); diff --git a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs index 8dc6c5e18602..19aae1aaf37e 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs @@ -499,9 +499,7 @@ public virtual async Task> QueryResourceAsync(Resource /// /// An interpolated query string. /// A valid Kusto query. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public static string CreateQuery(FormattableString query) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { if (query == null) { return null; } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs b/sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs deleted file mode 100644 index fdd94f09b27c..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs index 55a00856b1bb..887607dbd82e 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs @@ -2799,7 +2799,9 @@ internal virtual async Task> FlushInternal( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Read() +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. { DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(Read)}"); @@ -2841,7 +2843,9 @@ public virtual Response Read() /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> ReadAsync() +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. { DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(Read)}"); diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs deleted file mode 100644 index 39b174b7c37b..000000000000 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/GlobalSuppressions.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs deleted file mode 100644 index fdd94f09b27c..000000000000 --- a/sdk/storage/Azure.Storage.Files.Shares/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs deleted file mode 100644 index 39b174b7c37b..000000000000 --- a/sdk/storage/Azure.Storage.Queues/src/GlobalSuppressions.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter.", Justification = "")] \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs b/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs index b7ffcf191da3..8c6b2a854821 100644 --- a/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs @@ -1652,7 +1652,9 @@ private async Task ClearMessagesInternal( /// was the default behavior in the prior v11 library. See /// CloudQueue.EncodeMessage. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response SendMessage(string messageText) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. SendMessage( messageText, null); // Pass anything else so we don't recurse on this overload @@ -1679,7 +1681,9 @@ public virtual Response SendMessage(string messageText) => /// was the default behavior in the prior v11 library. See /// CloudQueue.EncodeMessage. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> SendMessageAsync(string messageText) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await SendMessageAsync( messageText, null) // Pass anything else so we don't recurse on this overload @@ -2055,7 +2059,9 @@ private async Task> SendMessageInternal( /// /// where T is an array of /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response ReceiveMessages() => ReceiveMessages(null); // Pass anything else so we don't recurse on this overload +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. /// /// Retrieves one or more messages from the front of the queue. @@ -2067,7 +2073,9 @@ private async Task> SendMessageInternal( /// /// where T is an array of /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> ReceiveMessagesAsync() => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await ReceiveMessagesAsync(null) // Pass anything else so we don't recurse on this overload .ConfigureAwait(false); diff --git a/sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs b/sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs deleted file mode 100644 index 9ad37d79417b..000000000000 --- a/sdk/tables/Azure.Data.Tables/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs index a2c30bc3962a..b6f456d951a1 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/GlobalSuppressions.cs @@ -4,4 +4,3 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Usage", "AZC0002:DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.", Justification = "CancellationToken can be passed through RequestOptions")] -[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "CancellationToken can be passed through RequestOptions")] diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs index 7f029b5087c1..57d02e1b59eb 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs @@ -293,7 +293,9 @@ public virtual Response SendToGroup(string group, string content, ContentType co /// Check if there are any client connections inside the given group. /// Target group name, which length should be greater than 0 and less than 1025. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> GroupExistsAsync(string group, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await GroupExistsImplAsync(group, context).ConfigureAwait(false); return Response.FromValue(response.Status == 200, response); @@ -302,7 +304,9 @@ public virtual async Task> GroupExistsAsync(string group, Request /// Check if there are any client connections inside the given group. /// Target group name, which length should be greater than 0 and less than 1025. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response GroupExists(string group, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = GroupExistsImpl(group, context); return Response.FromValue(response.Status == 200, response); @@ -311,7 +315,9 @@ public virtual Response GroupExists(string group, RequestContext context = /// Check if there are any client connections connected for the given user. /// Target user Id. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> UserExistsAsync(string userId, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await UserExistsImplAsync(userId, context).ConfigureAwait(false); return Response.FromValue(response.Status == 200, response); @@ -320,7 +326,9 @@ public virtual async Task> UserExistsAsync(string userId, Request /// Check if there are any client connections connected for the given user. /// Target user Id. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response UserExists(string userId, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = UserExistsImpl(userId, context); return Response.FromValue(response.Status == 200, response); @@ -329,7 +337,9 @@ public virtual Response UserExists(string userId, RequestContext context = /// Check if the connection with the given connectionId exists. /// The connection Id. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> ConnectionExistsAsync(string connectionId, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await ConnectionExistsImplAsync(connectionId, context).ConfigureAwait(false); return Response.FromValue(response.Status == 200, response); @@ -338,7 +348,9 @@ public virtual async Task> ConnectionExistsAsync(string connectio /// Check if the connection with the given connectionId exists. /// The connection Id. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response ConnectionExists(string connectionId, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = ConnectionExistsImpl(connectionId, context); return Response.FromValue(response.Status == 200, response); @@ -393,7 +405,9 @@ public virtual Response RevokePermission(WebPubSubPermission permission, string /// Target connection Id. /// Optional. If not set, get the permission for all targets. If set, get the permission for the specific target. The meaning of the target depends on the specific permission. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> CheckPermissionAsync(WebPubSubPermission permission, string connectionId, string targetName = null, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await CheckPermissionAsync(PermissionToString(permission), connectionId, targetName, context).ConfigureAwait(false); return Response.FromValue((response.Status == 200), response); @@ -404,7 +418,9 @@ public virtual async Task> CheckPermissionAsync(WebPubSubPermissi /// Target connection Id. /// Optional. If not set, get the permission for all targets. If set, get the permission for the specific target. The meaning of the target depends on the specific permission. /// Options specifying the cancellation token, controlling error reporting, etc. +#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response CheckPermission(WebPubSubPermission permission, string connectionId, string targetName = null, RequestContext context = default) +#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = CheckPermission(PermissionToString(permission), connectionId, targetName, context); return Response.FromValue((response.Status == 200), response); From d1754a8201d4534c92e23dfae847937695881680 Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:35:22 +0800 Subject: [PATCH 16/18] Update --- .../src/ConfigurationClient.cs | 2 -- .../src/CallAutomationClient.cs | 6 ---- .../src/CallAutomationClient.cs | 4 --- .../src/BlobBatchClient.cs | 2 -- .../api/Azure.Storage.Blobs.net6.0.cs | 4 +-- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 4 +-- .../api/Azure.Storage.Blobs.netstandard2.1.cs | 4 +-- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 28 +++++++++++++++++-- .../Azure.Storage.Blobs/src/BlobClient.cs | 24 ++++++++++++++++ .../src/BlobLeaseClient.cs | 4 +++ .../src/GlobalSuppressions.cs | 7 ----- 11 files changed, 60 insertions(+), 29 deletions(-) delete mode 100644 sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs index 22c91c6fe58a..70b28ec87108 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs @@ -1396,9 +1396,7 @@ private Response ToCreateResponse(string key, string label, MatchConditions requ /// Adds an external synchronization token to ensure service requests receive up-to-date values. /// /// The synchronization token value. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual void UpdateSyncToken(string token) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { Argument.AssertNotNull(token, nameof(token)); _syncTokenPolicy.AddToken(token); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs index d8aefa7a7779..462fcb686462 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs @@ -678,9 +678,7 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal /// Initializes a new instance of CallConnection. . /// The call connection id for the GetCallConnection instance. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallConnection GetCallConnection(string callConnectionId) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallConnection)}"); scope.Start(); @@ -696,9 +694,7 @@ public virtual CallConnection GetCallConnection(string callConnectionId) } /// Initializes a new instance of GetCallRecording. . -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallRecording GetCallRecording() -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallRecording)}"); scope.Start(); @@ -714,9 +710,7 @@ public virtual CallRecording GetCallRecording() } /// Get Call Automation's EventProcessor for handling Call Automation's event more easily. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallAutomationEventProcessor GetEventProcessor() -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetEventProcessor)}"); scope.Start(); diff --git a/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs b/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs index 3637920e5255..7818abb58da6 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs @@ -430,9 +430,7 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal /// Initializes a new instance of CallConnection. . /// The call connection id for the GetCallConnection instance. -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallConnection GetCallConnection(string callConnectionId) -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallConnection)}"); scope.Start(); @@ -448,9 +446,7 @@ public virtual CallConnection GetCallConnection(string callConnectionId) } /// Initializes a new instance of GetCallRecording. . -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual CallRecording GetCallRecording() -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallRecording)}"); scope.Start(); diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs b/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs index 0396bce580a2..9d61ea16aefd 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/BlobBatchClient.cs @@ -288,9 +288,7 @@ private BlobServiceClientInternals() { } /// that can be submitted together via . /// /// A new . -#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual BlobBatch CreateBatch() => new BlobBatch(this); -#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. /// /// Submit a of sub-operations. diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs index 4a17149eb4ef..044ad76eb0db 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs @@ -1544,7 +1544,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadAsync(Azure.HttpRange range = default(Azure.HttpRange), Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, bool rangeGetContentHash = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DownloadContent() { throw null; } public virtual Azure.Response DownloadContent(Azure.Storage.Blobs.Models.BlobDownloadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1558,7 +1558,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress progressHandler, Azure.HttpRange range, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response DownloadStreaming(Azure.HttpRange range, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, bool rangeGetContentHash, System.IProgress progressHandler, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index 4a17149eb4ef..044ad76eb0db 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -1544,7 +1544,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadAsync(Azure.HttpRange range = default(Azure.HttpRange), Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, bool rangeGetContentHash = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DownloadContent() { throw null; } public virtual Azure.Response DownloadContent(Azure.Storage.Blobs.Models.BlobDownloadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1558,7 +1558,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress progressHandler, Azure.HttpRange range, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response DownloadStreaming(Azure.HttpRange range, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, bool rangeGetContentHash, System.IProgress progressHandler, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs index 4a17149eb4ef..044ad76eb0db 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs @@ -1544,7 +1544,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadAsync(Azure.HttpRange range = default(Azure.HttpRange), Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, bool rangeGetContentHash = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DownloadContent() { throw null; } public virtual Azure.Response DownloadContent(Azure.Storage.Blobs.Models.BlobDownloadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1558,7 +1558,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress progressHandler, Azure.HttpRange range, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response DownloadStreaming(Azure.HttpRange range, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, bool rangeGetContentHash, System.IProgress progressHandler, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 049374af768f..ad80b980a4ef 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -687,7 +687,9 @@ protected static async Task GetCopyAuthorizationHeaderAsync( /// /// [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Download() => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Download(CancellationToken.None); /// @@ -724,7 +726,9 @@ public virtual Response Download() => /// /// [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> DownloadAsync() => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadAsync(CancellationToken.None).ConfigureAwait(false); /// @@ -811,7 +815,7 @@ public virtual Response Download( /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> DownloadAsync( - CancellationToken cancellationToken) => + CancellationToken cancellationToken = default) => await DownloadAsync( conditions: default, // Pass anything else so we don't recurse on this overload cancellationToken: cancellationToken) @@ -1757,7 +1761,9 @@ private async ValueTask> StartDownloadAsyn /// /// /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadContent() => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadContent(CancellationToken.None); /// @@ -1792,7 +1798,9 @@ public virtual Response DownloadContent() => /// /// /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> DownloadContentAsync() => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadContentAsync(CancellationToken.None).ConfigureAwait(false); /// @@ -1875,7 +1883,7 @@ public virtual Response DownloadContent( /// /// public virtual async Task> DownloadContentAsync( - CancellationToken cancellationToken) => + CancellationToken cancellationToken = default) => await DownloadContentAsync( conditions: default, // Pass anything else so we don't recurse on this overload cancellationToken: cancellationToken) @@ -2282,7 +2290,9 @@ private async Task> DownloadContentInternal( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo(Stream destination) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo(destination, CancellationToken.None); /// @@ -2299,7 +2309,9 @@ public virtual Response DownloadTo(Stream destination) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo(string path) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo(path, CancellationToken.None); /// @@ -2316,7 +2328,9 @@ public virtual Response DownloadTo(string path) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync(Stream destination) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync(destination, CancellationToken.None).ConfigureAwait(false); /// @@ -2333,7 +2347,9 @@ public virtual async Task DownloadToAsync(Stream destination) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync(string path) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync(path, CancellationToken.None).ConfigureAwait(false); /// @@ -2355,9 +2371,11 @@ public virtual async Task DownloadToAsync(string path) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo( Stream destination, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo( destination, conditions: default, // Pass anything else so we don't recurse on this overload @@ -2382,9 +2400,11 @@ public virtual Response DownloadTo( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo( string path, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo( path, conditions: default, // Pass anything else so we don't recurse on this overload @@ -2409,9 +2429,11 @@ public virtual Response DownloadTo( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync( Stream destination, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync( destination, conditions: default, // Pass anything else so we don't recurse on this overload @@ -2437,9 +2459,11 @@ await DownloadToAsync( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync( string path, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync( path, conditions: default, // Pass anything else so we don't recurse on this overload diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs index 5a27a3e759ac..5ab209ead96d 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs @@ -338,7 +338,9 @@ protected internal virtual BlobClient WithClientSideEncryptionOptionsCore(Client /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload(Stream content) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload(content, CancellationToken.None); /// @@ -365,7 +367,9 @@ public virtual Response Upload(Stream content) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload(BinaryData content) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload(content, CancellationToken.None); /// @@ -392,7 +396,9 @@ public virtual Response Upload(BinaryData content) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload(string path) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload(path, CancellationToken.None); /// @@ -420,7 +426,9 @@ public virtual Response Upload(string path) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync(Stream content) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync(content, CancellationToken.None).ConfigureAwait(false); /// @@ -448,7 +456,9 @@ public virtual async Task> UploadAsync(Stream content) /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync(BinaryData content) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync(content, CancellationToken.None).ConfigureAwait(false); /// @@ -475,7 +485,9 @@ public virtual async Task> UploadAsync(BinaryData cont /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync(string path) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync(path, CancellationToken.None).ConfigureAwait(false); /// @@ -506,9 +518,11 @@ public virtual async Task> UploadAsync(string path) => /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload( Stream content, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload( content, overwrite: false, @@ -542,9 +556,11 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload( BinaryData content, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload( content, overwrite: false, @@ -578,9 +594,11 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload( string path, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload( path, overwrite: false, @@ -614,9 +632,11 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Task> UploadAsync( Stream content, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. UploadAsync( content, overwrite: false, @@ -650,9 +670,11 @@ public virtual Task> UploadAsync( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Task> UploadAsync( BinaryData content, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. UploadAsync( content, overwrite: false, @@ -686,9 +708,11 @@ public virtual Task> UploadAsync( /// A will be thrown if /// a failure occurs. /// +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync( string path, CancellationToken cancellationToken) => +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync( path, overwrite: false, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobLeaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobLeaseClient.cs index 370ab53a8d8e..9543239c7c90 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobLeaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobLeaseClient.cs @@ -824,12 +824,16 @@ await ReleaseInternal( /// a failure occurs. /// [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. +#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. public virtual async Task> ReleaseInternal( RequestConditions conditions, #pragma warning disable AZC0105 // DO NOT add 'async' parameter to public methods. This method is published, so it can't be modified. bool async, #pragma warning restore AZC0105 // DO NOT add 'async' parameter to public methods. CancellationToken cancellationToken) +#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods. +#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. { EnsureClient(); using (Pipeline.BeginLoggingScope(nameof(BlobLeaseClient))) diff --git a/sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs b/sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs deleted file mode 100644 index 39b174b7c37b..000000000000 --- a/sdk/storage/Azure.Storage.Blobs/src/GlobalSuppressions.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0004: DO provide both asynchronous and synchronous variants for all service methods.", Justification = "")] -[assembly: SuppressMessage("Usage", "AZC0002: Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter.", Justification = "")] \ No newline at end of file From 4b1c9dcdd3fe04c06597fab840d358d02d20df3f Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:59:12 +0800 Subject: [PATCH 17/18] Update --- .../api/Azure.Storage.Blobs.net6.0.cs | 2 +- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 2 +- .../api/Azure.Storage.Blobs.netstandard2.1.cs | 2 +- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 26 +------------------ .../Azure.Storage.Blobs/src/BlobClient.cs | 24 ----------------- .../src/DataLakeFileClient.cs | 4 --- .../Azure.Storage.Queues/src/QueueClient.cs | 8 ------ 7 files changed, 4 insertions(+), 64 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs index d6899cf9eddc..8362edc231f5 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs @@ -1559,7 +1559,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress progressHandler, Azure.HttpRange range, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response DownloadStreaming(Azure.HttpRange range, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, bool rangeGetContentHash, System.IProgress progressHandler, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index d6899cf9eddc..8362edc231f5 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -1559,7 +1559,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress progressHandler, Azure.HttpRange range, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response DownloadStreaming(Azure.HttpRange range, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, bool rangeGetContentHash, System.IProgress progressHandler, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs index d6899cf9eddc..8362edc231f5 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs @@ -1559,7 +1559,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress progressHandler, Azure.HttpRange range, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadContentAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response DownloadStreaming(Azure.HttpRange range, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, bool rangeGetContentHash, System.IProgress progressHandler, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index ad80b980a4ef..d2c15bdea080 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -687,9 +687,7 @@ protected static async Task GetCopyAuthorizationHeaderAsync( /// /// [EditorBrowsable(EditorBrowsableState.Never)] -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Download() => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Download(CancellationToken.None); /// @@ -726,9 +724,7 @@ public virtual Response Download() => /// /// [EditorBrowsable(EditorBrowsableState.Never)] -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> DownloadAsync() => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadAsync(CancellationToken.None).ConfigureAwait(false); /// @@ -1761,9 +1757,7 @@ private async ValueTask> StartDownloadAsyn /// /// /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadContent() => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadContent(CancellationToken.None); /// @@ -1798,9 +1792,7 @@ public virtual Response DownloadContent() => /// /// /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> DownloadContentAsync() => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadContentAsync(CancellationToken.None).ConfigureAwait(false); /// @@ -1883,7 +1875,7 @@ public virtual Response DownloadContent( /// /// public virtual async Task> DownloadContentAsync( - CancellationToken cancellationToken = default) => + CancellationToken cancellationToken) => await DownloadContentAsync( conditions: default, // Pass anything else so we don't recurse on this overload cancellationToken: cancellationToken) @@ -2290,9 +2282,7 @@ private async Task> DownloadContentInternal( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo(Stream destination) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo(destination, CancellationToken.None); /// @@ -2309,9 +2299,7 @@ public virtual Response DownloadTo(Stream destination) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo(string path) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo(path, CancellationToken.None); /// @@ -2328,9 +2316,7 @@ public virtual Response DownloadTo(string path) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync(Stream destination) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync(destination, CancellationToken.None).ConfigureAwait(false); /// @@ -2347,9 +2333,7 @@ public virtual async Task DownloadToAsync(Stream destination) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync(string path) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync(path, CancellationToken.None).ConfigureAwait(false); /// @@ -2371,11 +2355,9 @@ public virtual async Task DownloadToAsync(string path) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo( Stream destination, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo( destination, conditions: default, // Pass anything else so we don't recurse on this overload @@ -2400,11 +2382,9 @@ public virtual Response DownloadTo( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response DownloadTo( string path, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. DownloadTo( path, conditions: default, // Pass anything else so we don't recurse on this overload @@ -2429,11 +2409,9 @@ public virtual Response DownloadTo( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync( Stream destination, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync( destination, conditions: default, // Pass anything else so we don't recurse on this overload @@ -2459,11 +2437,9 @@ await DownloadToAsync( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task DownloadToAsync( string path, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await DownloadToAsync( path, conditions: default, // Pass anything else so we don't recurse on this overload diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs index 5ab209ead96d..5a27a3e759ac 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs @@ -338,9 +338,7 @@ protected internal virtual BlobClient WithClientSideEncryptionOptionsCore(Client /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload(Stream content) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload(content, CancellationToken.None); /// @@ -367,9 +365,7 @@ public virtual Response Upload(Stream content) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload(BinaryData content) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload(content, CancellationToken.None); /// @@ -396,9 +392,7 @@ public virtual Response Upload(BinaryData content) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload(string path) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload(path, CancellationToken.None); /// @@ -426,9 +420,7 @@ public virtual Response Upload(string path) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync(Stream content) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync(content, CancellationToken.None).ConfigureAwait(false); /// @@ -456,9 +448,7 @@ public virtual async Task> UploadAsync(Stream content) /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync(BinaryData content) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync(content, CancellationToken.None).ConfigureAwait(false); /// @@ -485,9 +475,7 @@ public virtual async Task> UploadAsync(BinaryData cont /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync(string path) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync(path, CancellationToken.None).ConfigureAwait(false); /// @@ -518,11 +506,9 @@ public virtual async Task> UploadAsync(string path) => /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload( Stream content, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload( content, overwrite: false, @@ -556,11 +542,9 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload( BinaryData content, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload( content, overwrite: false, @@ -594,11 +578,9 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Upload( string path, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. Upload( path, overwrite: false, @@ -632,11 +614,9 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Task> UploadAsync( Stream content, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. UploadAsync( content, overwrite: false, @@ -670,11 +650,9 @@ public virtual Task> UploadAsync( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Task> UploadAsync( BinaryData content, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. UploadAsync( content, overwrite: false, @@ -708,11 +686,9 @@ public virtual Task> UploadAsync( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> UploadAsync( string path, CancellationToken cancellationToken) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await UploadAsync( path, overwrite: false, diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs index 887607dbd82e..55a00856b1bb 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs @@ -2799,9 +2799,7 @@ internal virtual async Task> FlushInternal( /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response Read() -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. { DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(Read)}"); @@ -2843,9 +2841,7 @@ public virtual Response Read() /// A will be thrown if /// a failure occurs. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> ReadAsync() -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. { DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(Read)}"); diff --git a/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs b/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs index 8c6b2a854821..b7ffcf191da3 100644 --- a/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs @@ -1652,9 +1652,7 @@ private async Task ClearMessagesInternal( /// was the default behavior in the prior v11 library. See /// CloudQueue.EncodeMessage. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response SendMessage(string messageText) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. SendMessage( messageText, null); // Pass anything else so we don't recurse on this overload @@ -1681,9 +1679,7 @@ public virtual Response SendMessage(string messageText) => /// was the default behavior in the prior v11 library. See /// CloudQueue.EncodeMessage. /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> SendMessageAsync(string messageText) => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await SendMessageAsync( messageText, null) // Pass anything else so we don't recurse on this overload @@ -2059,9 +2055,7 @@ private async Task> SendMessageInternal( /// /// where T is an array of /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual Response ReceiveMessages() => ReceiveMessages(null); // Pass anything else so we don't recurse on this overload -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. /// /// Retrieves one or more messages from the front of the queue. @@ -2073,9 +2067,7 @@ private async Task> SendMessageInternal( /// /// where T is an array of /// -#pragma warning disable AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. public virtual async Task> ReceiveMessagesAsync() => -#pragma warning restore AZC0002 // Client method should have an optional CancellationToken (both name and it being optional matters) or a RequestContext as the last parameter. await ReceiveMessagesAsync(null) // Pass anything else so we don't recurse on this overload .ConfigureAwait(false); From 99e18d5c968fbe10ab26964eda89acba8890ff3a Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:44:55 +0800 Subject: [PATCH 18/18] Update --- eng/Packages.Data.props | 2 +- .../api/Azure.Storage.Blobs.net6.0.cs | 2 +- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 2 +- .../api/Azure.Storage.Blobs.netstandard2.1.cs | 2 +- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 2 +- .../src/WebPubSubServiceClient_extensions.cs | 16 ---------------- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 695a6fd6786e..207693acd668 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -175,7 +175,7 @@ --> - + diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs index 8362edc231f5..22ee2d383324 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs @@ -1545,7 +1545,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadAsync(Azure.HttpRange range = default(Azure.HttpRange), Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, bool rangeGetContentHash = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response DownloadContent() { throw null; } public virtual Azure.Response DownloadContent(Azure.Storage.Blobs.Models.BlobDownloadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index 8362edc231f5..22ee2d383324 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -1545,7 +1545,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadAsync(Azure.HttpRange range = default(Azure.HttpRange), Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, bool rangeGetContentHash = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response DownloadContent() { throw null; } public virtual Azure.Response DownloadContent(Azure.Storage.Blobs.Models.BlobDownloadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs index 8362edc231f5..22ee2d383324 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs @@ -1545,7 +1545,7 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> DownloadAsync(Azure.HttpRange range = default(Azure.HttpRange), Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, bool rangeGetContentHash = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response DownloadContent() { throw null; } public virtual Azure.Response DownloadContent(Azure.Storage.Blobs.Models.BlobDownloadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index d2c15bdea080..049374af768f 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -811,7 +811,7 @@ public virtual Response Download( /// [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> DownloadAsync( - CancellationToken cancellationToken = default) => + CancellationToken cancellationToken) => await DownloadAsync( conditions: default, // Pass anything else so we don't recurse on this overload cancellationToken: cancellationToken) diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs index 57d02e1b59eb..7f029b5087c1 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub/src/WebPubSubServiceClient_extensions.cs @@ -293,9 +293,7 @@ public virtual Response SendToGroup(string group, string content, ContentType co /// Check if there are any client connections inside the given group. /// Target group name, which length should be greater than 0 and less than 1025. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> GroupExistsAsync(string group, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await GroupExistsImplAsync(group, context).ConfigureAwait(false); return Response.FromValue(response.Status == 200, response); @@ -304,9 +302,7 @@ public virtual async Task> GroupExistsAsync(string group, Request /// Check if there are any client connections inside the given group. /// Target group name, which length should be greater than 0 and less than 1025. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response GroupExists(string group, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = GroupExistsImpl(group, context); return Response.FromValue(response.Status == 200, response); @@ -315,9 +311,7 @@ public virtual Response GroupExists(string group, RequestContext context = /// Check if there are any client connections connected for the given user. /// Target user Id. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> UserExistsAsync(string userId, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await UserExistsImplAsync(userId, context).ConfigureAwait(false); return Response.FromValue(response.Status == 200, response); @@ -326,9 +320,7 @@ public virtual async Task> UserExistsAsync(string userId, Request /// Check if there are any client connections connected for the given user. /// Target user Id. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response UserExists(string userId, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = UserExistsImpl(userId, context); return Response.FromValue(response.Status == 200, response); @@ -337,9 +329,7 @@ public virtual Response UserExists(string userId, RequestContext context = /// Check if the connection with the given connectionId exists. /// The connection Id. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> ConnectionExistsAsync(string connectionId, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await ConnectionExistsImplAsync(connectionId, context).ConfigureAwait(false); return Response.FromValue(response.Status == 200, response); @@ -348,9 +338,7 @@ public virtual async Task> ConnectionExistsAsync(string connectio /// Check if the connection with the given connectionId exists. /// The connection Id. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response ConnectionExists(string connectionId, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = ConnectionExistsImpl(connectionId, context); return Response.FromValue(response.Status == 200, response); @@ -405,9 +393,7 @@ public virtual Response RevokePermission(WebPubSubPermission permission, string /// Target connection Id. /// Optional. If not set, get the permission for all targets. If set, get the permission for the specific target. The meaning of the target depends on the specific permission. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual async Task> CheckPermissionAsync(WebPubSubPermission permission, string connectionId, string targetName = null, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = await CheckPermissionAsync(PermissionToString(permission), connectionId, targetName, context).ConfigureAwait(false); return Response.FromValue((response.Status == 200), response); @@ -418,9 +404,7 @@ public virtual async Task> CheckPermissionAsync(WebPubSubPermissi /// Target connection Id. /// Optional. If not set, get the permission for all targets. If set, get the permission for the specific target. The meaning of the target depends on the specific permission. /// Options specifying the cancellation token, controlling error reporting, etc. -#pragma warning disable AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. public virtual Response CheckPermission(WebPubSubPermission permission, string connectionId, string targetName = null, RequestContext context = default) -#pragma warning restore AZC0018 // Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. { var response = CheckPermission(PermissionToString(permission), connectionId, targetName, context); return Response.FromValue((response.Status == 200), response);