diff --git a/sdk/communication/azure-communication-administration/src/main/java/com/azure/communication/administration/PhoneNumberAsyncClient.java b/sdk/communication/azure-communication-administration/src/main/java/com/azure/communication/administration/PhoneNumberAsyncClient.java index 211773d00db28..abfb2639d5daa 100644 --- a/sdk/communication/azure-communication-administration/src/main/java/com/azure/communication/administration/PhoneNumberAsyncClient.java +++ b/sdk/communication/azure-communication-administration/src/main/java/com/azure/communication/administration/PhoneNumberAsyncClient.java @@ -62,6 +62,7 @@ public final class PhoneNumberAsyncClient { private final ClientLogger logger = new ClientLogger(PhoneNumberAsyncClient.class); private final PhoneNumberAdministrationsImpl phoneNumberAdministrations; + private final Duration DEFAULT_POLL_INTERVAL = Duration.ofSeconds(1); PhoneNumberAsyncClient(PhoneNumberAdminClientImpl phoneNumberAdminClient) { this.phoneNumberAdministrations = phoneNumberAdminClient.getPhoneNumberAdministrations(); @@ -779,7 +780,11 @@ Mono> purchaseSearchWithResponse(String searchId, Context context public PollerFlux beginCreateSearch( CreateSearchOptions options, Duration pollInterval) { Objects.requireNonNull(options, "'options' cannot be null."); - Objects.requireNonNull(pollInterval, "'pollInterval' cannot be null."); + + if (pollInterval == null) { + pollInterval = DEFAULT_POLL_INTERVAL; + } + return new PollerFlux(pollInterval, createSearchActivationOperation(options), createSearchPollOperation(), @@ -851,7 +856,7 @@ public PollerFlux beginPurchaseSearch(String searchId, Duration poll Objects.requireNonNull(searchId, "'searchId' can not be null."); if (pollInterval == null) { - pollInterval = Duration.ofSeconds(5); + pollInterval = DEFAULT_POLL_INTERVAL; } return new PollerFlux(pollInterval,