Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR azure-resourcemanager-notificationhubs] [Hub Generated] Review request for Microsoft.NotificationHubs to add version preview/2023-01-01-preview #30293

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.4 (Unreleased)
## 1.0.0-beta.1 (2022-08-05)

- Azure Resource Manager NotificationHubs client library for Java. This package contains Microsoft Azure SDK for NotificationHubs Management SDK. Azure NotificationHub client. Package tag package-2017-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-notificationhubs</artifactId>
<version>1.0.0-beta.3</version>
<version>1.0.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand Down Expand Up @@ -71,6 +73,19 @@ public static NotificationHubsManager authenticate(TokenCredential credential, A
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of NotificationHubs service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the NotificationHubs service API instance.
*/
public static NotificationHubsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new NotificationHubsManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create NotificationHubsManager with optional configuration.
*
Expand All @@ -82,13 +97,14 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -149,16 +165,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @param defaultPollInterval the default poll interval.
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -180,7 +211,7 @@ public NotificationHubsManager authenticate(TokenCredential credential, AzurePro
.append("-")
.append("com.azure.resourcemanager.notificationhubs")
.append("/")
.append("1.0.0-beta.3");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -198,10 +229,15 @@ public NotificationHubsManager authenticate(TokenCredential credential, AzurePro
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down Expand Up @@ -232,23 +268,36 @@ public NotificationHubsManager authenticate(TokenCredential credential, AzurePro
}
}

/** @return Resource collection API of Operations. */
/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of Namespaces. */
/**
* Gets the resource collection API of Namespaces. It manages NamespaceResource,
* SharedAccessAuthorizationRuleResource.
*
* @return Resource collection API of Namespaces.
*/
public Namespaces namespaces() {
if (this.namespaces == null) {
this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this);
}
return namespaces;
}

/** @return Resource collection API of NotificationHubs. */
/**
* Gets the resource collection API of NotificationHubs. It manages NotificationHubResource.
*
* @return Resource collection API of NotificationHubs.
*/
public NotificationHubs notificationHubs() {
if (this.notificationHubs == null) {
this.notificationHubs = new NotificationHubsImpl(clientObject.getNotificationHubs(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface NamespacesClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return description of a CheckAvailability resource.
* @return description of a CheckAvailability resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<CheckAvailabilityResultInner> checkAvailabilityWithResponse(
Expand Down Expand Up @@ -78,7 +78,7 @@ NamespaceResourceInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return description of a Namespace resource.
* @return description of a Namespace resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<NamespaceResourceInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -108,7 +108,7 @@ Response<NamespaceResourceInner> createOrUpdateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return description of a Namespace resource.
* @return description of a Namespace resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<NamespaceResourceInner> patchWithResponse(
Expand All @@ -122,7 +122,7 @@ Response<NamespaceResourceInner> patchWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String namespaceName);
Expand All @@ -136,7 +136,7 @@ Response<NamespaceResourceInner> patchWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String namespaceName, Context context);
Expand Down Expand Up @@ -188,7 +188,7 @@ Response<NamespaceResourceInner> patchWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return description of a Namespace resource.
* @return description of a Namespace resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<NamespaceResourceInner> getByResourceGroupWithResponse(
Expand Down Expand Up @@ -224,7 +224,7 @@ SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return description of a Namespace AuthorizationRules.
* @return description of a Namespace AuthorizationRules along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<SharedAccessAuthorizationRuleResourceInner> createOrUpdateAuthorizationRuleWithResponse(
Expand Down Expand Up @@ -257,7 +257,7 @@ Response<SharedAccessAuthorizationRuleResourceInner> createOrUpdateAuthorization
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteAuthorizationRuleWithResponse(
Expand Down Expand Up @@ -288,7 +288,7 @@ SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an authorization rule for a namespace by name.
* @return an authorization rule for a namespace by name along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<SharedAccessAuthorizationRuleResourceInner> getAuthorizationRuleWithResponse(
Expand All @@ -302,7 +302,7 @@ Response<SharedAccessAuthorizationRuleResourceInner> getAuthorizationRuleWithRes
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of the List Namespace operation.
* @return the response of the List Namespace operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<NamespaceResourceInner> listByResourceGroup(String resourceGroupName);
Expand All @@ -316,7 +316,7 @@ Response<SharedAccessAuthorizationRuleResourceInner> getAuthorizationRuleWithRes
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of the List Namespace operation.
* @return the response of the List Namespace operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<NamespaceResourceInner> listByResourceGroup(String resourceGroupName, Context context);
Expand All @@ -326,7 +326,7 @@ Response<SharedAccessAuthorizationRuleResourceInner> getAuthorizationRuleWithRes
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of the List Namespace operation.
* @return the response of the List Namespace operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<NamespaceResourceInner> list();
Expand All @@ -338,7 +338,7 @@ Response<SharedAccessAuthorizationRuleResourceInner> getAuthorizationRuleWithRes
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of the List Namespace operation.
* @return the response of the List Namespace operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<NamespaceResourceInner> list(Context context);
Expand All @@ -351,7 +351,7 @@ Response<SharedAccessAuthorizationRuleResourceInner> getAuthorizationRuleWithRes
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the authorization rules for a namespace.
* @return the authorization rules for a namespace as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<SharedAccessAuthorizationRuleResourceInner> listAuthorizationRules(
Expand All @@ -366,7 +366,7 @@ PagedIterable<SharedAccessAuthorizationRuleResourceInner> listAuthorizationRules
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the authorization rules for a namespace.
* @return the authorization rules for a namespace as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<SharedAccessAuthorizationRuleResourceInner> listAuthorizationRules(
Expand Down Expand Up @@ -396,7 +396,7 @@ PagedIterable<SharedAccessAuthorizationRuleResourceInner> listAuthorizationRules
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Primary and Secondary ConnectionStrings to the namespace.
* @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ResourceListKeysInner> listKeysWithResponse(
Expand Down Expand Up @@ -429,7 +429,7 @@ ResourceListKeysInner regenerateKeys(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return namespace/NotificationHub Connection String.
* @return namespace/NotificationHub Connection String along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ResourceListKeysInner> regenerateKeysWithResponse(
Expand Down
Loading