diff --git a/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md b/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md index 817c796a5aca5..4daf02a7f9c85 100644 --- a/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md +++ b/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-01-05) + +- Azure Resource Manager Billing client library for Java. This package contains Microsoft Azure SDK for Billing Management SDK. Billing client provides access to billing resources for Azure subscriptions. Package tag package-2020-05. 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/billing/azure-resourcemanager-billing/README.md b/sdk/billing/azure-resourcemanager-billing/README.md index 7e19f65c2df02..1b6e199cc2500 100644 --- a/sdk/billing/azure-resourcemanager-billing/README.md +++ b/sdk/billing/azure-resourcemanager-billing/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-billing - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java index 2743dee0aa9fe..5a5b6fadac701 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java @@ -8,6 +8,7 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; @@ -69,6 +70,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to BillingManager. Billing client provides access to billing resources for Azure subscriptions. */ public final class BillingManager { @@ -250,7 +252,7 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof .append("-") .append("com.azure.resourcemanager.billing") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -273,11 +275,24 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); 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 = diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java index f139e118ab3be..1e2384a73174b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java @@ -514,7 +514,7 @@ private PollerFlux, BillingAccountInner> beginUp this.client.getHttpPipeline(), BillingAccountInner.class, BillingAccountInner.class, - Context.NONE); + this.client.getContext()); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java index 5b0e499c27ed7..282bb67299145 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java @@ -584,7 +584,7 @@ private PollerFlux, BillingProfileInner> beginCr this.client.getHttpPipeline(), BillingProfileInner.class, BillingProfileInner.class, - Context.NONE); + this.client.getContext()); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java index 93a193a3e84f3..6e597f7e54ddf 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java @@ -1331,7 +1331,7 @@ private PollerFlux, BillingSubscriptionInne this.client.getHttpPipeline(), BillingSubscriptionInner.class, BillingSubscriptionInner.class, - Context.NONE); + this.client.getContext()); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java index ddbcf36b8cab9..21e0ac1cfb23b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java @@ -602,7 +602,7 @@ private PollerFlux, InvoiceSectionInner> beginCr this.client.getHttpPipeline(), InvoiceSectionInner.class, InvoiceSectionInner.class, - Context.NONE); + this.client.getContext()); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java index 3580b77b2e361..62c8e518d6654 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java @@ -996,7 +996,11 @@ private PollerFlux, DownloadUrlInner> beginDownload return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DownloadUrlInner.class, + DownloadUrlInner.class, + this.client.getContext()); } /** @@ -1234,7 +1238,11 @@ private PollerFlux, DownloadUrlInner> beginDownload return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DownloadUrlInner.class, + DownloadUrlInner.class, + this.client.getContext()); } /** @@ -1801,7 +1809,11 @@ private PollerFlux, DownloadUrlInner> beginDownload return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DownloadUrlInner.class, + DownloadUrlInner.class, + this.client.getContext()); } /** @@ -2024,7 +2036,11 @@ private Mono>> downloadMultipleBillingSubscriptionInvo return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DownloadUrlInner.class, + DownloadUrlInner.class, + this.client.getContext()); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java index d4b590e7e985f..b195e0fa4173e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java @@ -28,6 +28,12 @@ public final class InvoiceListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * Total number of records. + */ + @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalCount; + /** * Get the value property: The list of invoices. * @@ -46,6 +52,15 @@ public String nextLink() { return this.nextLink; } + /** + * Get the totalCount property: Total number of records. + * + * @return the totalCount value. + */ + public Integer totalCount() { + return this.totalCount; + } + /** * Validates the instance. *