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-communication] [Hub Generated] Review request for Microsoft.Communication to add version preview/2023-06-01-preview #29012

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.1.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2022-05-23)

- Azure Resource Manager Communication client library for Java. This package contains Microsoft Azure SDK for Communication Management SDK. REST API for Azure Communication Services. Package tag package-2020-08-20. 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-communication</artifactId>
<version>1.1.0-beta.1</version>
<version>1.1.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
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 @@ -67,6 +69,19 @@ public static CommunicationManager authenticate(TokenCredential credential, Azur
return configure().authenticate(credential, profile);
}

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

/**
* Gets a Configurable instance that can be used to create CommunicationManager with optional configuration.
*
Expand All @@ -78,13 +93,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 @@ -145,16 +161,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 @@ -176,7 +207,7 @@ public CommunicationManager authenticate(TokenCredential credential, AzureProfil
.append("-")
.append("com.azure.resourcemanager.communication")
.append("/")
.append("1.1.0-beta.1");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -194,10 +225,15 @@ public CommunicationManager authenticate(TokenCredential credential, AzureProfil
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 @@ -228,15 +264,23 @@ public CommunicationManager authenticate(TokenCredential credential, AzureProfil
}
}

/** @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 CommunicationServices. */
/**
* Gets the resource collection API of CommunicationServices. It manages CommunicationServiceResource.
*
* @return Resource collection API of CommunicationServices.
*/
public CommunicationServices communicationServices() {
if (this.communicationServices == null) {
this.communicationServices = new CommunicationServicesImpl(clientObject.getCommunicationServices(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.azure.resourcemanager.communication.models.LinkNotificationHubParameters;
import com.azure.resourcemanager.communication.models.NameAvailabilityParameters;
import com.azure.resourcemanager.communication.models.RegenerateKeyParameters;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in CommunicationServicesClient. */
public interface CommunicationServicesClient {
Expand Down Expand Up @@ -83,7 +82,8 @@ Response<LinkedNotificationHubInner> linkNotificationHubWithResponse(
*
* @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 object that includes an array of CommunicationServices and a possible link for next set.
* @return object that includes an array of CommunicationServices and a possible link for next set as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<CommunicationServiceResourceInner> list();
Expand All @@ -95,7 +95,8 @@ Response<LinkedNotificationHubInner> linkNotificationHubWithResponse(
* @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 object that includes an array of CommunicationServices and a possible link for next set.
* @return object that includes an array of CommunicationServices and a possible link for next set as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<CommunicationServiceResourceInner> list(Context context);
Expand All @@ -107,7 +108,8 @@ Response<LinkedNotificationHubInner> linkNotificationHubWithResponse(
* @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 object that includes an array of CommunicationServices and a possible link for next set.
* @return object that includes an array of CommunicationServices and a possible link for next set as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<CommunicationServiceResourceInner> listByResourceGroup(String resourceGroupName);
Expand All @@ -120,7 +122,8 @@ Response<LinkedNotificationHubInner> linkNotificationHubWithResponse(
* @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 object that includes an array of CommunicationServices and a possible link for next set.
* @return object that includes an array of CommunicationServices and a possible link for next set as paginated
* response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<CommunicationServiceResourceInner> listByResourceGroup(String resourceGroupName, Context context);
Expand Down Expand Up @@ -194,8 +197,7 @@ Response<CommunicationServiceResourceInner> getByResourceGroupWithResponse(
* @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 a class representing a CommunicationService resource along with {@link Response} on successful completion
* of {@link Mono}.
* @return the {@link SyncPoller} for polling of a class representing a CommunicationService resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<CommunicationServiceResourceInner>, CommunicationServiceResourceInner> beginCreateOrUpdate(
Expand All @@ -211,8 +213,7 @@ SyncPoller<PollResult<CommunicationServiceResourceInner>, CommunicationServiceRe
* @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 a class representing a CommunicationService resource along with {@link Response} on successful completion
* of {@link Mono}.
* @return the {@link SyncPoller} for polling of a class representing a CommunicationService resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<CommunicationServiceResourceInner>, CommunicationServiceResourceInner> beginCreateOrUpdate(
Expand Down Expand Up @@ -276,7 +277,7 @@ CommunicationServiceResourceInner 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 the {@link Response} on successful completion of {@link Mono}.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String communicationServiceName);
Expand All @@ -290,7 +291,7 @@ CommunicationServiceResourceInner 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 the {@link Response} on successful completion of {@link Mono}.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public interface OperationsClient {
*
* @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 a list of REST API operations supported by an Azure Resource Provider.
* @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list();
Expand All @@ -29,7 +30,8 @@ public interface OperationsClient {
* @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 a list of REST API operations supported by an Azure Resource Provider.
* @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<OperationInner> list(Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
package com.azure.resourcemanager.communication.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A class representing the access keys of a CommunicationService. */
@Fluent
public final class CommunicationServiceKeysInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(CommunicationServiceKeysInner.class);

/*
* The primary access key.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.communication.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A class that describes the properties of the CommunicationService. */
@Fluent
public final class CommunicationServiceProperties {
@JsonIgnore private final ClientLogger logger = new ClientLogger(CommunicationServiceProperties.class);

/*
* Provisioning state of the resource.
*/
Expand Down Expand Up @@ -125,10 +122,12 @@ public String immutableResourceId() {
*/
public void validate() {
if (dataLocation() == null) {
throw logger
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property dataLocation in model CommunicationServiceProperties"));
}
}

private static final ClientLogger LOGGER = new ClientLogger(CommunicationServiceProperties.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.communication.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** A class representing a CommunicationService resource. */
@Fluent
public final class CommunicationServiceResourceInner extends ProxyResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(CommunicationServiceResourceInner.class);

/*
* The properties of the service.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
package com.azure.resourcemanager.communication.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A notification hub that has been linked to the communication service. */
@Fluent
public final class LinkedNotificationHubInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedNotificationHubInner.class);

/*
* The resource ID of the notification hub
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
package com.azure.resourcemanager.communication.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Result of the request to check name availability. It contains a flag and possible reason of failure. */
@Fluent
public final class NameAvailabilityInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class);

/*
* Indicates whether the name is available or not.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
package com.azure.resourcemanager.communication.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.communication.models.ActionType;
import com.azure.resourcemanager.communication.models.OperationDisplay;
import com.azure.resourcemanager.communication.models.Origin;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */
@Fluent
public final class OperationInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class);

/*
* The name of the operation, as per Resource-Based Access Control (RBAC).
* Examples: "Microsoft.Compute/virtualMachines/write",
Expand Down
Loading