diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md index 54d94a1b12f08..8b7cb625cab0a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md @@ -6,10 +6,11 @@ - Added properties `Value` and `ExpectedValue` to `DataPointAnomaly` to provide more information about the anomalous data point. - Added properties `ValueOfRootNode` and `ExpectedValueOfRootNode` to `AnomalyIncident` to provide more information about the anomalous data point at the root node of the indicent. - Response headers that were marked as `REDACTED` in error messages and logs are now exposed by default. +- `GetDetectionConfigurations` and `GetAlertConfigurations` in the `MetricsAdvisorAdministrationClient` can now take a set of options with `Skip` and `MaxPageSize` properties to configure paging behavior. ### Breaking Changes - `NotificationHook.ExternalLink` and `WebNotificationHook.Endpoint` are now of type `Uri`. -- Removed getter from `GetIncidentsForDetectionConfigurationOptions.DimensionsToFilter`. Elements can be added directly to it without user instantiation. +- Removed setter from `GetIncidentsForDetectionConfigurationOptions.DimensionsToFilter`. Elements can be added directly to it without user instantiation. - Renamed all `SkipCount` listing options to `Skip`. Affected classes include `GetAlertsOptions`, `GetDataFeedsOptions`, `GetHooksOptions`, and others. - Renamed all `TopCount` listing options to `MaxPageSize`. Affected classes include `GetAlertsOptions`, `GetDataFeedsOptions`, `GetHooksOptions`, and others. - Removed data feed sources `ElasticsearchDataFeedSource` and `HttpRequestDataFeedSource` as they are not supported by the service anymore. A different type of data feed source must be used for data ingestion instead. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs index 15f6f6e749094..68879a900f2d0 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs @@ -50,6 +50,12 @@ public static partial class AzureCognitiveServiceMetricsAdvisorRestAPIOpenAPIV2M public static bool operator !=(Azure.AI.MetricsAdvisor.FeedbackQueryTimeMode left, Azure.AI.MetricsAdvisor.FeedbackQueryTimeMode right) { throw null; } public override string ToString() { throw null; } } + public partial class GetAlertConfigurationsOptions + { + public GetAlertConfigurationsOptions() { } + public int? MaxPageSize { get { throw null; } set { } } + public int? Skip { get { throw null; } set { } } + } public partial class GetAlertsOptions { public GetAlertsOptions(System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.AI.MetricsAdvisor.AlertQueryTimeMode timeMode) { } @@ -93,6 +99,12 @@ public GetAnomaliesForDetectionConfigurationOptions(System.DateTimeOffset startT public int? Skip { get { throw null; } set { } } public System.DateTimeOffset StartTime { get { throw null; } } } + public partial class GetDetectionConfigurationsOptions + { + public GetDetectionConfigurationsOptions() { } + public int? MaxPageSize { get { throw null; } set { } } + public int? Skip { get { throw null; } set { } } + } public partial class GetDimensionValuesOptions { public GetDimensionValuesOptions() { } @@ -264,8 +276,8 @@ public MetricsAdvisorAdministrationClient(System.Uri endpoint, Azure.Core.TokenC public virtual System.Threading.Tasks.Task DeleteHookAsync(string hookId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAlertConfiguration(string alertConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAlertConfigurationAsync(string alertConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAlertConfigurations(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAlertConfigurationsAsync(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAlertConfigurations(string detectionConfigurationId, Azure.AI.MetricsAdvisor.GetAlertConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAlertConfigurationsAsync(string detectionConfigurationId, Azure.AI.MetricsAdvisor.GetAlertConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCredentialEntity(string credentialEntityId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCredentialEntityAsync(string credentialEntityId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetDataFeed(string dataFeedId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -278,8 +290,8 @@ public MetricsAdvisorAdministrationClient(System.Uri endpoint, Azure.Core.TokenC public virtual Azure.AsyncPageable GetDataFeedsAsync(Azure.AI.MetricsAdvisor.Administration.GetDataFeedsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetDetectionConfiguration(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDetectionConfigurationAsync(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetDetectionConfigurations(string metricId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDetectionConfigurationsAsync(string metricId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDetectionConfigurations(string metricId, Azure.AI.MetricsAdvisor.GetDetectionConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDetectionConfigurationsAsync(string metricId, Azure.AI.MetricsAdvisor.GetDetectionConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHook(string hookId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHookAsync(string hookId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHooks(Azure.AI.MetricsAdvisor.Administration.GetHooksOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/GetAlertConfigurationsOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/GetAlertConfigurationsOptions.cs new file mode 100644 index 0000000000000..8c3bc7e4c9dfb --- /dev/null +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/GetAlertConfigurationsOptions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.AI.MetricsAdvisor.Administration; + +namespace Azure.AI.MetricsAdvisor +{ + /// + /// The set of options that can be specified when calling + /// or to configure the behavior of the request. + /// + public class GetAlertConfigurationsOptions + { + /// + /// Initializes a new instance of the class. + /// + public GetAlertConfigurationsOptions() + { + } + + /// + /// If set, skips the first set of items returned. This property specifies the amount of items to + /// be skipped. + /// + public int? Skip { get; set; } + + /// + /// If set, specifies the maximum limit of items returned in each page of results. Note: + /// unless the number of pages enumerated from the service is limited, the service will + /// return an unlimited number of total items. + /// + public int? MaxPageSize { get; set; } + } +} diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/GetDetectionConfigurationsOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/GetDetectionConfigurationsOptions.cs new file mode 100644 index 0000000000000..8be8e6a9a69e0 --- /dev/null +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/GetDetectionConfigurationsOptions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.AI.MetricsAdvisor.Administration; + +namespace Azure.AI.MetricsAdvisor +{ + /// + /// The set of options that can be specified when calling + /// or to configure the behavior of the request. + /// + public class GetDetectionConfigurationsOptions + { + /// + /// Initializes a new instance of the class. + /// + public GetDetectionConfigurationsOptions() + { + } + + /// + /// If set, skips the first set of items returned. This property specifies the amount of items to + /// be skipped. + /// + public int? Skip { get; set; } + + /// + /// If set, specifies the maximum limit of items returned in each page of results. Note: + /// unless the number of pages enumerated from the service is limited, the service will + /// return an unlimited number of total items. + /// + public int? MaxPageSize { get; set; } + } +} diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs index 4aaea5b57492a..9ca717c150e29 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs @@ -945,14 +945,18 @@ public virtual Response UpdateDetectionConfiguration(string detectionConfigurati /// Advisor resource. /// /// Filters the result. The unique identifier of the metric to which the returned s apply. + /// An optional set of options used to configure the request's behavior. /// A controlling the request lifetime. /// An containing the collection of s. /// is null. /// is empty or not a valid GUID. - public virtual AsyncPageable GetDetectionConfigurationsAsync(string metricId, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetDetectionConfigurationsAsync(string metricId, GetDetectionConfigurationsOptions options = default, CancellationToken cancellationToken = default) { Guid metricGuid = ClientCommon.ValidateGuid(metricId, nameof(metricId)); + int? skip = options?.Skip; + int? maxPageSize = options?.MaxPageSize; + async Task> FirstPageFunc(int? pageSizeHint) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetDetectionConfigurations)}"); @@ -960,8 +964,8 @@ async Task> FirstPageFunc(int? pageSizeHint) try { - Response response = await _serviceRestClient.GetAnomalyDetectionConfigurationsByMetricAsync(metricGuid, null, null, cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + Response response = await _serviceRestClient.GetAnomalyDetectionConfigurationsByMetricAsync(metricGuid, skip, maxPageSize, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -970,7 +974,24 @@ async Task> FirstPageFunc(int? pageSizeHint) } } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetDetectionConfigurations)}"); + scope.Start(); + + try + { + Response response = await _serviceRestClient.GetAnomalyDetectionConfigurationsByMetricNextPageAsync(nextLink, metricGuid, skip, maxPageSize, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } /// @@ -978,14 +999,18 @@ async Task> FirstPageFunc(int? pageSizeHint) /// Advisor resource. /// /// Filters the result. The unique identifier of the metric to which the returned s apply. + /// An optional set of options used to configure the request's behavior. /// A controlling the request lifetime. /// A containing the collection of s. /// is null. /// is empty or not a valid GUID. - public virtual Pageable GetDetectionConfigurations(string metricId, CancellationToken cancellationToken = default) + public virtual Pageable GetDetectionConfigurations(string metricId, GetDetectionConfigurationsOptions options = default, CancellationToken cancellationToken = default) { Guid metricGuid = ClientCommon.ValidateGuid(metricId, nameof(metricId)); + int? skip = options?.Skip; + int? maxPageSize = options?.MaxPageSize; + Page FirstPageFunc(int? pageSizeHint) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetDetectionConfigurations)}"); @@ -993,8 +1018,8 @@ Page FirstPageFunc(int? pageSizeHint) try { - Response response = _serviceRestClient.GetAnomalyDetectionConfigurationsByMetric(metricGuid, null, null, cancellationToken); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + Response response = _serviceRestClient.GetAnomalyDetectionConfigurationsByMetric(metricGuid, skip, maxPageSize, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -1003,7 +1028,24 @@ Page FirstPageFunc(int? pageSizeHint) } } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetDetectionConfigurations)}"); + scope.Start(); + + try + { + Response response = _serviceRestClient.GetAnomalyDetectionConfigurationsByMetricNextPage(nextLink, metricGuid, skip, maxPageSize, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } /// @@ -1300,14 +1342,18 @@ public virtual Response GetAlertConfiguration(string /// Advisor resource. /// /// Filters the result. The unique identifier of the to which the returned s apply. + /// An optional set of options used to configure the request's behavior. /// A controlling the request lifetime. /// An containing the collection of s. /// is null. /// is empty or not a valid GUID. - public virtual AsyncPageable GetAlertConfigurationsAsync(string detectionConfigurationId, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAlertConfigurationsAsync(string detectionConfigurationId, GetAlertConfigurationsOptions options = default, CancellationToken cancellationToken = default) { Guid detectionConfigurationGuid = ClientCommon.ValidateGuid(detectionConfigurationId, nameof(detectionConfigurationId)); + int? skip = options?.Skip; + int? maxPageSize = options?.MaxPageSize; + async Task> FirstPageFunc(int? pageSizeHint) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetAlertConfigurations)}"); @@ -1315,8 +1361,8 @@ async Task> FirstPageFunc(int? pageSizeHint) try { - Response response = await _serviceRestClient.GetAnomalyAlertingConfigurationsByAnomalyDetectionConfigurationAsync(detectionConfigurationGuid, null, null, cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + Response response = await _serviceRestClient.GetAnomalyAlertingConfigurationsByAnomalyDetectionConfigurationAsync(detectionConfigurationGuid, skip, maxPageSize, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -1325,7 +1371,24 @@ async Task> FirstPageFunc(int? pageSizeHint) } } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetAlertConfigurations)}"); + scope.Start(); + + try + { + Response response = await _serviceRestClient.GetAnomalyAlertingConfigurationsByAnomalyDetectionConfigurationNextPageAsync(nextLink, detectionConfigurationGuid, skip, maxPageSize, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } /// @@ -1333,14 +1396,18 @@ async Task> FirstPageFunc(int? pageSizeHint) /// Advisor resource. /// /// Filters the result. The unique identifier of the to which the returned s apply. + /// An optional set of options used to configure the request's behavior. /// A controlling the request lifetime. /// An containing the collection of s. /// is null. /// is empty or not a valid GUID. - public virtual Pageable GetAlertConfigurations(string detectionConfigurationId, CancellationToken cancellationToken = default) + public virtual Pageable GetAlertConfigurations(string detectionConfigurationId, GetAlertConfigurationsOptions options = default, CancellationToken cancellationToken = default) { Guid detectionConfigurationGuid = ClientCommon.ValidateGuid(detectionConfigurationId, nameof(detectionConfigurationId)); + int? skip = options?.Skip; + int? maxPageSize = options?.MaxPageSize; + Page FirstPageFunc(int? pageSizeHint) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetAlertConfigurations)}"); @@ -1348,8 +1415,8 @@ Page FirstPageFunc(int? pageSizeHint) try { - Response response = _serviceRestClient.GetAnomalyAlertingConfigurationsByAnomalyDetectionConfiguration(detectionConfigurationGuid, null, null, cancellationToken); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + Response response = _serviceRestClient.GetAnomalyAlertingConfigurationsByAnomalyDetectionConfiguration(detectionConfigurationGuid, skip, maxPageSize, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -1358,7 +1425,24 @@ Page FirstPageFunc(int? pageSizeHint) } } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(GetAlertConfigurations)}"); + scope.Start(); + + try + { + Response response = _serviceRestClient.GetAnomalyAlertingConfigurationsByAnomalyDetectionConfigurationNextPage(nextLink, detectionConfigurationGuid, skip, maxPageSize, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } /// diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs index bef2b9455bc74..0db1cce1855f4 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs @@ -133,10 +133,10 @@ public void GetAlertConfigurationsRespectsTheCancellationToken() using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); - IAsyncEnumerator asyncEnumerator = adminClient.GetAlertConfigurationsAsync(FakeGuid, cancellationSource.Token).GetAsyncEnumerator(); + IAsyncEnumerator asyncEnumerator = adminClient.GetAlertConfigurationsAsync(FakeGuid, default, cancellationSource.Token).GetAsyncEnumerator(); Assert.That(async () => await asyncEnumerator.MoveNextAsync(), Throws.InstanceOf()); - IEnumerator enumerator = adminClient.GetAlertConfigurations(FakeGuid, cancellationSource.Token).GetEnumerator(); + IEnumerator enumerator = adminClient.GetAlertConfigurations(FakeGuid, default, cancellationSource.Token).GetEnumerator(); Assert.That(() => enumerator.MoveNext(), Throws.InstanceOf()); } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationTests.cs index 42d2c5b284d06..b40726a227837 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationTests.cs @@ -161,10 +161,10 @@ public void GetDetectionConfigurationsRespectsTheCancellationToken() using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); - IAsyncEnumerator asyncEnumerator = adminClient.GetDetectionConfigurationsAsync(FakeGuid, cancellationSource.Token).GetAsyncEnumerator(); + IAsyncEnumerator asyncEnumerator = adminClient.GetDetectionConfigurationsAsync(FakeGuid, default, cancellationSource.Token).GetAsyncEnumerator(); Assert.That(async () => await asyncEnumerator.MoveNextAsync(), Throws.InstanceOf()); - IEnumerator enumerator = adminClient.GetDetectionConfigurations(FakeGuid, cancellationSource.Token).GetEnumerator(); + IEnumerator enumerator = adminClient.GetDetectionConfigurations(FakeGuid, default, cancellationSource.Token).GetEnumerator(); Assert.That(() => enumerator.MoveNext(), Throws.InstanceOf()); }