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-consumption] [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-10-01 #13773

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.4 (Unreleased)
## 1.0.0-beta.1 (2022-04-05)

- Azure Resource Manager Consumption client library for Java. This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. 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
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-consumption</artifactId>
<version>1.0.0-beta.3</version>
<version>1.0.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
62 changes: 62 additions & 0 deletions sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@

- [ListByBillingAccount](#lotsoperation_listbybillingaccount)
- [ListByBillingProfile](#lotsoperation_listbybillingprofile)
- [ListByCustomer](#lotsoperation_listbycustomer)

## Marketplaces

- [List](#marketplaces_list)

## Operations

- [List](#operations_list)

## PriceSheet

- [Get](#pricesheet_get)
Expand Down Expand Up @@ -768,6 +773,42 @@ public final class LotsOperationListByBillingProfileSamples {
}
```

### LotsOperation_ListByCustomer

```java
import com.azure.core.util.Context;

/** Samples for LotsOperation ListByCustomer. */
public final class LotsOperationListByCustomerSamples {
/*
* x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomer.json
*/
/**
* Sample code: LotsListByCustomer.
*
* @param manager Entry point to ConsumptionManager.
*/
public static void lotsListByCustomer(com.azure.resourcemanager.consumption.ConsumptionManager manager) {
manager.lotsOperations().listByCustomer("1234:5678", "1234:5678", null, Context.NONE);
}

/*
* x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomerWithFilters.json
*/
/**
* Sample code: LotsListByCustomerWithFilter.
*
* @param manager Entry point to ConsumptionManager.
*/
public static void lotsListByCustomerWithFilter(com.azure.resourcemanager.consumption.ConsumptionManager manager) {
manager
.lotsOperations()
.listByCustomer(
"1234:5678", "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE);
}
}
```

### Marketplaces_List

```java
Expand Down Expand Up @@ -921,6 +962,27 @@ public final class MarketplacesListSamples {
}
```

### Operations_List

```java
import com.azure.core.util.Context;

/** Samples for Operations List. */
public final class OperationsListSamples {
/*
* x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/OperationList.json
*/
/**
* Sample code: PriceSheetForBillingPeriod.
*
* @param manager Entry point to ConsumptionManager.
*/
public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) {
manager.operations().list(Context.NONE);
}
}
```

### PriceSheet_Get

```java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
Expand Down Expand Up @@ -215,9 +215,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;
}
Expand All @@ -239,7 +241,7 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.consumption")
.append("/")
.append("1.0.0-beta.3");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface AggregatedCostsClient {
* @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 management group aggregated cost resource.
* @return a management group aggregated cost resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ManagementGroupAggregatedCostResultInner> getByManagementGroupWithResponse(
Expand Down Expand Up @@ -64,7 +64,7 @@ ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementGroup(
* @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 management group aggregated cost resource.
* @return a management group aggregated cost resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ManagementGroupAggregatedCostResultInner> getForBillingPeriodByManagementGroupWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface BalancesClient {
* @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 balances for a scope by billingAccountId.
* @return the balances for a scope by billingAccountId along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BalanceInner> getByBillingAccountWithResponse(String billingAccountId, Context context);
Expand Down Expand Up @@ -63,7 +63,7 @@ public interface BalancesClient {
* @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 balances for a scope by billing period and billingAccountId.
* @return the balances for a scope by billing period and billingAccountId along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BalanceInner> getForBillingPeriodByBillingAccountWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface BudgetsClient {
* @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 budgets.
* @return result of listing budgets as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BudgetInner> list(String scope);
Expand All @@ -55,7 +55,7 @@ public interface BudgetsClient {
* @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 budgets.
* @return result of listing budgets as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BudgetInner> list(String scope, Context context);
Expand Down Expand Up @@ -104,7 +104,7 @@ public interface BudgetsClient {
* @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 budget for the scope by budget name.
* @return the budget for the scope by budget name along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BudgetInner> getWithResponse(String scope, String budgetName, Context context);
Expand Down Expand Up @@ -159,7 +159,7 @@ public interface BudgetsClient {
* @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 budget resource.
* @return a budget resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BudgetInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -208,7 +208,7 @@ Response<BudgetInner> createOrUpdateWithResponse(
* @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 response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(String scope, String budgetName, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public interface ChargesClient {
* @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 charge summary.
* @return result of listing charge summary along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ChargesListResultInner> listWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface CreditsClient {
* @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 credit summary resource.
* @return a credit summary resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<CreditSummaryInner> getWithResponse(String billingAccountId, String billingProfileId, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface EventsOperationsClient {
* @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 event summary.
* @return result of listing event summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> listByBillingProfile(
Expand All @@ -41,7 +41,7 @@ PagedIterable<EventSummaryInner> listByBillingProfile(
* @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 event summary.
* @return result of listing event summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> listByBillingProfile(
Expand All @@ -55,7 +55,7 @@ PagedIterable<EventSummaryInner> listByBillingProfile(
* @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 event summary.
* @return result of listing event summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> listByBillingAccount(String billingAccountId);
Expand All @@ -72,7 +72,7 @@ PagedIterable<EventSummaryInner> listByBillingProfile(
* @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 event summary.
* @return result of listing event summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> listByBillingAccount(String billingAccountId, String filter, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface LotsOperationsClient {
* @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 lot summary.
* @return result of listing lot summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<LotSummaryInner> listByBillingProfile(String billingAccountId, String billingProfileId);
Expand All @@ -36,7 +36,7 @@ public interface LotsOperationsClient {
* @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 lot summary.
* @return result of listing lot summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<LotSummaryInner> listByBillingProfile(
Expand All @@ -50,7 +50,7 @@ PagedIterable<LotSummaryInner> listByBillingProfile(
* @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 lot summary.
* @return result of listing lot summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<LotSummaryInner> listByBillingAccount(String billingAccountId);
Expand All @@ -67,8 +67,40 @@ PagedIterable<LotSummaryInner> listByBillingProfile(
* @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 lot summary.
* @return result of listing lot summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<LotSummaryInner> listByBillingAccount(String billingAccountId, String filter, Context context);

/**
* Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile
* and a customer. Microsoft Azure consumption commitments are only supported for the billing account scope.
*
* @param billingAccountId BillingAccount ID.
* @param customerId Customer ID.
* @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 lot summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<LotSummaryInner> listByCustomer(String billingAccountId, String customerId);

/**
* Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile
* and a customer. Microsoft Azure consumption commitments are only supported for the billing account scope.
*
* @param billingAccountId BillingAccount ID.
* @param customerId Customer ID.
* @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le',
* 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:).
* @param context The context to associate with this operation.
* @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 lot summary as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<LotSummaryInner> listByCustomer(
String billingAccountId, String customerId, String filter, Context context);
}
Loading