Skip to content

Commit a9b969d

Browse files
author
SDKAuto
committed
CodeGen from PR 18202 in Azure/azure-rest-api-specs
Merge 8c15a5acd231e0cf846e58a99673cf46e95c4cf1 into 96da969aa75e2beb27c3dbc2d69a76900856cc52
1 parent f2dee34 commit a9b969d

File tree

190 files changed

+1195
-1284
lines changed

Some content is hidden

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

190 files changed

+1195
-1284
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.3 (Unreleased)
3+
## 1.0.0-beta.1 (2022-03-14)
4+
5+
- 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).
46

57
### Features Added
68

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-billing</artifactId>
35-
<version>1.0.0-beta.2</version>
35+
<version>1.0.0-beta.3</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

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

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.azure.core.http.HttpClient;
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.HttpPipelineBuilder;
11+
import com.azure.core.http.HttpPipelinePosition;
1112
import com.azure.core.http.policy.AddDatePolicy;
1213
import com.azure.core.http.policy.HttpLogOptions;
1314
import com.azure.core.http.policy.HttpLoggingPolicy;
@@ -69,6 +70,7 @@
6970
import java.util.ArrayList;
7071
import java.util.List;
7172
import java.util.Objects;
73+
import java.util.stream.Collectors;
7274

7375
/** Entry point to BillingManager. Billing client provides access to billing resources for Azure subscriptions. */
7476
public final class BillingManager {
@@ -100,8 +102,6 @@ public final class BillingManager {
100102

101103
private BillingProperties billingProperties;
102104

103-
private Operations operations;
104-
105105
private BillingRoleDefinitions billingRoleDefinitions;
106106

107107
private BillingRoleAssignments billingRoleAssignments;
@@ -114,6 +114,8 @@ public final class BillingManager {
114114

115115
private BillingPeriods billingPeriods;
116116

117+
private Operations operations;
118+
117119
private final BillingManagementClient clientObject;
118120

119121
private BillingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
@@ -152,7 +154,7 @@ public static Configurable configure() {
152154

153155
/** The Configurable allowing configurations to be set. */
154156
public static final class Configurable {
155-
private final ClientLogger logger = new ClientLogger(Configurable.class);
157+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
156158

157159
private HttpClient httpClient;
158160
private HttpLogOptions httpLogOptions;
@@ -226,9 +228,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
226228
* @return the configurable object itself.
227229
*/
228230
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
229-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
231+
this.defaultPollInterval =
232+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
230233
if (this.defaultPollInterval.isNegative()) {
231-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
234+
throw LOGGER
235+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
232236
}
233237
return this;
234238
}
@@ -250,7 +254,7 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof
250254
.append("-")
251255
.append("com.azure.resourcemanager.billing")
252256
.append("/")
253-
.append("1.0.0-beta.2");
257+
.append("1.0.0-beta.1");
254258
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
255259
userAgentBuilder
256260
.append(" (")
@@ -273,11 +277,24 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof
273277
List<HttpPipelinePolicy> policies = new ArrayList<>();
274278
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
275279
policies.add(new RequestIdPolicy());
280+
policies
281+
.addAll(
282+
this
283+
.policies
284+
.stream()
285+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
286+
.collect(Collectors.toList()));
276287
HttpPolicyProviders.addBeforeRetryPolicies(policies);
277288
policies.add(retryPolicy);
278289
policies.add(new AddDatePolicy());
279290
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
280-
policies.addAll(this.policies);
291+
policies
292+
.addAll(
293+
this
294+
.policies
295+
.stream()
296+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
297+
.collect(Collectors.toList()));
281298
HttpPolicyProviders.addAfterRetryPolicies(policies);
282299
policies.add(new HttpLoggingPolicy(httpLogOptions));
283300
HttpPipeline httpPipeline =
@@ -401,14 +418,6 @@ public BillingProperties billingProperties() {
401418
return billingProperties;
402419
}
403420

404-
/** @return Resource collection API of Operations. */
405-
public Operations operations() {
406-
if (this.operations == null) {
407-
this.operations = new OperationsImpl(clientObject.getOperations(), this);
408-
}
409-
return operations;
410-
}
411-
412421
/** @return Resource collection API of BillingRoleDefinitions. */
413422
public BillingRoleDefinitions billingRoleDefinitions() {
414423
if (this.billingRoleDefinitions == null) {
@@ -459,6 +468,14 @@ public BillingPeriods billingPeriods() {
459468
return billingPeriods;
460469
}
461470

471+
/** @return Resource collection API of Operations. */
472+
public Operations operations() {
473+
if (this.operations == null) {
474+
this.operations = new OperationsImpl(clientObject.getOperations(), this);
475+
}
476+
return operations;
477+
}
478+
462479
/**
463480
* @return Wrapped service client BillingManagementClient providing direct access to the underlying auto-generated
464481
* API implementation, based on Azure REST API.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface AddressClient {
3333
* @throws IllegalArgumentException thrown if parameters fail the validation.
3434
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3535
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
36-
* @return result of the address validation.
36+
* @return result of the address validation along with {@link Response}.
3737
*/
3838
@ServiceMethod(returns = ReturnType.SINGLE)
3939
Response<ValidateAddressResponseInner> validateWithResponse(AddressDetails address, Context context);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface AgreementsClient {
2020
* @throws IllegalArgumentException thrown if parameters fail the validation.
2121
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2222
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
23-
* @return result of listing agreements.
23+
* @return result of listing agreements as paginated response with {@link PagedIterable}.
2424
*/
2525
@ServiceMethod(returns = ReturnType.COLLECTION)
2626
PagedIterable<AgreementInner> listByBillingAccount(String billingAccountName);
@@ -34,7 +34,7 @@ public interface AgreementsClient {
3434
* @throws IllegalArgumentException thrown if parameters fail the validation.
3535
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3636
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
37-
* @return result of listing agreements.
37+
* @return result of listing agreements as paginated response with {@link PagedIterable}.
3838
*/
3939
@ServiceMethod(returns = ReturnType.COLLECTION)
4040
PagedIterable<AgreementInner> listByBillingAccount(String billingAccountName, String expand, Context context);
@@ -62,7 +62,7 @@ public interface AgreementsClient {
6262
* @throws IllegalArgumentException thrown if parameters fail the validation.
6363
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
6464
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
65-
* @return an agreement by ID.
65+
* @return an agreement by ID along with {@link Response}.
6666
*/
6767
@ServiceMethod(returns = ReturnType.SINGLE)
6868
Response<AgreementInner> getWithResponse(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public interface AvailableBalancesClient {
3838
* @throws IllegalArgumentException thrown if parameters fail the validation.
3939
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
4040
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
41-
* @return the latest Azure credit balance.
41+
* @return the latest Azure credit balance along with {@link Response}.
4242
*/
4343
@ServiceMethod(returns = ReturnType.SINGLE)
4444
Response<AvailableBalanceInner> getWithResponse(

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public interface BillingAccountsClient {
2222
*
2323
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2424
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
25-
* @return the list of billing accounts.
25+
* @return the list of billing accounts as paginated response with {@link PagedIterable}.
2626
*/
2727
@ServiceMethod(returns = ReturnType.COLLECTION)
2828
PagedIterable<BillingAccountInner> list();
@@ -35,7 +35,7 @@ public interface BillingAccountsClient {
3535
* @throws IllegalArgumentException thrown if parameters fail the validation.
3636
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3737
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
38-
* @return the list of billing accounts.
38+
* @return the list of billing accounts as paginated response with {@link PagedIterable}.
3939
*/
4040
@ServiceMethod(returns = ReturnType.COLLECTION)
4141
PagedIterable<BillingAccountInner> list(String expand, Context context);
@@ -61,7 +61,7 @@ public interface BillingAccountsClient {
6161
* @throws IllegalArgumentException thrown if parameters fail the validation.
6262
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
6363
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
64-
* @return a billing account by its ID.
64+
* @return a billing account by its ID along with {@link Response}.
6565
*/
6666
@ServiceMethod(returns = ReturnType.SINGLE)
6767
Response<BillingAccountInner> getWithResponse(String billingAccountName, String expand, Context context);
@@ -75,7 +75,7 @@ public interface BillingAccountsClient {
7575
* @throws IllegalArgumentException thrown if parameters fail the validation.
7676
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
7777
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
78-
* @return a billing account.
78+
* @return the {@link SyncPoller} for polling of a billing account.
7979
*/
8080
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
8181
SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
@@ -91,7 +91,7 @@ SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
9191
* @throws IllegalArgumentException thrown if parameters fail the validation.
9292
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
9393
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
94-
* @return a billing account.
94+
* @return the {@link SyncPoller} for polling of a billing account.
9595
*/
9696
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
9797
SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
@@ -134,7 +134,8 @@ SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
134134
* @throws IllegalArgumentException thrown if parameters fail the validation.
135135
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
136136
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
137-
* @return the list of invoice section properties with create subscription permission.
137+
* @return the list of invoice section properties with create subscription permission as paginated response with
138+
* {@link PagedIterable}.
138139
*/
139140
@ServiceMethod(returns = ReturnType.COLLECTION)
140141
PagedIterable<InvoiceSectionWithCreateSubPermissionInner> listInvoiceSectionsByCreateSubscriptionPermission(
@@ -149,7 +150,8 @@ PagedIterable<InvoiceSectionWithCreateSubPermissionInner> listInvoiceSectionsByC
149150
* @throws IllegalArgumentException thrown if parameters fail the validation.
150151
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
151152
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
152-
* @return the list of invoice section properties with create subscription permission.
153+
* @return the list of invoice section properties with create subscription permission as paginated response with
154+
* {@link PagedIterable}.
153155
*/
154156
@ServiceMethod(returns = ReturnType.COLLECTION)
155157
PagedIterable<InvoiceSectionWithCreateSubPermissionInner> listInvoiceSectionsByCreateSubscriptionPermission(

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ public interface BillingManagementClient {
135135
*/
136136
BillingPropertiesClient getBillingProperties();
137137

138-
/**
139-
* Gets the OperationsClient object to access its operations.
140-
*
141-
* @return the OperationsClient object.
142-
*/
143-
OperationsClient getOperations();
144-
145138
/**
146139
* Gets the BillingRoleDefinitionsClient object to access its operations.
147140
*
@@ -183,4 +176,11 @@ public interface BillingManagementClient {
183176
* @return the BillingPeriodsClient object.
184177
*/
185178
BillingPeriodsClient getBillingPeriods();
179+
180+
/**
181+
* Gets the OperationsClient object to access its operations.
182+
*
183+
* @return the OperationsClient object.
184+
*/
185+
OperationsClient getOperations();
186186
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface BillingPeriodsClient {
2020
*
2121
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2222
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
23-
* @return result of listing billing periods.
23+
* @return result of listing billing periods as paginated response with {@link PagedIterable}.
2424
*/
2525
@ServiceMethod(returns = ReturnType.COLLECTION)
2626
PagedIterable<BillingPeriodInner> list();
@@ -40,7 +40,7 @@ public interface BillingPeriodsClient {
4040
* @throws IllegalArgumentException thrown if parameters fail the validation.
4141
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
4242
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
43-
* @return result of listing billing periods.
43+
* @return result of listing billing periods as paginated response with {@link PagedIterable}.
4444
*/
4545
@ServiceMethod(returns = ReturnType.COLLECTION)
4646
PagedIterable<BillingPeriodInner> list(String filter, String skiptoken, Integer top, Context context);
@@ -67,7 +67,7 @@ public interface BillingPeriodsClient {
6767
* @throws IllegalArgumentException thrown if parameters fail the validation.
6868
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
6969
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
70-
* @return a named billing period.
70+
* @return a named billing period along with {@link Response}.
7171
*/
7272
@ServiceMethod(returns = ReturnType.SINGLE)
7373
Response<BillingPeriodInner> getWithResponse(String billingPeriodName, Context context);

0 commit comments

Comments
 (0)