Skip to content

Commit 22b62cf

Browse files
author
SDKAuto
committed
CodeGen from PR 33749 in Azure/azure-rest-api-specs
Merge 652da708cdf40d6943cbf8e9e55c4c4c47093ff8 into e6f0bc6d77a1a4f7e7ababb4a7c42356551e95f0
1 parent 61f4f9b commit 22b62cf

File tree

321 files changed

+2569
-15087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+2569
-15087
lines changed

sdk/billing/azure-resourcemanager-billing/CHANGELOG.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# Release History
22

3-
## 1.1.0-beta.1 (Unreleased)
3+
## 1.0.0-beta.1 (2025-04-21)
44

5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
5+
- Azure Resource Manager Billing client library for Java. This package contains Microsoft Azure SDK for Billing Management SDK. Billing Client. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
126

137
## 1.0.0 (2024-09-05)
148

sdk/billing/azure-resourcemanager-billing/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
5252
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
5353

5454
```java
55-
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
55+
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
5656
TokenCredential credential = new DefaultAzureCredentialBuilder()
5757
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
5858
.build();
5959
BillingManager manager = BillingManager
6060
.authenticate(credential, profile);
6161
```
6262

63-
The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
63+
The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
6464

6565
See [Authentication][authenticate] for more options.
6666

@@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
100100
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
101101
[coc]: https://opensource.microsoft.com/codeofconduct/
102102
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
103-
104-

sdk/billing/azure-resourcemanager-billing/SAMPLE.md

Lines changed: 2529 additions & 2529 deletions
Large diffs are not rendered by default.

sdk/billing/azure-resourcemanager-billing/pom.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,9 @@
4545
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4646
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
4747
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
48+
<revapi.skip>true</revapi.skip>
4849
</properties>
4950
<dependencies>
50-
<dependency>
51-
<groupId>com.azure</groupId>
52-
<artifactId>azure-json</artifactId>
53-
<version>1.5.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
54-
</dependency>
5551
<dependency>
5652
<groupId>com.azure</groupId>
5753
<artifactId>azure-core</artifactId>
@@ -62,6 +58,11 @@
6258
<artifactId>azure-core-management</artifactId>
6359
<version>1.17.0</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
6460
</dependency>
61+
<dependency>
62+
<groupId>com.azure</groupId>
63+
<artifactId>azure-json</artifactId>
64+
<version>1.5.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
65+
</dependency>
6566
<dependency>
6667
<groupId>com.azure</groupId>
6768
<artifactId>azure-core-test</artifactId>

sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
1313
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
14-
import com.azure.core.http.policy.HttpLoggingPolicy;
14+
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
1515
import com.azure.core.http.policy.HttpLogOptions;
16+
import com.azure.core.http.policy.HttpLoggingPolicy;
1617
import com.azure.core.http.policy.HttpPipelinePolicy;
1718
import com.azure.core.http.policy.HttpPolicyProviders;
1819
import com.azure.core.http.policy.RequestIdPolicy;
1920
import com.azure.core.http.policy.RetryOptions;
2021
import com.azure.core.http.policy.RetryPolicy;
2122
import com.azure.core.http.policy.UserAgentPolicy;
22-
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
2323
import com.azure.core.management.profile.AzureProfile;
2424
import com.azure.core.util.Configuration;
25+
import com.azure.core.util.CoreUtils;
2526
import com.azure.core.util.logging.ClientLogger;
2627
import com.azure.resourcemanager.billing.fluent.BillingManagementClient;
2728
import com.azure.resourcemanager.billing.implementation.AddressImpl;
@@ -71,8 +72,8 @@
7172
import com.azure.resourcemanager.billing.models.Customers;
7273
import com.azure.resourcemanager.billing.models.Departments;
7374
import com.azure.resourcemanager.billing.models.EnrollmentAccounts;
74-
import com.azure.resourcemanager.billing.models.Invoices;
7575
import com.azure.resourcemanager.billing.models.InvoiceSections;
76+
import com.azure.resourcemanager.billing.models.Invoices;
7677
import com.azure.resourcemanager.billing.models.Operations;
7778
import com.azure.resourcemanager.billing.models.PartnerTransfers;
7879
import com.azure.resourcemanager.billing.models.PaymentMethods;
@@ -89,6 +90,7 @@
8990
import java.time.temporal.ChronoUnit;
9091
import java.util.ArrayList;
9192
import java.util.List;
93+
import java.util.Map;
9294
import java.util.Objects;
9395
import java.util.stream.Collectors;
9496

@@ -209,6 +211,9 @@ public static Configurable configure() {
209211
*/
210212
public static final class Configurable {
211213
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
214+
private static final String SDK_VERSION = "version";
215+
private static final Map<String, String> PROPERTIES
216+
= CoreUtils.getProperties("azure-resourcemanager-billing.properties");
212217

213218
private HttpClient httpClient;
214219
private HttpLogOptions httpLogOptions;
@@ -316,12 +321,14 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof
316321
Objects.requireNonNull(credential, "'credential' cannot be null.");
317322
Objects.requireNonNull(profile, "'profile' cannot be null.");
318323

324+
String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
325+
319326
StringBuilder userAgentBuilder = new StringBuilder();
320327
userAgentBuilder.append("azsdk-java")
321328
.append("-")
322329
.append("com.azure.resourcemanager.billing")
323330
.append("/")
324-
.append("1.0.0");
331+
.append(clientVersion);
325332
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
326333
userAgentBuilder.append(" (")
327334
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -354,7 +361,7 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof
354361
HttpPolicyProviders.addBeforeRetryPolicies(policies);
355362
policies.add(retryPolicy);
356363
policies.add(new AddDatePolicy());
357-
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
364+
policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
358365
policies.addAll(this.policies.stream()
359366
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
360367
.collect(Collectors.toList()));

sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionAliasInner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ public NextBillingCycleDetails nextBillingCycleDetails() {
475475

476476
/**
477477
* Get the offerId property: The offer ID for the subscription. This field is only available for the Microsoft
478-
* Online Services Program billing accounts.
478+
* Online Services Program billing accounts or billing accounts with agreement type Enterprise Agreement.
479479
*
480480
* @return the offerId value.
481481
*/

sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionAliasProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public final class BillingSubscriptionAliasProperties extends BillingSubscriptio
117117

118118
/*
119119
* The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing
120-
* accounts.
120+
* accounts or billing accounts with agreement type Enterprise Agreement.
121121
*/
122122
private String offerId;
123123

@@ -367,7 +367,7 @@ public String productCategory() {
367367

368368
/**
369369
* Get the offerId property: The offer ID for the subscription. This field is only available for the Microsoft
370-
* Online Services Program billing accounts.
370+
* Online Services Program billing accounts or billing accounts with agreement type Enterprise Agreement.
371371
*
372372
* @return the offerId value.
373373
*/

sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public NextBillingCycleDetails nextBillingCycleDetails() {
446446

447447
/**
448448
* Get the offerId property: The offer ID for the subscription. This field is only available for the Microsoft
449-
* Online Services Program billing accounts.
449+
* Online Services Program billing accounts or billing accounts with agreement type Enterprise Agreement.
450450
*
451451
* @return the offerId value.
452452
*/

sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public class BillingSubscriptionProperties implements JsonSerializable<BillingSu
150150

151151
/*
152152
* The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing
153-
* accounts.
153+
* accounts or billing accounts with agreement type Enterprise Agreement.
154154
*/
155155
private String offerId;
156156

@@ -727,7 +727,7 @@ BillingSubscriptionProperties withNextBillingCycleDetails(NextBillingCycleDetail
727727

728728
/**
729729
* Get the offerId property: The offer ID for the subscription. This field is only available for the Microsoft
730-
* Online Services Program billing accounts.
730+
* Online Services Program billing accounts or billing accounts with agreement type Enterprise Agreement.
731731
*
732732
* @return the offerId value.
733733
*/
@@ -737,7 +737,7 @@ public String offerId() {
737737

738738
/**
739739
* Set the offerId property: The offer ID for the subscription. This field is only available for the Microsoft
740-
* Online Services Program billing accounts.
740+
* Online Services Program billing accounts or billing accounts with agreement type Enterprise Agreement.
741741
*
742742
* @param offerId the offerId value to set.
743743
* @return the BillingSubscriptionProperties object itself.

sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import com.azure.core.management.AzureEnvironment;
1414
import com.azure.core.management.exception.ManagementError;
1515
import com.azure.core.management.exception.ManagementException;
16-
import com.azure.core.management.polling.PollerFactory;
1716
import com.azure.core.management.polling.PollResult;
17+
import com.azure.core.management.polling.PollerFactory;
1818
import com.azure.core.util.Context;
1919
import com.azure.core.util.CoreUtils;
2020
import com.azure.core.util.logging.ClientLogger;
@@ -40,8 +40,8 @@
4040
import com.azure.resourcemanager.billing.fluent.CustomersClient;
4141
import com.azure.resourcemanager.billing.fluent.DepartmentsClient;
4242
import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient;
43-
import com.azure.resourcemanager.billing.fluent.InvoicesClient;
4443
import com.azure.resourcemanager.billing.fluent.InvoiceSectionsClient;
44+
import com.azure.resourcemanager.billing.fluent.InvoicesClient;
4545
import com.azure.resourcemanager.billing.fluent.OperationsClient;
4646
import com.azure.resourcemanager.billing.fluent.PartnerTransfersClient;
4747
import com.azure.resourcemanager.billing.fluent.PaymentMethodsClient;

0 commit comments

Comments
 (0)