Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-resourcemanager-billing] Dev/markonikolic/aliasswagger #12908

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/billing/azure-resourcemanager-billing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-02-25)

- 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

Expand Down
2 changes: 1 addition & 1 deletion sdk/billing/azure-resourcemanager-billing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-billing</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -100,8 +102,6 @@ public final class BillingManager {

private BillingProperties billingProperties;

private Operations operations;

private BillingRoleDefinitions billingRoleDefinitions;

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

private BillingPeriods billingPeriods;

private Operations operations;

private final BillingManagementClient clientObject;

private BillingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Expand Down Expand Up @@ -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(" (")
Expand All @@ -273,11 +275,24 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof
List<HttpPipelinePolicy> 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 =
Expand Down Expand Up @@ -401,14 +416,6 @@ public BillingProperties billingProperties() {
return billingProperties;
}

/** @return Resource collection API of Operations. */
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of BillingRoleDefinitions. */
public BillingRoleDefinitions billingRoleDefinitions() {
if (this.billingRoleDefinitions == null) {
Expand Down Expand Up @@ -459,6 +466,14 @@ public BillingPeriods billingPeriods() {
return billingPeriods;
}

/** @return Resource collection API of Operations. */
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/**
* @return Wrapped service client BillingManagementClient providing direct access to the underlying auto-generated
* API implementation, based on Azure REST API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface AddressClient {
* @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 result of the address validation.
* @return result of the address validation along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ValidateAddressResponseInner> validateWithResponse(AddressDetails address, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface AgreementsClient {
* @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 result of listing agreements.
* @return result of listing agreements as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AgreementInner> listByBillingAccount(String billingAccountName);
Expand All @@ -34,7 +34,7 @@ public interface AgreementsClient {
* @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 result of listing agreements.
* @return result of listing agreements as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AgreementInner> listByBillingAccount(String billingAccountName, String expand, Context context);
Expand Down Expand Up @@ -62,7 +62,7 @@ public interface AgreementsClient {
* @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 agreement by ID.
* @return an agreement by ID along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AgreementInner> getWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface AvailableBalancesClient {
* @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 latest Azure credit balance.
* @return the latest Azure credit balance along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AvailableBalanceInner> getWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface BillingAccountsClient {
*
* @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 list of billing accounts.
* @return the list of billing accounts as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BillingAccountInner> list();
Expand All @@ -35,7 +35,7 @@ public interface BillingAccountsClient {
* @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 list of billing accounts.
* @return the list of billing accounts as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BillingAccountInner> list(String expand, Context context);
Expand All @@ -61,7 +61,7 @@ public interface BillingAccountsClient {
* @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 billing account by its ID.
* @return a billing account by its ID along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BillingAccountInner> getWithResponse(String billingAccountName, String expand, Context context);
Expand All @@ -75,7 +75,7 @@ public interface BillingAccountsClient {
* @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 billing account.
* @return the {@link SyncPoller} for polling of a billing account.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
Expand All @@ -91,7 +91,7 @@ SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
* @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 billing account.
* @return the {@link SyncPoller} for polling of a billing account.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
Expand Down Expand Up @@ -134,7 +134,8 @@ SyncPoller<PollResult<BillingAccountInner>, BillingAccountInner> beginUpdate(
* @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 list of invoice section properties with create subscription permission.
* @return the list of invoice section properties with create subscription permission as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<InvoiceSectionWithCreateSubPermissionInner> listInvoiceSectionsByCreateSubscriptionPermission(
Expand All @@ -149,7 +150,8 @@ PagedIterable<InvoiceSectionWithCreateSubPermissionInner> listInvoiceSectionsByC
* @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 list of invoice section properties with create subscription permission.
* @return the list of invoice section properties with create subscription permission as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<InvoiceSectionWithCreateSubPermissionInner> listInvoiceSectionsByCreateSubscriptionPermission(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ public interface BillingManagementClient {
*/
BillingPropertiesClient getBillingProperties();

/**
* Gets the OperationsClient object to access its operations.
*
* @return the OperationsClient object.
*/
OperationsClient getOperations();

/**
* Gets the BillingRoleDefinitionsClient object to access its operations.
*
Expand Down Expand Up @@ -183,4 +176,11 @@ public interface BillingManagementClient {
* @return the BillingPeriodsClient object.
*/
BillingPeriodsClient getBillingPeriods();

/**
* Gets the OperationsClient object to access its operations.
*
* @return the OperationsClient object.
*/
OperationsClient getOperations();
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface BillingPeriodsClient {
*
* @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 result of listing billing periods.
* @return result of listing billing periods as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BillingPeriodInner> list();
Expand All @@ -40,7 +40,7 @@ public interface BillingPeriodsClient {
* @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 result of listing billing periods.
* @return result of listing billing periods as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BillingPeriodInner> list(String filter, String skiptoken, Integer top, Context context);
Expand All @@ -67,7 +67,7 @@ public interface BillingPeriodsClient {
* @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 named billing period.
* @return a named billing period along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BillingPeriodInner> getWithResponse(String billingPeriodName, Context context);
Expand Down
Loading