diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md
index 0531b27aa8c1..8ea8cb07cf45 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md
@@ -1,6 +1,8 @@
# Release History
-## 1.0.0-beta.2 (Unreleased)
+## 1.0.0-beta.1 (2022-06-14)
+
+- Azure Resource Manager BareMetalInfrastructure client library for Java. This package contains Microsoft Azure SDK for BareMetalInfrastructure Management SDK. The BareMetalInfrastructure Management client. Package tag package-2021-08-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Features Added
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md
index 57a19116e285..7a8f603e2d27 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanagerazure-resourcemanager-baremetalinfrastructure
- 1.0.0-beta.1
+ 1.0.0-beta.2
```
[//]: # ({x-version-update-end})
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java
index e8c313d7ec1e..31bcdaa554fa 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java
@@ -8,12 +8,15 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
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;
@@ -31,6 +34,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
/** Entry point to BareMetalInfrastructureManager. The BareMetalInfrastructure Management client. */
public final class BareMetalInfrastructureManager {
@@ -66,6 +70,19 @@ public static BareMetalInfrastructureManager authenticate(TokenCredential creden
return configure().authenticate(credential, profile);
}
+ /**
+ * Creates an instance of BareMetalInfrastructure service API entry point.
+ *
+ * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
+ * @param profile the Azure profile for client.
+ * @return the BareMetalInfrastructure service API instance.
+ */
+ public static BareMetalInfrastructureManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return new BareMetalInfrastructureManager(httpPipeline, profile, null);
+ }
+
/**
* Gets a Configurable instance that can be used to create BareMetalInfrastructureManager with optional
* configuration.
@@ -78,13 +95,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 policies = new ArrayList<>();
private final List scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
private Duration defaultPollInterval;
private Configurable() {
@@ -145,6 +163,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ *
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.
*
@@ -152,9 +183,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
* @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;
}
@@ -194,16 +227,34 @@ public BareMetalInfrastructureManager authenticate(TokenCredential credential, A
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 policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
- policies.addAll(this.policies);
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
@@ -215,7 +266,11 @@ public BareMetalInfrastructureManager authenticate(TokenCredential credential, A
}
}
- /** @return Resource collection API of AzureBareMetalInstances. */
+ /**
+ * Gets the resource collection API of AzureBareMetalInstances.
+ *
+ * @return Resource collection API of AzureBareMetalInstances.
+ */
public AzureBareMetalInstances azureBareMetalInstances() {
if (this.azureBareMetalInstances == null) {
this.azureBareMetalInstances =
@@ -224,7 +279,11 @@ public AzureBareMetalInstances azureBareMetalInstances() {
return azureBareMetalInstances;
}
- /** @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);
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java
index 0ce3cabc72ad..102c2b2c576f 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java
@@ -20,7 +20,8 @@ public interface AzureBareMetalInstancesClient {
*
* @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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link
+ * PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -33,7 +34,8 @@ public interface AzureBareMetalInstancesClient {
* @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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link
+ * PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
@@ -46,7 +48,8 @@ public interface AzureBareMetalInstancesClient {
* @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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response
+ * with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable listByResourceGroup(String resourceGroupName);
@@ -60,7 +63,8 @@ public interface AzureBareMetalInstancesClient {
* @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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response
+ * with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable listByResourceGroup(String resourceGroupName, Context context);
@@ -87,7 +91,8 @@ public interface AzureBareMetalInstancesClient {
* @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 Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ * @return an Azure BareMetal instance for the specified subscription, resource group, and instance name along with
+ * {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getByResourceGroupWithResponse(
@@ -119,7 +124,8 @@ Response 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 azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties).
+ * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) along with {@link
+ * Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response updateWithResponse(
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java
index 12388fb9a7f5..cf5b554e1a66 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java
@@ -17,7 +17,7 @@ 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 AzureBareMetal management operations.
+ * @return a list of AzureBareMetal management operations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -29,7 +29,7 @@ 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 AzureBareMetal management operations.
+ * @return a list of AzureBareMetal management operations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java
index 85f096962404..0748d6fbf5e9 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java
@@ -7,22 +7,18 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstancePowerStateEnum;
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalProvisioningStatesEnum;
import com.azure.resourcemanager.baremetalinfrastructure.models.HardwareProfile;
import com.azure.resourcemanager.baremetalinfrastructure.models.NetworkProfile;
import com.azure.resourcemanager.baremetalinfrastructure.models.OSProfile;
import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProfile;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
/** AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties). */
@Fluent
public final class AzureBareMetalInstanceInner extends Resource {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBareMetalInstanceInner.class);
-
/*
* AzureBareMetal instance properties
*/
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java
index 4aa448cef421..44888031a9bc 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java
@@ -5,21 +5,17 @@
package com.azure.resourcemanager.baremetalinfrastructure.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstancePowerStateEnum;
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalProvisioningStatesEnum;
import com.azure.resourcemanager.baremetalinfrastructure.models.HardwareProfile;
import com.azure.resourcemanager.baremetalinfrastructure.models.NetworkProfile;
import com.azure.resourcemanager.baremetalinfrastructure.models.OSProfile;
import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProfile;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** Describes the properties of an AzureBareMetal instance. */
@Fluent
public final class AzureBareMetalInstanceProperties {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBareMetalInstanceProperties.class);
-
/*
* Specifies the hardware settings for the AzureBareMetal instance.
*/
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java
index 212b8e4287c3..5107c1f84328 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java
@@ -5,16 +5,12 @@
package com.azure.resourcemanager.baremetalinfrastructure.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.baremetalinfrastructure.models.Display;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** AzureBareMetal operation information. */
@Fluent
public final class OperationInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class);
-
/*
* The name of the operation being performed on this particular object.
* This name should match the action name that appears in RBAC / the event
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java
index f3a572929ce4..deccdf3d2bfc 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java
@@ -27,7 +27,6 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.baremetalinfrastructure.fluent.AzureBareMetalInstancesClient;
import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalInstanceInner;
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstancesListResult;
@@ -36,8 +35,6 @@
/** An instance of this class provides access to all the operations defined in AzureBareMetalInstancesClient. */
public final class AzureBareMetalInstancesClientImpl implements AzureBareMetalInstancesClient {
- private final ClientLogger logger = new ClientLogger(AzureBareMetalInstancesClientImpl.class);
-
/** The proxy service used to perform REST calls. */
private final AzureBareMetalInstancesService service;
@@ -146,7 +143,8 @@ Mono> listByResourceGroupNext(
*
* @throws 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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
@@ -193,7 +191,8 @@ private Mono> listSinglePageAsync() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(Context context) {
@@ -235,7 +234,8 @@ private Mono> listSinglePageAsync(Con
*
* @throws 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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link
+ * PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
@@ -251,7 +251,8 @@ private PagedFlux listAsync() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link
+ * PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
@@ -265,7 +266,8 @@ private PagedFlux listAsync(Context context) {
*
* @throws 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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link
+ * PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
@@ -280,7 +282,8 @@ public PagedIterable list() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription.
+ * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link
+ * PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
@@ -295,7 +298,8 @@ public PagedIterable list(Context context) {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(
@@ -349,7 +353,8 @@ private Mono> listByResourceGroupSing
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(
@@ -399,7 +404,8 @@ private Mono> listByResourceGroupSing
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response
+ * with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
@@ -417,7 +423,8 @@ private PagedFlux listByResourceGroupAsync(String r
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response
+ * with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
@@ -434,7 +441,8 @@ private PagedFlux listByResourceGroupAsync(String r
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response
+ * with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
@@ -450,7 +458,8 @@ public PagedIterable listByResourceGroup(String res
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 AzureBareMetal instances in the specified subscription and resource group.
+ * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response
+ * with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
@@ -465,7 +474,8 @@ public PagedIterable listByResourceGroup(String res
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ * @return an Azure BareMetal instance for the specified subscription, resource group, and instance name along with
+ * {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(
@@ -517,7 +527,8 @@ private Mono> getByResourceGroupWithRespon
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ * @return an Azure BareMetal instance for the specified subscription, resource group, and instance name along with
+ * {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(
@@ -565,20 +576,14 @@ private Mono> getByResourceGroupWithRespon
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ * @return an Azure BareMetal instance for the specified subscription, resource group, and instance name on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByResourceGroupAsync(
String resourceGroupName, String azureBareMetalInstanceName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, azureBareMetalInstanceName)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -605,7 +610,8 @@ public AzureBareMetalInstanceInner getByResourceGroup(String resourceGroupName,
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ * @return an Azure BareMetal instance for the specified subscription, resource group, and instance name along with
+ * {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(
@@ -623,7 +629,8 @@ public Response getByResourceGroupWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties).
+ * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) along with {@link
+ * Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(
@@ -683,7 +690,8 @@ private Mono> updateWithResponseAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties).
+ * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) along with {@link
+ * Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(
@@ -739,20 +747,14 @@ private Mono> updateWithResponseAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties).
+ * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(
String resourceGroupName, String azureBareMetalInstanceName, Tags tagsParameter) {
return updateWithResponseAsync(resourceGroupName, azureBareMetalInstanceName, tagsParameter)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -784,7 +786,8 @@ public AzureBareMetalInstanceInner update(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties).
+ * @return azureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) along with {@link
+ * Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateWithResponse(
@@ -799,7 +802,8 @@ public Response updateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 from the List AzureBareMetal Instances operation.
+ * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
@@ -836,7 +840,8 @@ private Mono> listBySubscriptionNextS
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 from the List AzureBareMetal Instances operation.
+ * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(
@@ -872,7 +877,8 @@ private Mono> listBySubscriptionNextS
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 from the List AzureBareMetal Instances operation.
+ * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
@@ -909,7 +915,8 @@ private Mono> listByResourceGroupNext
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 from the List AzureBareMetal Instances operation.
+ * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java
index 63d85d2dffe7..335f177e39f5 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java
@@ -14,10 +14,9 @@
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstance;
import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstances;
import com.azure.resourcemanager.baremetalinfrastructure.models.Tags;
-import com.fasterxml.jackson.annotation.JsonIgnore;
public final class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBareMetalInstancesImpl.class);
+ private static final ClientLogger LOGGER = new ClientLogger(AzureBareMetalInstancesImpl.class);
private final AzureBareMetalInstancesClient innerClient;
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java
index 41946c35c425..29e1c7a70b91 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java
@@ -7,7 +7,6 @@
import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
-import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.AzureEnvironment;
@@ -67,34 +66,34 @@ public BareMetalInfrastructureClientBuilder environment(AzureEnvironment environ
}
/*
- * The default poll interval for long-running operation
+ * The HTTP pipeline to send requests through
*/
- private Duration defaultPollInterval;
+ private HttpPipeline pipeline;
/**
- * Sets The default poll interval for long-running operation.
+ * Sets The HTTP pipeline to send requests through.
*
- * @param defaultPollInterval the defaultPollInterval value.
+ * @param pipeline the pipeline value.
* @return the BareMetalInfrastructureClientBuilder.
*/
- public BareMetalInfrastructureClientBuilder defaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval = defaultPollInterval;
+ public BareMetalInfrastructureClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
return this;
}
/*
- * The HTTP pipeline to send requests through
+ * The default poll interval for long-running operation
*/
- private HttpPipeline pipeline;
+ private Duration defaultPollInterval;
/**
- * Sets The HTTP pipeline to send requests through.
+ * Sets The default poll interval for long-running operation.
*
- * @param pipeline the pipeline value.
+ * @param defaultPollInterval the defaultPollInterval value.
* @return the BareMetalInfrastructureClientBuilder.
*/
- public BareMetalInfrastructureClientBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
+ public BareMetalInfrastructureClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
return this;
}
@@ -126,15 +125,12 @@ public BareMetalInfrastructureClientImpl buildClient() {
if (environment == null) {
this.environment = AzureEnvironment.AZURE;
}
+ if (pipeline == null) {
+ this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ }
if (defaultPollInterval == null) {
this.defaultPollInterval = Duration.ofSeconds(30);
}
- if (pipeline == null) {
- this.pipeline =
- new HttpPipelineBuilder()
- .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
- .build();
- }
if (serializerAdapter == null) {
this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
}
diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java
index 84836702d882..412990fb034e 100644
--- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java
+++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java
@@ -15,6 +15,7 @@
import com.azure.core.management.polling.PollResult;
import com.azure.core.management.polling.PollerFactory;
import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.polling.AsyncPollResponse;
import com.azure.core.util.polling.LongRunningOperationStatus;
@@ -30,15 +31,12 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
-import java.util.Map;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/** Initializes a new instance of the BareMetalInfrastructureClientImpl type. */
@ServiceClient(builder = BareMetalInfrastructureClientBuilder.class)
public final class BareMetalInfrastructureClientImpl implements BareMetalInfrastructureClient {
- private final ClientLogger logger = new ClientLogger(BareMetalInfrastructureClientImpl.class);
-
/** The ID of the target subscription. */
private final String subscriptionId;
@@ -178,10 +176,7 @@ public Context getContext() {
* @return the merged context.
*/
public Context mergeContext(Context context) {
- for (Map.Entry