scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
private Duration defaultPollInterval;
private Configurable() {
@@ -120,6 +139,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
return this;
}
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
/**
* Sets the retry policy to the HTTP pipeline.
*
@@ -131,6 +161,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.
*
@@ -138,9 +181,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;
}
@@ -176,20 +221,38 @@ public UsageManager authenticate(TokenCredential credential, AzureProfile profil
userAgentBuilder.append(" (auto-generated)");
}
+ if (scopes.isEmpty()) {
+ 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
- .add(
- new BearerTokenAuthenticationPolicy(
- credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
- policies.addAll(this.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 =
@@ -201,7 +264,11 @@ public UsageManager authenticate(TokenCredential credential, AzureProfile profil
}
}
- /** @return Resource collection API of UsageAggregates. */
+ /**
+ * Gets the resource collection API of UsageAggregates.
+ *
+ * @return Resource collection API of UsageAggregates.
+ */
public UsageAggregates usageAggregates() {
if (this.usageAggregates == null) {
this.usageAggregates = new UsageAggregatesImpl(clientObject.getUsageAggregates(), this);
@@ -209,7 +276,11 @@ public UsageAggregates usageAggregates() {
return usageAggregates;
}
- /** @return Resource collection API of RateCards. */
+ /**
+ * Gets the resource collection API of RateCards.
+ *
+ * @return Resource collection API of RateCards.
+ */
public RateCards rateCards() {
if (this.rateCards == null) {
this.rateCards = new RateCardsImpl(clientObject.getRateCards(), this);
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/RateCardsClient.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/RateCardsClient.java
index 8463a9589ec9..03ec81c5233b 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/RateCardsClient.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/RateCardsClient.java
@@ -46,7 +46,7 @@ public interface RateCardsClient {
* @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 price and Metadata information for resources.
+ * @return price and Metadata information for resources along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getWithResponse(String filter, Context context);
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/UsageAggregatesClient.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/UsageAggregatesClient.java
index 1188d1c881df..4c3d767c5740 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/UsageAggregatesClient.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/UsageAggregatesClient.java
@@ -22,7 +22,7 @@ public interface UsageAggregatesClient {
* @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 Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(OffsetDateTime reportedStartTime, OffsetDateTime reportedEndTime);
@@ -46,7 +46,7 @@ public interface UsageAggregatesClient {
* @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 Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/ResourceRateCardInfoInner.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/ResourceRateCardInfoInner.java
index ef7d8c5ef553..41a04f375ade 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/ResourceRateCardInfoInner.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/ResourceRateCardInfoInner.java
@@ -5,18 +5,14 @@
package com.azure.resourcemanager.commerce.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.commerce.models.MeterInfo;
-import com.azure.resourcemanager.commerce.models.OfferTermInfo;
-import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.azure.resourcemanager.commerce.models.OfferTermInfoAutoGenerated;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/** Price and Metadata information for resources. */
@Fluent
public final class ResourceRateCardInfoInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceRateCardInfoInner.class);
-
/*
* The currency in which the rates are provided.
*/
@@ -39,7 +35,7 @@ public final class ResourceRateCardInfoInner {
* A list of offer terms.
*/
@JsonProperty(value = "OfferTerms")
- private List offerTerms;
+ private List offerTerms;
/*
* A list of meters.
@@ -112,7 +108,7 @@ public ResourceRateCardInfoInner withIsTaxIncluded(Boolean isTaxIncluded) {
*
* @return the offerTerms value.
*/
- public List offerTerms() {
+ public List offerTerms() {
return this.offerTerms;
}
@@ -122,7 +118,7 @@ public List offerTerms() {
* @param offerTerms the offerTerms value to set.
* @return the ResourceRateCardInfoInner object itself.
*/
- public ResourceRateCardInfoInner withOfferTerms(List offerTerms) {
+ public ResourceRateCardInfoInner withOfferTerms(List offerTerms) {
this.offerTerms = offerTerms;
return this;
}
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageAggregationInner.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageAggregationInner.java
index 8a36a3fcb1c1..8376253e1152 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageAggregationInner.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageAggregationInner.java
@@ -5,20 +5,14 @@
package com.azure.resourcemanager.commerce.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.annotation.JsonFlatten;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.commerce.models.InfoField;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.UUID;
/** Describes the usageAggregation. */
-@JsonFlatten
@Fluent
-public class UsageAggregationInner {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageAggregationInner.class);
-
+public final class UsageAggregationInner {
/*
* Unique Id for the usage aggregate.
*/
@@ -38,78 +32,10 @@ public class UsageAggregationInner {
private String type;
/*
- * The subscription identifier for the Azure user.
- */
- @JsonProperty(value = "properties.subscriptionId")
- private UUID subscriptionId;
-
- /*
- * Unique ID for the resource that was consumed (aka ResourceID).
- */
- @JsonProperty(value = "properties.meterId")
- private String meterId;
-
- /*
- * UTC start time for the usage bucket to which this usage aggregate
- * belongs.
- */
- @JsonProperty(value = "properties.usageStartTime")
- private OffsetDateTime usageStartTime;
-
- /*
- * UTC end time for the usage bucket to which this usage aggregate belongs.
- */
- @JsonProperty(value = "properties.usageEndTime")
- private OffsetDateTime usageEndTime;
-
- /*
- * The amount of the resource consumption that occurred in this time frame.
+ * Usage data.
*/
- @JsonProperty(value = "properties.quantity")
- private Float quantity;
-
- /*
- * The unit in which the usage for this resource is being counted, e.g.
- * Hours, GB.
- */
- @JsonProperty(value = "properties.unit")
- private String unit;
-
- /*
- * Friendly name of the resource being consumed.
- */
- @JsonProperty(value = "properties.meterName")
- private String meterName;
-
- /*
- * Category of the consumed resource.
- */
- @JsonProperty(value = "properties.meterCategory")
- private String meterCategory;
-
- /*
- * Sub-category of the consumed resource.
- */
- @JsonProperty(value = "properties.meterSubCategory")
- private String meterSubCategory;
-
- /*
- * Region of the meterId used for billing purposes
- */
- @JsonProperty(value = "properties.meterRegion")
- private String meterRegion;
-
- /*
- * Key-value pairs of instance details (legacy format).
- */
- @JsonProperty(value = "properties.infoFields")
- private InfoField infoFields;
-
- /*
- * Key-value pairs of instance details represented as a string.
- */
- @JsonProperty(value = "properties.instanceData")
- private String instanceData;
+ @JsonProperty(value = "properties")
+ private UsageSample innerProperties;
/**
* Get the id property: Unique Id for the usage aggregate.
@@ -171,13 +97,22 @@ public UsageAggregationInner withType(String type) {
return this;
}
+ /**
+ * Get the innerProperties property: Usage data.
+ *
+ * @return the innerProperties value.
+ */
+ private UsageSample innerProperties() {
+ return this.innerProperties;
+ }
+
/**
* Get the subscriptionId property: The subscription identifier for the Azure user.
*
* @return the subscriptionId value.
*/
public UUID subscriptionId() {
- return this.subscriptionId;
+ return this.innerProperties() == null ? null : this.innerProperties().subscriptionId();
}
/**
@@ -187,7 +122,10 @@ public UUID subscriptionId() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withSubscriptionId(UUID subscriptionId) {
- this.subscriptionId = subscriptionId;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withSubscriptionId(subscriptionId);
return this;
}
@@ -197,7 +135,7 @@ public UsageAggregationInner withSubscriptionId(UUID subscriptionId) {
* @return the meterId value.
*/
public String meterId() {
- return this.meterId;
+ return this.innerProperties() == null ? null : this.innerProperties().meterId();
}
/**
@@ -207,7 +145,10 @@ public String meterId() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withMeterId(String meterId) {
- this.meterId = meterId;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withMeterId(meterId);
return this;
}
@@ -217,7 +158,7 @@ public UsageAggregationInner withMeterId(String meterId) {
* @return the usageStartTime value.
*/
public OffsetDateTime usageStartTime() {
- return this.usageStartTime;
+ return this.innerProperties() == null ? null : this.innerProperties().usageStartTime();
}
/**
@@ -227,7 +168,10 @@ public OffsetDateTime usageStartTime() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withUsageStartTime(OffsetDateTime usageStartTime) {
- this.usageStartTime = usageStartTime;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withUsageStartTime(usageStartTime);
return this;
}
@@ -237,7 +181,7 @@ public UsageAggregationInner withUsageStartTime(OffsetDateTime usageStartTime) {
* @return the usageEndTime value.
*/
public OffsetDateTime usageEndTime() {
- return this.usageEndTime;
+ return this.innerProperties() == null ? null : this.innerProperties().usageEndTime();
}
/**
@@ -247,7 +191,10 @@ public OffsetDateTime usageEndTime() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withUsageEndTime(OffsetDateTime usageEndTime) {
- this.usageEndTime = usageEndTime;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withUsageEndTime(usageEndTime);
return this;
}
@@ -257,7 +204,7 @@ public UsageAggregationInner withUsageEndTime(OffsetDateTime usageEndTime) {
* @return the quantity value.
*/
public Float quantity() {
- return this.quantity;
+ return this.innerProperties() == null ? null : this.innerProperties().quantity();
}
/**
@@ -267,7 +214,10 @@ public Float quantity() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withQuantity(Float quantity) {
- this.quantity = quantity;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withQuantity(quantity);
return this;
}
@@ -277,7 +227,7 @@ public UsageAggregationInner withQuantity(Float quantity) {
* @return the unit value.
*/
public String unit() {
- return this.unit;
+ return this.innerProperties() == null ? null : this.innerProperties().unit();
}
/**
@@ -287,7 +237,10 @@ public String unit() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withUnit(String unit) {
- this.unit = unit;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withUnit(unit);
return this;
}
@@ -297,7 +250,7 @@ public UsageAggregationInner withUnit(String unit) {
* @return the meterName value.
*/
public String meterName() {
- return this.meterName;
+ return this.innerProperties() == null ? null : this.innerProperties().meterName();
}
/**
@@ -307,7 +260,10 @@ public String meterName() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withMeterName(String meterName) {
- this.meterName = meterName;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withMeterName(meterName);
return this;
}
@@ -317,7 +273,7 @@ public UsageAggregationInner withMeterName(String meterName) {
* @return the meterCategory value.
*/
public String meterCategory() {
- return this.meterCategory;
+ return this.innerProperties() == null ? null : this.innerProperties().meterCategory();
}
/**
@@ -327,7 +283,10 @@ public String meterCategory() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withMeterCategory(String meterCategory) {
- this.meterCategory = meterCategory;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withMeterCategory(meterCategory);
return this;
}
@@ -337,7 +296,7 @@ public UsageAggregationInner withMeterCategory(String meterCategory) {
* @return the meterSubCategory value.
*/
public String meterSubCategory() {
- return this.meterSubCategory;
+ return this.innerProperties() == null ? null : this.innerProperties().meterSubCategory();
}
/**
@@ -347,7 +306,10 @@ public String meterSubCategory() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withMeterSubCategory(String meterSubCategory) {
- this.meterSubCategory = meterSubCategory;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withMeterSubCategory(meterSubCategory);
return this;
}
@@ -357,7 +319,7 @@ public UsageAggregationInner withMeterSubCategory(String meterSubCategory) {
* @return the meterRegion value.
*/
public String meterRegion() {
- return this.meterRegion;
+ return this.innerProperties() == null ? null : this.innerProperties().meterRegion();
}
/**
@@ -367,7 +329,10 @@ public String meterRegion() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withMeterRegion(String meterRegion) {
- this.meterRegion = meterRegion;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withMeterRegion(meterRegion);
return this;
}
@@ -377,7 +342,7 @@ public UsageAggregationInner withMeterRegion(String meterRegion) {
* @return the infoFields value.
*/
public InfoField infoFields() {
- return this.infoFields;
+ return this.innerProperties() == null ? null : this.innerProperties().infoFields();
}
/**
@@ -387,7 +352,10 @@ public InfoField infoFields() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withInfoFields(InfoField infoFields) {
- this.infoFields = infoFields;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withInfoFields(infoFields);
return this;
}
@@ -397,7 +365,7 @@ public UsageAggregationInner withInfoFields(InfoField infoFields) {
* @return the instanceData value.
*/
public String instanceData() {
- return this.instanceData;
+ return this.innerProperties() == null ? null : this.innerProperties().instanceData();
}
/**
@@ -407,7 +375,10 @@ public String instanceData() {
* @return the UsageAggregationInner object itself.
*/
public UsageAggregationInner withInstanceData(String instanceData) {
- this.instanceData = instanceData;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new UsageSample();
+ }
+ this.innerProperties().withInstanceData(instanceData);
return this;
}
@@ -417,8 +388,8 @@ public UsageAggregationInner withInstanceData(String instanceData) {
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
- if (infoFields() != null) {
- infoFields().validate();
+ if (innerProperties() != null) {
+ innerProperties().validate();
}
}
}
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageSample.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageSample.java
new file mode 100644
index 000000000000..ebf452b0a41a
--- /dev/null
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/fluent/models/UsageSample.java
@@ -0,0 +1,340 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.commerce.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.commerce.models.InfoField;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.UUID;
+
+/** Describes a sample of the usageAggregation. */
+@Fluent
+public final class UsageSample {
+ /*
+ * The subscription identifier for the Azure user.
+ */
+ @JsonProperty(value = "subscriptionId")
+ private UUID subscriptionId;
+
+ /*
+ * Unique ID for the resource that was consumed (aka ResourceID).
+ */
+ @JsonProperty(value = "meterId")
+ private String meterId;
+
+ /*
+ * UTC start time for the usage bucket to which this usage aggregate
+ * belongs.
+ */
+ @JsonProperty(value = "usageStartTime")
+ private OffsetDateTime usageStartTime;
+
+ /*
+ * UTC end time for the usage bucket to which this usage aggregate belongs.
+ */
+ @JsonProperty(value = "usageEndTime")
+ private OffsetDateTime usageEndTime;
+
+ /*
+ * The amount of the resource consumption that occurred in this time frame.
+ */
+ @JsonProperty(value = "quantity")
+ private Float quantity;
+
+ /*
+ * The unit in which the usage for this resource is being counted, e.g.
+ * Hours, GB.
+ */
+ @JsonProperty(value = "unit")
+ private String unit;
+
+ /*
+ * Friendly name of the resource being consumed.
+ */
+ @JsonProperty(value = "meterName")
+ private String meterName;
+
+ /*
+ * Category of the consumed resource.
+ */
+ @JsonProperty(value = "meterCategory")
+ private String meterCategory;
+
+ /*
+ * Sub-category of the consumed resource.
+ */
+ @JsonProperty(value = "meterSubCategory")
+ private String meterSubCategory;
+
+ /*
+ * Region of the meterId used for billing purposes
+ */
+ @JsonProperty(value = "meterRegion")
+ private String meterRegion;
+
+ /*
+ * Key-value pairs of instance details (legacy format).
+ */
+ @JsonProperty(value = "infoFields")
+ private InfoField infoFields;
+
+ /*
+ * Key-value pairs of instance details represented as a string.
+ */
+ @JsonProperty(value = "instanceData")
+ private String instanceData;
+
+ /**
+ * Get the subscriptionId property: The subscription identifier for the Azure user.
+ *
+ * @return the subscriptionId value.
+ */
+ public UUID subscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * Set the subscriptionId property: The subscription identifier for the Azure user.
+ *
+ * @param subscriptionId the subscriptionId value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withSubscriptionId(UUID subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /**
+ * Get the meterId property: Unique ID for the resource that was consumed (aka ResourceID).
+ *
+ * @return the meterId value.
+ */
+ public String meterId() {
+ return this.meterId;
+ }
+
+ /**
+ * Set the meterId property: Unique ID for the resource that was consumed (aka ResourceID).
+ *
+ * @param meterId the meterId value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withMeterId(String meterId) {
+ this.meterId = meterId;
+ return this;
+ }
+
+ /**
+ * Get the usageStartTime property: UTC start time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @return the usageStartTime value.
+ */
+ public OffsetDateTime usageStartTime() {
+ return this.usageStartTime;
+ }
+
+ /**
+ * Set the usageStartTime property: UTC start time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @param usageStartTime the usageStartTime value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withUsageStartTime(OffsetDateTime usageStartTime) {
+ this.usageStartTime = usageStartTime;
+ return this;
+ }
+
+ /**
+ * Get the usageEndTime property: UTC end time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @return the usageEndTime value.
+ */
+ public OffsetDateTime usageEndTime() {
+ return this.usageEndTime;
+ }
+
+ /**
+ * Set the usageEndTime property: UTC end time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @param usageEndTime the usageEndTime value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withUsageEndTime(OffsetDateTime usageEndTime) {
+ this.usageEndTime = usageEndTime;
+ return this;
+ }
+
+ /**
+ * Get the quantity property: The amount of the resource consumption that occurred in this time frame.
+ *
+ * @return the quantity value.
+ */
+ public Float quantity() {
+ return this.quantity;
+ }
+
+ /**
+ * Set the quantity property: The amount of the resource consumption that occurred in this time frame.
+ *
+ * @param quantity the quantity value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withQuantity(Float quantity) {
+ this.quantity = quantity;
+ return this;
+ }
+
+ /**
+ * Get the unit property: The unit in which the usage for this resource is being counted, e.g. Hours, GB.
+ *
+ * @return the unit value.
+ */
+ public String unit() {
+ return this.unit;
+ }
+
+ /**
+ * Set the unit property: The unit in which the usage for this resource is being counted, e.g. Hours, GB.
+ *
+ * @param unit the unit value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withUnit(String unit) {
+ this.unit = unit;
+ return this;
+ }
+
+ /**
+ * Get the meterName property: Friendly name of the resource being consumed.
+ *
+ * @return the meterName value.
+ */
+ public String meterName() {
+ return this.meterName;
+ }
+
+ /**
+ * Set the meterName property: Friendly name of the resource being consumed.
+ *
+ * @param meterName the meterName value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withMeterName(String meterName) {
+ this.meterName = meterName;
+ return this;
+ }
+
+ /**
+ * Get the meterCategory property: Category of the consumed resource.
+ *
+ * @return the meterCategory value.
+ */
+ public String meterCategory() {
+ return this.meterCategory;
+ }
+
+ /**
+ * Set the meterCategory property: Category of the consumed resource.
+ *
+ * @param meterCategory the meterCategory value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withMeterCategory(String meterCategory) {
+ this.meterCategory = meterCategory;
+ return this;
+ }
+
+ /**
+ * Get the meterSubCategory property: Sub-category of the consumed resource.
+ *
+ * @return the meterSubCategory value.
+ */
+ public String meterSubCategory() {
+ return this.meterSubCategory;
+ }
+
+ /**
+ * Set the meterSubCategory property: Sub-category of the consumed resource.
+ *
+ * @param meterSubCategory the meterSubCategory value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withMeterSubCategory(String meterSubCategory) {
+ this.meterSubCategory = meterSubCategory;
+ return this;
+ }
+
+ /**
+ * Get the meterRegion property: Region of the meterId used for billing purposes.
+ *
+ * @return the meterRegion value.
+ */
+ public String meterRegion() {
+ return this.meterRegion;
+ }
+
+ /**
+ * Set the meterRegion property: Region of the meterId used for billing purposes.
+ *
+ * @param meterRegion the meterRegion value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withMeterRegion(String meterRegion) {
+ this.meterRegion = meterRegion;
+ return this;
+ }
+
+ /**
+ * Get the infoFields property: Key-value pairs of instance details (legacy format).
+ *
+ * @return the infoFields value.
+ */
+ public InfoField infoFields() {
+ return this.infoFields;
+ }
+
+ /**
+ * Set the infoFields property: Key-value pairs of instance details (legacy format).
+ *
+ * @param infoFields the infoFields value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withInfoFields(InfoField infoFields) {
+ this.infoFields = infoFields;
+ return this;
+ }
+
+ /**
+ * Get the instanceData property: Key-value pairs of instance details represented as a string.
+ *
+ * @return the instanceData value.
+ */
+ public String instanceData() {
+ return this.instanceData;
+ }
+
+ /**
+ * Set the instanceData property: Key-value pairs of instance details represented as a string.
+ *
+ * @param instanceData the instanceData value to set.
+ * @return the UsageSample object itself.
+ */
+ public UsageSample withInstanceData(String instanceData) {
+ this.instanceData = instanceData;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (infoFields() != null) {
+ infoFields().validate();
+ }
+ }
+}
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsClientImpl.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsClientImpl.java
index ab0122223ba8..4b384c67c7cd 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsClientImpl.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsClientImpl.java
@@ -21,15 +21,12 @@
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.commerce.fluent.RateCardsClient;
import com.azure.resourcemanager.commerce.fluent.models.ResourceRateCardInfoInner;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in RateCardsClient. */
public final class RateCardsClientImpl implements RateCardsClient {
- private final ClientLogger logger = new ClientLogger(RateCardsClientImpl.class);
-
/** The proxy service used to perform REST calls. */
private final RateCardsService service;
@@ -81,7 +78,8 @@ Mono> get(
* @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 price and Metadata information for resources.
+ * @return price and Metadata information for resources along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String filter) {
@@ -130,7 +128,8 @@ private Mono> getWithResponseAsync(String fi
* @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 price and Metadata information for resources.
+ * @return price and Metadata information for resources along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String filter, Context context) {
@@ -175,19 +174,11 @@ private Mono> getWithResponseAsync(String fi
* @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 price and Metadata information for resources.
+ * @return price and Metadata information for resources on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String filter) {
- return getWithResponseAsync(filter)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ return getWithResponseAsync(filter).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -226,7 +217,7 @@ public ResourceRateCardInfoInner get(String filter) {
* @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 price and Metadata information for resources.
+ * @return price and Metadata information for resources along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String filter, Context context) {
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsImpl.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsImpl.java
index e2d2459366b6..c4b19475fb28 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsImpl.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/RateCardsImpl.java
@@ -12,10 +12,9 @@
import com.azure.resourcemanager.commerce.fluent.models.ResourceRateCardInfoInner;
import com.azure.resourcemanager.commerce.models.RateCards;
import com.azure.resourcemanager.commerce.models.ResourceRateCardInfo;
-import com.fasterxml.jackson.annotation.JsonIgnore;
public final class RateCardsImpl implements RateCards {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(RateCardsImpl.class);
+ private static final ClientLogger LOGGER = new ClientLogger(RateCardsImpl.class);
private final RateCardsClient innerClient;
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/ResourceRateCardInfoImpl.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/ResourceRateCardInfoImpl.java
index 05e0eafe42cc..b877ec00b301 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/ResourceRateCardInfoImpl.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/ResourceRateCardInfoImpl.java
@@ -6,7 +6,7 @@
import com.azure.resourcemanager.commerce.fluent.models.ResourceRateCardInfoInner;
import com.azure.resourcemanager.commerce.models.MeterInfo;
-import com.azure.resourcemanager.commerce.models.OfferTermInfo;
+import com.azure.resourcemanager.commerce.models.OfferTermInfoAutoGenerated;
import com.azure.resourcemanager.commerce.models.ResourceRateCardInfo;
import java.util.Collections;
import java.util.List;
@@ -34,8 +34,8 @@ public Boolean isTaxIncluded() {
return this.innerModel().isTaxIncluded();
}
- public List offerTerms() {
- List inner = this.innerModel().offerTerms();
+ public List offerTerms() {
+ List inner = this.innerModel().offerTerms();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesClientImpl.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesClientImpl.java
index fa34ef6365c2..5c33afd7e8f1 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesClientImpl.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesClientImpl.java
@@ -25,7 +25,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.commerce.fluent.UsageAggregatesClient;
import com.azure.resourcemanager.commerce.fluent.models.UsageAggregationInner;
import com.azure.resourcemanager.commerce.models.AggregationGranularity;
@@ -35,8 +34,6 @@
/** An instance of this class provides access to all the operations defined in UsageAggregatesClient. */
public final class UsageAggregatesClientImpl implements UsageAggregatesClient {
- private final ClientLogger logger = new ClientLogger(UsageAggregatesClientImpl.class);
-
/** The proxy service used to perform REST calls. */
private final UsageAggregatesService service;
@@ -106,7 +103,8 @@ Mono> listNext(
* @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 Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(
@@ -182,7 +180,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 the Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(
@@ -255,7 +254,7 @@ 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 the Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(
@@ -279,7 +278,7 @@ 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 the Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(
@@ -313,7 +312,7 @@ 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 the Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(
@@ -343,7 +342,7 @@ 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 the Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(OffsetDateTime reportedStartTime, OffsetDateTime reportedEndTime) {
@@ -373,7 +372,7 @@ public PagedIterable list(OffsetDateTime reportedStartTim
* @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 Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(
@@ -395,7 +394,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 the Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink) {
@@ -431,7 +431,8 @@ private Mono> listNextSinglePageAsync(Strin
* @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 Get UsageAggregates operation response.
+ * @return the Get UsageAggregates operation response along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink, Context context) {
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesImpl.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesImpl.java
index b39964d707d6..aa7b5c823b85 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesImpl.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageAggregatesImpl.java
@@ -12,11 +12,10 @@
import com.azure.resourcemanager.commerce.models.AggregationGranularity;
import com.azure.resourcemanager.commerce.models.UsageAggregates;
import com.azure.resourcemanager.commerce.models.UsageAggregation;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import java.time.OffsetDateTime;
public final class UsageAggregatesImpl implements UsageAggregates {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageAggregatesImpl.class);
+ private static final ClientLogger LOGGER = new ClientLogger(UsageAggregatesImpl.class);
private final UsageAggregatesClient innerClient;
diff --git a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientBuilder.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientBuilder.java
index 5e0dab77ae5a..ef9f2d6395db 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientBuilder.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientBuilder.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;
@@ -69,34 +68,34 @@ public UsageManagementClientBuilder environment(AzureEnvironment environment) {
}
/*
- * 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 UsageManagementClientBuilder.
*/
- public UsageManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval = defaultPollInterval;
+ public UsageManagementClientBuilder 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 UsageManagementClientBuilder.
*/
- public UsageManagementClientBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
+ public UsageManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
return this;
}
@@ -128,15 +127,12 @@ public UsageManagementClientImpl 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/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientImpl.java b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientImpl.java
index accc517928d3..c3b9b47d38ab 100644
--- a/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientImpl.java
+++ b/sdk/commerce/azure-resourcemanager-commerce/src/main/java/com/azure/resourcemanager/commerce/implementation/UsageManagementClientImpl.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 UsageManagementClientImpl type. */
@ServiceClient(builder = UsageManagementClientBuilder.class)
public final class UsageManagementClientImpl implements UsageManagementClient {
- private final ClientLogger logger = new ClientLogger(UsageManagementClientImpl.class);
-
/**
* It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service
* call.
@@ -183,10 +181,7 @@ public Context getContext() {
* @return the merged context.
*/
public Context mergeContext(Context context) {
- for (Map.Entry