diff --git a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md index fb83033bcc4e5..ab9db474dd812 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md +++ b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-05-18) +- 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-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-13) diff --git a/sdk/consumption/azure-resourcemanager-consumption/README.md b/sdk/consumption/azure-resourcemanager-consumption/README.md index 24e10b59cf865..dacf14ec53839 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/README.md +++ b/sdk/consumption/azure-resourcemanager-consumption/README.md @@ -2,7 +2,7 @@ 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-2019-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +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-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-consumption - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/consumption/azure-resourcemanager-consumption/pom.xml b/sdk/consumption/azure-resourcemanager-consumption/pom.xml index c968c37dd0d6c..4471a529fef50 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/pom.xml +++ b/sdk/consumption/azure-resourcemanager-consumption/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for Consumption Management - This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2019-10. + This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-05. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java index 641cd0d201da6..4a9bba8b64c61 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java @@ -15,27 +15,21 @@ public interface CreditsClient { /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile 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 a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CreditSummaryInner get(String scope); + CreditSummaryInner get(String billingAccountId, String billingProfileId); /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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. @@ -43,5 +37,5 @@ public interface CreditsClient { * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, Context context); + Response getWithResponse(String billingAccountId, String billingProfileId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java index 288eba9cff343..7591c8b7840b3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java @@ -13,33 +13,30 @@ /** An instance of this class provides access to all the operations defined in EventsOperationsClient. */ public interface EventsOperationsClient { /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String startDate, String endDate, String scope); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate); /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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. @@ -47,5 +44,36 @@ public interface EventsOperationsClient { * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String startDate, String endDate, String scope, Context context); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount 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 event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java index f168f2b331709..6c7db7249652f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java @@ -13,29 +13,25 @@ /** An instance of this class provides access to all the operations defined in LotsOperationsClient. */ public interface LotsOperationsClient { /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId); /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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. @@ -43,5 +39,36 @@ public interface LotsOperationsClient { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, Context context); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java index 840cb18b61d47..083b16f7e65c5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java @@ -13,19 +13,17 @@ /** An instance of this class provides access to all the operations defined in PriceSheetsClient. */ public interface PriceSheetsClient { /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) PriceSheetResultInner get(); /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -37,7 +35,7 @@ public interface PriceSheetsClient { * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String expand, String skiptoken, Integer top, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java index a9742765369c7..99f9b7299835a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java @@ -20,13 +20,13 @@ public interface ReservationRecommendationDetailsClient { /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -39,18 +39,18 @@ public interface ReservationRecommendationDetailsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) ReservationRecommendationDetailsModelInner get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product); /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -64,8 +64,8 @@ ReservationRecommendationDetailsModelInner get( */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java index c4ddf96fa00a8..6c0dbc7e5e9d8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java @@ -115,7 +115,7 @@ public class BalanceInner extends ProxyResource { private List adjustmentDetails; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -274,7 +274,7 @@ public List adjustmentDetails() { } /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java index c97cdbff92b46..014b133cefc31 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java @@ -10,7 +10,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; -import com.azure.resourcemanager.consumption.models.Reseller; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -21,18 +20,6 @@ public class CreditSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryInner.class); - /* - * Credit Currency - */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - /* * Summary of balances associated with this credit summary. */ @@ -58,13 +45,7 @@ public class CreditSummaryInner extends ProxyResource { private Amount pendingEligibleCharges; /* - * Reseller details. - */ - @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; - - /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -75,24 +56,6 @@ public class CreditSummaryInner extends ProxyResource { @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) private Map tags; - /** - * Get the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - public String creditCurrency() { - return this.creditCurrency; - } - - /** - * Get the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - public String billingCurrency() { - return this.billingCurrency; - } - /** * Get the balanceSummary property: Summary of balances associated with this credit summary. * @@ -130,16 +93,7 @@ public Amount pendingEligibleCharges() { } /** - * Get the reseller property: Reseller details. - * - * @return the reseller value. - */ - public Reseller reseller() { - return this.reseller; - } - - /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ @@ -174,8 +128,5 @@ public void validate() { if (pendingEligibleCharges() != null) { pendingEligibleCharges().validate(); } - if (reseller() != null) { - reseller().validate(); - } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java index 61d57e52f495e..e8ad337620768 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java @@ -9,9 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; -import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.EventType; -import com.azure.resourcemanager.consumption.models.Reseller; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -24,109 +22,94 @@ public class EventSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSummaryInner.class); /* - * Credit Currency - */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Transaction date. + * The date of the event. */ @JsonProperty(value = "properties.transactionDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime transactionDate; /* - * Transaction description. + * The description of the event. */ @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) private String description; /* - * New Credit. + * The amount of new credit or commitment for NewCredit or SettleCharges + * event. */ @JsonProperty(value = "properties.newCredit", access = JsonProperty.Access.WRITE_ONLY) private Amount newCredit; /* - * Current balance. - */ - @JsonProperty(value = "properties.newCreditInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate newCreditInBillingCurrency; - - /* - * Adjustments amount. + * The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. */ @JsonProperty(value = "properties.adjustments", access = JsonProperty.Access.WRITE_ONLY) private Amount adjustments; /* - * Current balance. - */ - @JsonProperty(value = "properties.adjustmentsInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate adjustmentsInBillingCurrency; - - /* - * Credit expired. + * The amount of expired credit or commitment for NewCredit or + * SettleCharges event. */ @JsonProperty(value = "properties.creditExpired", access = JsonProperty.Access.WRITE_ONLY) private Amount creditExpired; /* - * Current balance. + * The amount of charges for events of type SettleCharges and + * PendingEligibleCharges. */ - @JsonProperty(value = "properties.creditExpiredInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate creditExpiredInBillingCurrency; + @JsonProperty(value = "properties.charges", access = JsonProperty.Access.WRITE_ONLY) + private Amount charges; /* - * Charges amount. + * The balance after the event. */ - @JsonProperty(value = "properties.charges", access = JsonProperty.Access.WRITE_ONLY) - private Amount charges; + @JsonProperty(value = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Amount closedBalance; /* - * Current balance. + * Identifies the type of the event. */ - @JsonProperty(value = "properties.chargesInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate chargesInBillingCurrency; + @JsonProperty(value = "properties.eventType") + private EventType eventType; /* - * Closed balance. + * The number which uniquely identifies the invoice on which the event was + * billed. This will be empty for unbilled events. */ - @JsonProperty(value = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) - private Amount closedBalance; + @JsonProperty(value = "properties.invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceNumber; /* - * Current balance. + * The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type + * MicrosoftCustomerAgreement. */ - @JsonProperty(value = "properties.closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate closedBalanceInBillingCurrency; + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; /* - * The type of event. + * The display name of the billing profile for which the event happened. + * The property is only available for billing account of type + * MicrosoftCustomerAgreement. */ - @JsonProperty(value = "properties.eventType") - private EventType eventType; + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* - * Invoice number. + * The ID that uniquely identifies the lot for which the event happened. */ - @JsonProperty(value = "properties.invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceNumber; + @JsonProperty(value = "properties.lotId", access = JsonProperty.Access.WRITE_ONLY) + private String lotId; /* - * Reseller details. + * Identifies the source of the lot for which the event happened. */ - @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; + @JsonProperty(value = "properties.lotSource", access = JsonProperty.Access.WRITE_ONLY) + private String lotSource; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -138,25 +121,7 @@ public class EventSummaryInner extends ProxyResource { private Map tags; /** - * Get the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - public String creditCurrency() { - return this.creditCurrency; - } - - /** - * Get the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - public String billingCurrency() { - return this.billingCurrency; - } - - /** - * Get the transactionDate property: Transaction date. + * Get the transactionDate property: The date of the event. * * @return the transactionDate value. */ @@ -165,7 +130,7 @@ public OffsetDateTime transactionDate() { } /** - * Get the description property: Transaction description. + * Get the description property: The description of the event. * * @return the description value. */ @@ -174,7 +139,7 @@ public String description() { } /** - * Get the newCredit property: New Credit. + * Get the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. * * @return the newCredit value. */ @@ -183,16 +148,8 @@ public Amount newCredit() { } /** - * Get the newCreditInBillingCurrency property: Current balance. - * - * @return the newCreditInBillingCurrency value. - */ - public AmountWithExchangeRate newCreditInBillingCurrency() { - return this.newCreditInBillingCurrency; - } - - /** - * Get the adjustments property: Adjustments amount. + * Get the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. * * @return the adjustments value. */ @@ -201,16 +158,7 @@ public Amount adjustments() { } /** - * Get the adjustmentsInBillingCurrency property: Current balance. - * - * @return the adjustmentsInBillingCurrency value. - */ - public AmountWithExchangeRate adjustmentsInBillingCurrency() { - return this.adjustmentsInBillingCurrency; - } - - /** - * Get the creditExpired property: Credit expired. + * Get the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. * * @return the creditExpired value. */ @@ -219,16 +167,7 @@ public Amount creditExpired() { } /** - * Get the creditExpiredInBillingCurrency property: Current balance. - * - * @return the creditExpiredInBillingCurrency value. - */ - public AmountWithExchangeRate creditExpiredInBillingCurrency() { - return this.creditExpiredInBillingCurrency; - } - - /** - * Get the charges property: Charges amount. + * Get the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. * * @return the charges value. */ @@ -237,16 +176,7 @@ public Amount charges() { } /** - * Get the chargesInBillingCurrency property: Current balance. - * - * @return the chargesInBillingCurrency value. - */ - public AmountWithExchangeRate chargesInBillingCurrency() { - return this.chargesInBillingCurrency; - } - - /** - * Get the closedBalance property: Closed balance. + * Get the closedBalance property: The balance after the event. * * @return the closedBalance value. */ @@ -255,16 +185,7 @@ public Amount closedBalance() { } /** - * Get the closedBalanceInBillingCurrency property: Current balance. - * - * @return the closedBalanceInBillingCurrency value. - */ - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.closedBalanceInBillingCurrency; - } - - /** - * Get the eventType property: The type of event. + * Get the eventType property: Identifies the type of the event. * * @return the eventType value. */ @@ -273,7 +194,7 @@ public EventType eventType() { } /** - * Set the eventType property: The type of event. + * Set the eventType property: Identifies the type of the event. * * @param eventType the eventType value to set. * @return the EventSummaryInner object itself. @@ -284,7 +205,8 @@ public EventSummaryInner withEventType(EventType eventType) { } /** - * Get the invoiceNumber property: Invoice number. + * Get the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. + * This will be empty for unbilled events. * * @return the invoiceNumber value. */ @@ -293,16 +215,45 @@ public String invoiceNumber() { } /** - * Get the reseller property: Reseller details. + * Get the billingProfileId property: The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the reseller value. + * @return the billingProfileId value. */ - public Reseller reseller() { - return this.reseller; + public String billingProfileId() { + return this.billingProfileId; } /** - * Get the etag property: Resource etag. + * Get the billingProfileDisplayName property: The display name of the billing profile for which the event happened. + * The property is only available for billing account of type MicrosoftCustomerAgreement. + * + * @return the billingProfileDisplayName value. + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get the lotId property: The ID that uniquely identifies the lot for which the event happened. + * + * @return the lotId value. + */ + public String lotId() { + return this.lotId; + } + + /** + * Get the lotSource property: Identifies the source of the lot for which the event happened. + * + * @return the lotSource value. + */ + public String lotSource() { + return this.lotSource; + } + + /** + * Get the etag property: The etag for the resource. * * @return the etag value. */ @@ -328,35 +279,17 @@ public void validate() { if (newCredit() != null) { newCredit().validate(); } - if (newCreditInBillingCurrency() != null) { - newCreditInBillingCurrency().validate(); - } if (adjustments() != null) { adjustments().validate(); } - if (adjustmentsInBillingCurrency() != null) { - adjustmentsInBillingCurrency().validate(); - } if (creditExpired() != null) { creditExpired().validate(); } - if (creditExpiredInBillingCurrency() != null) { - creditExpiredInBillingCurrency().validate(); - } if (charges() != null) { charges().validate(); } - if (chargesInBillingCurrency() != null) { - chargesInBillingCurrency().validate(); - } if (closedBalance() != null) { closedBalance().validate(); } - if (closedBalanceInBillingCurrency() != null) { - closedBalanceInBillingCurrency().validate(); - } - if (reseller() != null) { - reseller().validate(); - } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java index 2815eea54078c..0b3555b00f3f9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java @@ -64,7 +64,7 @@ public class ForecastInner extends ProxyResource { private List confidenceLevels; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -157,7 +157,7 @@ public List confidenceLevels() { } /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java index a0ebd141f5a41..80a8ef1002383 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java @@ -9,9 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; -import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.LotSource; -import com.azure.resourcemanager.consumption.models.Reseller; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -24,73 +22,56 @@ public class LotSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LotSummaryInner.class); /* - * Credit Currency - */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Original amount. + * The original amount of a lot. */ @JsonProperty(value = "properties.originalAmount", access = JsonProperty.Access.WRITE_ONLY) private Amount originalAmount; /* - * Current balance. - */ - @JsonProperty(value = "properties.originalAmountInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate originalAmountInBillingCurrency; - - /* - * Closed balance. + * The balance as of the last invoice. */ @JsonProperty(value = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) private Amount closedBalance; /* - * Current balance. - */ - @JsonProperty(value = "properties.closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate closedBalanceInBillingCurrency; - - /* - * Lot source. + * The source of the lot. */ @JsonProperty(value = "properties.source", access = JsonProperty.Access.WRITE_ONLY) private LotSource source; /* - * Start date. + * The date when the lot became effective. */ @JsonProperty(value = "properties.startDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime startDate; /* - * Expiration date. + * The expiration date of a lot. */ @JsonProperty(value = "properties.expirationDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expirationDate; /* - * PO number. + * The po number of the invoice on which the lot was added. This property + * is not available for ConsumptionCommitment lots. */ @JsonProperty(value = "properties.poNumber", access = JsonProperty.Access.WRITE_ONLY) private String poNumber; /* - * Reseller details. + * The date when the lot was added. + */ + @JsonProperty(value = "properties.purchaseDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime purchaseDate; + + /* + * The status of the lot. */ - @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -102,25 +83,7 @@ public class LotSummaryInner extends ProxyResource { private Map tags; /** - * Get the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - public String creditCurrency() { - return this.creditCurrency; - } - - /** - * Get the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - public String billingCurrency() { - return this.billingCurrency; - } - - /** - * Get the originalAmount property: Original amount. + * Get the originalAmount property: The original amount of a lot. * * @return the originalAmount value. */ @@ -129,16 +92,7 @@ public Amount originalAmount() { } /** - * Get the originalAmountInBillingCurrency property: Current balance. - * - * @return the originalAmountInBillingCurrency value. - */ - public AmountWithExchangeRate originalAmountInBillingCurrency() { - return this.originalAmountInBillingCurrency; - } - - /** - * Get the closedBalance property: Closed balance. + * Get the closedBalance property: The balance as of the last invoice. * * @return the closedBalance value. */ @@ -147,16 +101,7 @@ public Amount closedBalance() { } /** - * Get the closedBalanceInBillingCurrency property: Current balance. - * - * @return the closedBalanceInBillingCurrency value. - */ - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.closedBalanceInBillingCurrency; - } - - /** - * Get the source property: Lot source. + * Get the source property: The source of the lot. * * @return the source value. */ @@ -165,7 +110,7 @@ public LotSource source() { } /** - * Get the startDate property: Start date. + * Get the startDate property: The date when the lot became effective. * * @return the startDate value. */ @@ -174,7 +119,7 @@ public OffsetDateTime startDate() { } /** - * Get the expirationDate property: Expiration date. + * Get the expirationDate property: The expiration date of a lot. * * @return the expirationDate value. */ @@ -183,7 +128,8 @@ public OffsetDateTime expirationDate() { } /** - * Get the poNumber property: PO number. + * Get the poNumber property: The po number of the invoice on which the lot was added. This property is not + * available for ConsumptionCommitment lots. * * @return the poNumber value. */ @@ -192,16 +138,25 @@ public String poNumber() { } /** - * Get the reseller property: Reseller details. + * Get the purchaseDate property: The date when the lot was added. + * + * @return the purchaseDate value. + */ + public OffsetDateTime purchaseDate() { + return this.purchaseDate; + } + + /** + * Get the status property: The status of the lot. * - * @return the reseller value. + * @return the status value. */ - public Reseller reseller() { - return this.reseller; + public String status() { + return this.status; } /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ @@ -227,17 +182,8 @@ public void validate() { if (originalAmount() != null) { originalAmount().validate(); } - if (originalAmountInBillingCurrency() != null) { - originalAmountInBillingCurrency().validate(); - } if (closedBalance() != null) { closedBalance().validate(); } - if (closedBalanceInBillingCurrency() != null) { - closedBalanceInBillingCurrency().validate(); - } - if (reseller() != null) { - reseller().validate(); - } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java index d5ace675a1a9b..a6f0e9ca3d315 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java @@ -85,7 +85,7 @@ public class ManagementGroupAggregatedCostResultInner extends ProxyResource { private List excludedSubscriptions; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -225,7 +225,7 @@ public ManagementGroupAggregatedCostResultInner withExcludedSubscriptions(List tags; /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java index 239761bc9379a..d2501656970b7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java @@ -127,7 +127,7 @@ public class ReservationSummaryInner extends ProxyResource { private BigDecimal utilizedPercentage; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -287,7 +287,7 @@ public BigDecimal utilizedPercentage() { } /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java index 1a8de7e134bb4..c6f28e2d4f84f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java @@ -32,7 +32,7 @@ public class UsageDetailInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageDetailInner.class); /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -44,7 +44,7 @@ public class UsageDetailInner extends ProxyResource { private Map tags; /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java index 051fbfcaf5ff5..6b0a88ae78aff 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java @@ -365,7 +365,7 @@ public CreditsClient getCredits() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2019-10-01"; + this.apiVersion = "2021-05-01"; this.usageDetails = new UsageDetailsClientImpl(this); this.marketplaces = new MarketplacesClientImpl(this); this.budgets = new BudgetsClientImpl(this); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java index cbb44865671d2..e29060b527df0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java @@ -8,7 +8,6 @@ import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; import com.azure.resourcemanager.consumption.models.CreditSummary; -import com.azure.resourcemanager.consumption.models.Reseller; import java.util.Collections; import java.util.Map; @@ -35,14 +34,6 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - public CreditBalanceSummary balanceSummary() { return this.innerModel().balanceSummary(); } @@ -59,10 +50,6 @@ public Amount pendingEligibleCharges() { return this.innerModel().pendingEligibleCharges(); } - public Reseller reseller() { - return this.innerModel().reseller(); - } - public String etag() { return this.innerModel().etag(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java index 8b07b5f2a4056..7cd64a9b3bc2a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java @@ -54,13 +54,16 @@ public final class CreditsClientImpl implements CreditsClient { @ServiceInterface(name = "ConsumptionManagemen") private interface CreditsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/credits/balanceSummary") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/credits/balanceSummary") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, @HeaderParam("Accept") String accept, Context context); } @@ -68,42 +71,49 @@ Mono> get( /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope) { + private Mono> getWithResponseAsync(String billingAccountId, String billingProfileId) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context)) + context -> + service + .get( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -111,37 +121,47 @@ private Mono> getWithResponseAsync(String scope) { * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, Context context) { + private Mono> getWithResponseAsync( + String billingAccountId, String billingProfileId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); + return service + .get( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context); } /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope) { - return getWithResponseAsync(scope) + private Mono getAsync(String billingAccountId, String billingProfileId) { + return getWithResponseAsync(billingAccountId, billingProfileId) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -155,29 +175,23 @@ private Mono getAsync(String scope) { /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CreditSummaryInner get(String scope) { - return getAsync(scope).block(); + public CreditSummaryInner get(String billingAccountId, String billingProfileId) { + return getAsync(billingAccountId, billingProfileId).block(); } /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -185,7 +199,8 @@ public CreditSummaryInner get(String scope) { * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, Context context) { - return getWithResponseAsync(scope, context).block(); + public Response getWithResponse( + String billingAccountId, String billingProfileId, Context context) { + return getWithResponseAsync(billingAccountId, billingProfileId, context).block(); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java index 4c8225371d27e..0a36ba8d42d25 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java @@ -27,8 +27,8 @@ public CreditsImpl( this.serviceManager = serviceManager; } - public CreditSummary get(String scope) { - CreditSummaryInner inner = this.serviceClient().get(scope); + public CreditSummary get(String billingAccountId, String billingProfileId) { + CreditSummaryInner inner = this.serviceClient().get(billingAccountId, billingProfileId); if (inner != null) { return new CreditSummaryImpl(inner, this.manager()); } else { @@ -36,8 +36,9 @@ public CreditSummary get(String scope) { } } - public Response getWithResponse(String scope, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, context); + public Response getWithResponse(String billingAccountId, String billingProfileId, Context context) { + Response inner = + this.serviceClient().getWithResponse(billingAccountId, billingProfileId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java index 5c83cf6e85e6e..c4243e83d3deb 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java @@ -6,10 +6,8 @@ import com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner; import com.azure.resourcemanager.consumption.models.Amount; -import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.EventSummary; import com.azure.resourcemanager.consumption.models.EventType; -import com.azure.resourcemanager.consumption.models.Reseller; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -37,14 +35,6 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - public OffsetDateTime transactionDate() { return this.innerModel().transactionDate(); } @@ -57,42 +47,22 @@ public Amount newCredit() { return this.innerModel().newCredit(); } - public AmountWithExchangeRate newCreditInBillingCurrency() { - return this.innerModel().newCreditInBillingCurrency(); - } - public Amount adjustments() { return this.innerModel().adjustments(); } - public AmountWithExchangeRate adjustmentsInBillingCurrency() { - return this.innerModel().adjustmentsInBillingCurrency(); - } - public Amount creditExpired() { return this.innerModel().creditExpired(); } - public AmountWithExchangeRate creditExpiredInBillingCurrency() { - return this.innerModel().creditExpiredInBillingCurrency(); - } - public Amount charges() { return this.innerModel().charges(); } - public AmountWithExchangeRate chargesInBillingCurrency() { - return this.innerModel().chargesInBillingCurrency(); - } - public Amount closedBalance() { return this.innerModel().closedBalance(); } - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.innerModel().closedBalanceInBillingCurrency(); - } - public EventType eventType() { return this.innerModel().eventType(); } @@ -101,8 +71,20 @@ public String invoiceNumber() { return this.innerModel().invoiceNumber(); } - public Reseller reseller() { - return this.innerModel().reseller(); + public String billingProfileId() { + return this.innerModel().billingProfileId(); + } + + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); + } + + public String lotId() { + return this.innerModel().lotId(); + } + + public String lotSource() { + return this.innerModel().lotSource(); } public String etag() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java index 651c111d20c9d..669bd221ad8df 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java @@ -60,15 +60,40 @@ public final class EventsOperationsClientImpl implements EventsOperationsClient @ServiceInterface(name = "ConsumptionManagemen") private interface EventsOperationsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/events") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/events") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, - @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -76,7 +101,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -84,48 +109,53 @@ Mono> listNext( } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String startDate, String endDate, String scope) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } if (startDate == null) { return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); } if (endDate == null) { return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .listByBillingProfile( this.client.getEndpoint(), + billingAccountId, + billingProfileId, this.client.getApiVersion(), startDate, endDate, - scope, accept, context)) .>map( @@ -141,15 +171,13 @@ private Mono> listSinglePageAsync(String startD } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -157,27 +185,40 @@ private Mono> listSinglePageAsync(String startD * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String startDate, String endDate, String scope, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } if (startDate == null) { return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); } if (endDate == null) { return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), startDate, endDate, scope, accept, context) + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + startDate, + endDate, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -190,36 +231,34 @@ private Mono> listSinglePageAsync( } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String startDate, String endDate, String scope) { + private PagedFlux listByBillingProfileAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate) { return new PagedFlux<>( - () -> listSinglePageAsync(startDate, endDate, scope), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, startDate, endDate), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -227,42 +266,40 @@ private PagedFlux listAsync(String startDate, String endDate, * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String startDate, String endDate, String scope, Context context) { + private PagedFlux listByBillingProfileAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(startDate, endDate, scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, startDate, endDate, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String startDate, String endDate, String scope) { - return new PagedIterable<>(listAsync(startDate, endDate, scope)); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, startDate, endDate)); } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -270,8 +307,199 @@ public PagedIterable list(String startDate, String endDate, S * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String startDate, String endDate, String scope, Context context) { - return new PagedIterable<>(listAsync(startDate, endDate, scope, context)); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + return new PagedIterable<>( + listByBillingProfileAsync(billingAccountId, billingProfileId, startDate, endDate, context)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + * string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountId, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccount( + this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + * string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountId) { + final String filter = null; + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync( + String billingAccountId, String filter, Context context) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount(String billingAccountId) { + final String filter = null; + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount( + String billingAccountId, String filter, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter, context)); } /** @@ -284,7 +512,7 @@ public PagedIterable list(String startDate, String endDate, S * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -296,7 +524,81 @@ private Mono> listNextSinglePageAsync(String ne } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -320,7 +622,8 @@ private Mono> listNextSinglePageAsync(String ne * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -333,7 +636,7 @@ private Mono> listNextSinglePageAsync(String ne final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java index 994c73b9cf0e4..4e5f0b2bd8f4b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java @@ -26,13 +26,28 @@ public EventsOperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String startDate, String endDate, String scope) { - PagedIterable inner = this.serviceClient().list(startDate, endDate, scope); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate); return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } - public PagedIterable list(String startDate, String endDate, String scope, Context context) { - PagedIterable inner = this.serviceClient().list(startDate, endDate, scope, context); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate, context); + return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountId); + return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountId, filter, context); return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java index 0c55e93f5bfdf..8caf710d196a2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java @@ -6,10 +6,8 @@ import com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner; import com.azure.resourcemanager.consumption.models.Amount; -import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.LotSource; import com.azure.resourcemanager.consumption.models.LotSummary; -import com.azure.resourcemanager.consumption.models.Reseller; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -37,30 +35,14 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - public Amount originalAmount() { return this.innerModel().originalAmount(); } - public AmountWithExchangeRate originalAmountInBillingCurrency() { - return this.innerModel().originalAmountInBillingCurrency(); - } - public Amount closedBalance() { return this.innerModel().closedBalance(); } - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.innerModel().closedBalanceInBillingCurrency(); - } - public LotSource source() { return this.innerModel().source(); } @@ -77,8 +59,12 @@ public String poNumber() { return this.innerModel().poNumber(); } - public Reseller reseller() { - return this.innerModel().reseller(); + public OffsetDateTime purchaseDate() { + return this.innerModel().purchaseDate(); + } + + public String status() { + return this.innerModel().status(); } public String etag() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java index dedeaeaec1b97..e17ef7138dbc8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java @@ -60,55 +60,264 @@ public final class LotsOperationsClientImpl implements LotsOperationsClient { @ServiceInterface(name = "ConsumptionManagemen") private interface LotsOperationsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/lots") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/lots") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync(String billingAccountId, String billingProfileId) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountId, String billingProfileId, Context context) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, context)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountId, + this.client.getApiVersion(), + filter, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -122,13 +331,13 @@ private Mono> listSinglePageAsync(String scope) { } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 ManagementException thrown if the request is rejected by server. @@ -136,20 +345,23 @@ private Mono> listSinglePageAsync(String scope) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context) + .listByBillingAccount( + this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, accept, context) .map( res -> new PagedResponseBase<>( @@ -162,31 +374,51 @@ private Mono> listSinglePageAsync(String scope, C } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountId) { + final String filter = null; + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 ManagementException thrown if the request is rejected by server. @@ -194,37 +426,37 @@ private PagedFlux listAsync(String scope) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { + private PagedFlux listByBillingAccountAsync( + String billingAccountId, String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); + public PagedIterable listByBillingAccount(String billingAccountId) { + final String filter = null; + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 ManagementException thrown if the request is rejected by server. @@ -232,8 +464,9 @@ public PagedIterable list(String scope) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); + public PagedIterable listByBillingAccount( + String billingAccountId, String filter, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter, context)); } /** @@ -246,7 +479,7 @@ public PagedIterable list(String scope, Context context) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -258,7 +491,81 @@ private Mono> listNextSinglePageAsync(String next } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -282,7 +589,8 @@ private Mono> listNextSinglePageAsync(String next * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -295,7 +603,7 @@ private Mono> listNextSinglePageAsync(String next final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java index 6f56088632598..82f0b140a011b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java @@ -26,13 +26,27 @@ public LotsOperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId); return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, context); + return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountId); + return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountId, filter, context); return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java index 8cb5b5a5053a7..e01c7433932aa 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java @@ -87,8 +87,7 @@ Mono> getByBillingPeriod( } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -99,7 +98,7 @@ Mono> getByBillingPeriod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String expand, String skiptoken, Integer top) { @@ -133,8 +132,7 @@ private Mono> getWithResponseAsync(String expand } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -146,7 +144,7 @@ private Mono> getWithResponseAsync(String expand * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -178,8 +176,7 @@ private Mono> getWithResponseAsync( } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -190,7 +187,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String expand, String skiptoken, Integer top) { @@ -206,12 +203,11 @@ private Mono getAsync(String expand, String skiptoken, In } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync() { @@ -230,12 +226,11 @@ private Mono getAsync() { } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) public PriceSheetResultInner get() { @@ -246,8 +241,7 @@ public PriceSheetResultInner get() { } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -259,7 +253,7 @@ public PriceSheetResultInner get() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java index 57dcfac6d6faa..3b71df5b0c47d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java @@ -64,14 +64,14 @@ public final class ReservationRecommendationDetailsClientImpl implements Reserva @ServiceInterface(name = "ConsumptionManagemen") private interface ReservationRecommendationDetailsService { @Headers({"Content-Type: application/json"}) - @Get("/{billingScope}/providers/Microsoft.Consumption/reservationRecommendationDetails") + @Get("/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "billingScope", encoded = true) String billingScope, - @QueryParam("scope") Scope scope, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("scope") Scope scope1, @QueryParam("region") String region, @QueryParam("term") Term term, @QueryParam("lookBackPeriod") LookBackPeriod lookBackPeriod, @@ -83,13 +83,13 @@ Mono> get( /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -102,19 +102,19 @@ Mono> get( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (billingScope == null) { - return Mono.error(new IllegalArgumentException("Parameter billingScope is required and cannot be null.")); - } if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } + if (scope1 == null) { + return Mono.error(new IllegalArgumentException("Parameter scope1 is required and cannot be null.")); + } if (region == null) { return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); } @@ -135,8 +135,8 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), - billingScope, scope, + scope1, region, term, lookBackPeriod, @@ -149,13 +149,13 @@ private Mono> getWithRespon /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -169,8 +169,8 @@ private Mono> getWithRespon */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, @@ -182,12 +182,12 @@ private Mono> getWithRespon new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (billingScope == null) { - return Mono.error(new IllegalArgumentException("Parameter billingScope is required and cannot be null.")); - } if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } + if (scope1 == null) { + return Mono.error(new IllegalArgumentException("Parameter scope1 is required and cannot be null.")); + } if (region == null) { return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); } @@ -206,8 +206,8 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), - billingScope, scope, + scope1, region, term, lookBackPeriod, @@ -219,13 +219,13 @@ private Mono> getWithRespon /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -238,8 +238,8 @@ private Mono> getWithRespon */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - return getWithResponseAsync(billingScope, scope, region, term, lookBackPeriod, product) + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getWithResponseAsync(scope, scope1, region, term, lookBackPeriod, product) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -253,13 +253,13 @@ private Mono getAsync( /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -272,20 +272,20 @@ private Mono getAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationRecommendationDetailsModelInner get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - return getAsync(billingScope, scope, region, term, lookBackPeriod, product).block(); + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getAsync(scope, scope1, region, term, lookBackPeriod, product).block(); } /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -299,13 +299,13 @@ public ReservationRecommendationDetailsModelInner get( */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { - return getWithResponseAsync(billingScope, scope, region, term, lookBackPeriod, product, context).block(); + return getWithResponseAsync(scope, scope1, region, term, lookBackPeriod, product, context).block(); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java index 941057acdb825..286c11dddcad8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java @@ -32,9 +32,9 @@ public ReservationRecommendationDetailsImpl( } public ReservationRecommendationDetailsModel get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { ReservationRecommendationDetailsModelInner inner = - this.serviceClient().get(billingScope, scope, region, term, lookBackPeriod, product); + this.serviceClient().get(scope, scope1, region, term, lookBackPeriod, product); if (inner != null) { return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); } else { @@ -43,15 +43,15 @@ public ReservationRecommendationDetailsModel get( } public Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { Response inner = - this.serviceClient().getWithResponse(billingScope, scope, region, term, lookBackPeriod, product, context); + this.serviceClient().getWithResponse(scope, scope1, region, term, lookBackPeriod, product, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java index ee8a60d5cd91c..60524468cafcd 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java @@ -12,7 +12,7 @@ /** The amount plus currency . */ @Immutable -public class Amount { +public final class Amount { @JsonIgnore private final ClientLogger logger = new ClientLogger(Amount.class); /* diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java deleted file mode 100644 index 494127f9432c2..0000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.consumption.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; - -/** Reseller details. */ -@Immutable -public final class AmountWithExchangeRate extends Amount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AmountWithExchangeRate.class); - - /* - * Exchange Rate. - */ - @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal exchangeRate; - - /* - * Exchange rate month. - */ - @JsonProperty(value = "exchangeRateMonth", access = JsonProperty.Access.WRITE_ONLY) - private Float exchangeRateMonth; - - /** - * Get the exchangeRate property: Exchange Rate. - * - * @return the exchangeRate value. - */ - public BigDecimal exchangeRate() { - return this.exchangeRate; - } - - /** - * Get the exchangeRateMonth property: Exchange rate month. - * - * @return the exchangeRateMonth value. - */ - public Float exchangeRateMonth() { - return this.exchangeRateMonth; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java index 62a70684dccb9..105bef6fd46a2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java @@ -139,7 +139,7 @@ public interface Balance { List adjustmentDetails(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java index 18d50dd1e9f39..e93310ccd0b50 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java @@ -30,7 +30,7 @@ public class ChargeSummary extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ChargeSummary.class); /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -42,7 +42,7 @@ public class ChargeSummary extends ProxyResource { private Map tags; /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java index b6ccd59fe9f5b..75c919a8929bf 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java @@ -26,18 +26,6 @@ public final class CreditBalanceSummary { @JsonProperty(value = "currentBalance", access = JsonProperty.Access.WRITE_ONLY) private Amount currentBalance; - /* - * Current balance. - */ - @JsonProperty(value = "estimatedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate estimatedBalanceInBillingCurrency; - - /* - * Current balance. - */ - @JsonProperty(value = "currentBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate currentBalanceInBillingCurrency; - /** * Get the estimatedBalance property: Estimated balance. * @@ -56,24 +44,6 @@ public Amount currentBalance() { return this.currentBalance; } - /** - * Get the estimatedBalanceInBillingCurrency property: Current balance. - * - * @return the estimatedBalanceInBillingCurrency value. - */ - public AmountWithExchangeRate estimatedBalanceInBillingCurrency() { - return this.estimatedBalanceInBillingCurrency; - } - - /** - * Get the currentBalanceInBillingCurrency property: Current balance. - * - * @return the currentBalanceInBillingCurrency value. - */ - public AmountWithExchangeRate currentBalanceInBillingCurrency() { - return this.currentBalanceInBillingCurrency; - } - /** * Validates the instance. * @@ -86,11 +56,5 @@ public void validate() { if (currentBalance() != null) { currentBalance().validate(); } - if (estimatedBalanceInBillingCurrency() != null) { - estimatedBalanceInBillingCurrency().validate(); - } - if (currentBalanceInBillingCurrency() != null) { - currentBalanceInBillingCurrency().validate(); - } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java index e29dc637c1ff9..7496cade5379c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java @@ -30,20 +30,6 @@ public interface CreditSummary { */ String type(); - /** - * Gets the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - String creditCurrency(); - - /** - * Gets the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - String billingCurrency(); - /** * Gets the balanceSummary property: Summary of balances associated with this credit summary. * @@ -73,14 +59,7 @@ public interface CreditSummary { Amount pendingEligibleCharges(); /** - * Gets the reseller property: Reseller details. - * - * @return the reseller value. - */ - Reseller reseller(); - - /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java index f88f521d3f0bd..c81237f13f378 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java @@ -12,31 +12,25 @@ public interface Credits { /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile 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 a credit summary resource. */ - CreditSummary get(String scope); + CreditSummary get(String billingAccountId, String billingProfileId); /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 a credit summary resource. */ - Response getWithResponse(String scope, Context context); + Response getWithResponse(String billingAccountId, String billingProfileId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java deleted file mode 100644 index a6e0879dd0123..0000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.consumption.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CultureCode. */ -public final class CultureCode extends ExpandableStringEnum { - /** Static value en-us for CultureCode. */ - public static final CultureCode EN_US = fromString("en-us"); - - /** Static value ja-jp for CultureCode. */ - public static final CultureCode JA_JP = fromString("ja-jp"); - - /** Static value zh-cn for CultureCode. */ - public static final CultureCode ZH_CN = fromString("zh-cn"); - - /** Static value de-de for CultureCode. */ - public static final CultureCode DE_DE = fromString("de-de"); - - /** Static value es-es for CultureCode. */ - public static final CultureCode ES_ES = fromString("es-es"); - - /** Static value fr-fr for CultureCode. */ - public static final CultureCode FR_FR = fromString("fr-fr"); - - /** Static value it-it for CultureCode. */ - public static final CultureCode IT_IT = fromString("it-it"); - - /** Static value ko-kr for CultureCode. */ - public static final CultureCode KO_KR = fromString("ko-kr"); - - /** Static value pt-br for CultureCode. */ - public static final CultureCode PT_BR = fromString("pt-br"); - - /** Static value ru-ru for CultureCode. */ - public static final CultureCode RU_RU = fromString("ru-ru"); - - /** Static value zh-tw for CultureCode. */ - public static final CultureCode ZH_TW = fromString("zh-tw"); - - /** Static value cs-cz for CultureCode. */ - public static final CultureCode CS_CZ = fromString("cs-cz"); - - /** Static value pl-pl for CultureCode. */ - public static final CultureCode PL_PL = fromString("pl-pl"); - - /** Static value tr-tr for CultureCode. */ - public static final CultureCode TR_TR = fromString("tr-tr"); - - /** Static value da-dk for CultureCode. */ - public static final CultureCode DA_DK = fromString("da-dk"); - - /** Static value en-gb for CultureCode. */ - public static final CultureCode EN_GB = fromString("en-gb"); - - /** Static value hu-hu for CultureCode. */ - public static final CultureCode HU_HU = fromString("hu-hu"); - - /** Static value nb-no for CultureCode. */ - public static final CultureCode NB_NO = fromString("nb-no"); - - /** Static value nl-nl for CultureCode. */ - public static final CultureCode NL_NL = fromString("nl-nl"); - - /** Static value pt-pt for CultureCode. */ - public static final CultureCode PT_PT = fromString("pt-pt"); - - /** Static value sv-se for CultureCode. */ - public static final CultureCode SV_SE = fromString("sv-se"); - - /** - * Creates or finds a CultureCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding CultureCode. - */ - @JsonCreator - public static CultureCode fromString(String name) { - return fromString(name, CultureCode.class); - } - - /** @return known CultureCode values. */ - public static Collection values() { - return values(CultureCode.class); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java index 17b27dd0407be..6cd43547a9932 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java @@ -32,126 +32,102 @@ public interface EventSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - String creditCurrency(); - - /** - * Gets the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - String billingCurrency(); - - /** - * Gets the transactionDate property: Transaction date. + * Gets the transactionDate property: The date of the event. * * @return the transactionDate value. */ OffsetDateTime transactionDate(); /** - * Gets the description property: Transaction description. + * Gets the description property: The description of the event. * * @return the description value. */ String description(); /** - * Gets the newCredit property: New Credit. + * Gets the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. * * @return the newCredit value. */ Amount newCredit(); /** - * Gets the newCreditInBillingCurrency property: Current balance. - * - * @return the newCreditInBillingCurrency value. - */ - AmountWithExchangeRate newCreditInBillingCurrency(); - - /** - * Gets the adjustments property: Adjustments amount. + * Gets the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. * * @return the adjustments value. */ Amount adjustments(); /** - * Gets the adjustmentsInBillingCurrency property: Current balance. - * - * @return the adjustmentsInBillingCurrency value. - */ - AmountWithExchangeRate adjustmentsInBillingCurrency(); - - /** - * Gets the creditExpired property: Credit expired. + * Gets the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. * * @return the creditExpired value. */ Amount creditExpired(); /** - * Gets the creditExpiredInBillingCurrency property: Current balance. + * Gets the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. * - * @return the creditExpiredInBillingCurrency value. + * @return the charges value. */ - AmountWithExchangeRate creditExpiredInBillingCurrency(); + Amount charges(); /** - * Gets the charges property: Charges amount. + * Gets the closedBalance property: The balance after the event. * - * @return the charges value. + * @return the closedBalance value. */ - Amount charges(); + Amount closedBalance(); /** - * Gets the chargesInBillingCurrency property: Current balance. + * Gets the eventType property: Identifies the type of the event. * - * @return the chargesInBillingCurrency value. + * @return the eventType value. */ - AmountWithExchangeRate chargesInBillingCurrency(); + EventType eventType(); /** - * Gets the closedBalance property: Closed balance. + * Gets the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. + * This will be empty for unbilled events. * - * @return the closedBalance value. + * @return the invoiceNumber value. */ - Amount closedBalance(); + String invoiceNumber(); /** - * Gets the closedBalanceInBillingCurrency property: Current balance. + * Gets the billingProfileId property: The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the closedBalanceInBillingCurrency value. + * @return the billingProfileId value. */ - AmountWithExchangeRate closedBalanceInBillingCurrency(); + String billingProfileId(); /** - * Gets the eventType property: The type of event. + * Gets the billingProfileDisplayName property: The display name of the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the eventType value. + * @return the billingProfileDisplayName value. */ - EventType eventType(); + String billingProfileDisplayName(); /** - * Gets the invoiceNumber property: Invoice number. + * Gets the lotId property: The ID that uniquely identifies the lot for which the event happened. * - * @return the invoiceNumber value. + * @return the lotId value. */ - String invoiceNumber(); + String lotId(); /** - * Gets the reseller property: Reseller details. + * Gets the lotSource property: Identifies the source of the lot for which the event happened. * - * @return the reseller value. + * @return the lotSource value. */ - Reseller reseller(); + String lotSource(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java index 4cb4871b3b5ae..8dba4861b35d8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java @@ -10,37 +10,63 @@ /** Resource collection API of EventsOperations. */ public interface EventsOperations { /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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. */ - PagedIterable list(String startDate, String endDate, String scope); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate); /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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 event summary. */ - PagedIterable list(String startDate, String endDate, String scope, Context context); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount 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 event summary. + */ + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 event summary. + */ + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java index 239f07802ff92..36b46f731baa4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java @@ -78,7 +78,7 @@ public interface Forecast { List confidenceLevels(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java index ebddba41eaa88..31596934dddbf 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java @@ -166,7 +166,7 @@ public class LegacyUsageDetail extends UsageDetailInner { private String consumedService; /* - * Azure resource manager resource identifier. + * Unique identifier of the Azure Resource Manager usage detail resource. */ @JsonProperty(value = "properties.resourceId", access = JsonProperty.Access.WRITE_ONLY) private String resourceId; @@ -178,13 +178,13 @@ public class LegacyUsageDetail extends UsageDetailInner { private String resourceName; /* - * Service Info 1. + * Service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo1; /* - * Service Info 2. + * Legacy field with optional service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo2; @@ -500,7 +500,7 @@ public String consumedService() { } /** - * Get the resourceId property: Azure resource manager resource identifier. + * Get the resourceId property: Unique identifier of the Azure Resource Manager usage detail resource. * * @return the resourceId value. */ @@ -518,7 +518,7 @@ public String resourceName() { } /** - * Get the serviceInfo1 property: Service Info 1. + * Get the serviceInfo1 property: Service-specific metadata. * * @return the serviceInfo1 value. */ @@ -527,7 +527,7 @@ public String serviceInfo1() { } /** - * Get the serviceInfo2 property: Service Info 2. + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. * * @return the serviceInfo2 value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java index 5ad1d4f4dc751..9db6258330991 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java @@ -16,6 +16,9 @@ public final class LotSource extends ExpandableStringEnum { /** Static value PromotionalCredit for LotSource. */ public static final LotSource PROMOTIONAL_CREDIT = fromString("PromotionalCredit"); + /** Static value ConsumptionCommitment for LotSource. */ + public static final LotSource CONSUMPTION_COMMITMENT = fromString("ConsumptionCommitment"); + /** * Creates or finds a LotSource from its string representation. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java index 86797bdbd2589..cca9f6fc73bac 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java @@ -32,84 +32,64 @@ public interface LotSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - String creditCurrency(); - - /** - * Gets the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - String billingCurrency(); - - /** - * Gets the originalAmount property: Original amount. + * Gets the originalAmount property: The original amount of a lot. * * @return the originalAmount value. */ Amount originalAmount(); /** - * Gets the originalAmountInBillingCurrency property: Current balance. - * - * @return the originalAmountInBillingCurrency value. - */ - AmountWithExchangeRate originalAmountInBillingCurrency(); - - /** - * Gets the closedBalance property: Closed balance. + * Gets the closedBalance property: The balance as of the last invoice. * * @return the closedBalance value. */ Amount closedBalance(); /** - * Gets the closedBalanceInBillingCurrency property: Current balance. - * - * @return the closedBalanceInBillingCurrency value. - */ - AmountWithExchangeRate closedBalanceInBillingCurrency(); - - /** - * Gets the source property: Lot source. + * Gets the source property: The source of the lot. * * @return the source value. */ LotSource source(); /** - * Gets the startDate property: Start date. + * Gets the startDate property: The date when the lot became effective. * * @return the startDate value. */ OffsetDateTime startDate(); /** - * Gets the expirationDate property: Expiration date. + * Gets the expirationDate property: The expiration date of a lot. * * @return the expirationDate value. */ OffsetDateTime expirationDate(); /** - * Gets the poNumber property: PO number. + * Gets the poNumber property: The po number of the invoice on which the lot was added. This property is not + * available for ConsumptionCommitment lots. * * @return the poNumber value. */ String poNumber(); /** - * Gets the reseller property: Reseller details. + * Gets the purchaseDate property: The date when the lot was added. + * + * @return the purchaseDate value. + */ + OffsetDateTime purchaseDate(); + + /** + * Gets the status property: The status of the lot. * - * @return the reseller value. + * @return the status value. */ - Reseller reseller(); + String status(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java index bd0c75f7c8c5b..bab1d91c0f170 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java @@ -10,33 +10,57 @@ /** Resource collection API of LotsOperations. */ public interface LotsOperations { /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile 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. */ - PagedIterable list(String scope); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId); /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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. */ - PagedIterable list(String scope, Context context); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, Context context); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount 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. + */ + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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. + */ + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java index 0ee54f25b7a2b..dca4b9a5c37ab 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java @@ -106,7 +106,7 @@ public interface ManagementGroupAggregatedCostResult { List excludedSubscriptions(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java index 7357eea22708b..033f1ef226832 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java @@ -217,7 +217,7 @@ public interface Marketplace { Boolean isRecurringCharge(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java index b08b6916d865f..11612cf4a7ad0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.OffsetDateTime; +import java.util.UUID; /** Modern usage detail. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @@ -97,7 +98,7 @@ public class ModernUsageDetail extends UsageDetailInner { * see productOrderName. */ @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private String meterId; + private UUID meterId; /* * Identifies the name of the meter against which consumption is measured. @@ -186,13 +187,13 @@ public class ModernUsageDetail extends UsageDetailInner { private String consumedService; /* - * Service Info 1. + * Service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo1; /* - * Service Info 2. + * Legacy field with optional service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo2; @@ -569,7 +570,7 @@ public String product() { * * @return the meterId value. */ - public String meterId() { + public UUID meterId() { return this.meterId; } @@ -696,7 +697,7 @@ public String consumedService() { } /** - * Get the serviceInfo1 property: Service Info 1. + * Get the serviceInfo1 property: Service-specific metadata. * * @return the serviceInfo1 value. */ @@ -705,7 +706,7 @@ public String serviceInfo1() { } /** - * Get the serviceInfo2 property: Service Info 2. + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. * * @return the serviceInfo2 value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java index ac6302aac9a77..e1ff302f134e6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java @@ -66,12 +66,6 @@ public final class Notification { @JsonProperty(value = "thresholdType") private ThresholdType thresholdType; - /* - * Language in which the recipient will receive the notification - */ - @JsonProperty(value = "locale") - private CultureCode locale; - /** * Get the enabled property: The notification is enabled or not. * @@ -220,26 +214,6 @@ public Notification withThresholdType(ThresholdType thresholdType) { return this; } - /** - * Get the locale property: Language in which the recipient will receive the notification. - * - * @return the locale value. - */ - public CultureCode locale() { - return this.locale; - } - - /** - * Set the locale property: Language in which the recipient will receive the notification. - * - * @param locale the locale value to set. - * @return the Notification object itself. - */ - public Notification withLocale(CultureCode locale) { - this.locale = locale; - return this; - } - /** * Validates the instance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java index e0ba5fa402cb4..ec23910b62b24 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java @@ -53,7 +53,7 @@ public interface PriceSheetResult { MeterDetails download(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java index 90f922a28aa4d..13bfc45db8b99 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java @@ -10,18 +10,16 @@ /** Resource collection API of PriceSheets. */ public interface PriceSheets { /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ PriceSheetResult get(); /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -33,7 +31,7 @@ public interface PriceSheets { * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ Response getWithResponse(String expand, String skiptoken, Integer top, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java deleted file mode 100644 index 1be58a1561cfa..0000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.consumption.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Reseller details. */ -@Immutable -public final class Reseller { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Reseller.class); - - /* - * Reseller id. - */ - @JsonProperty(value = "resellerId", access = JsonProperty.Access.WRITE_ONLY) - private String resellerId; - - /* - * Reseller Description. - */ - @JsonProperty(value = "resellerDescription", access = JsonProperty.Access.WRITE_ONLY) - private String resellerDescription; - - /** - * Get the resellerId property: Reseller id. - * - * @return the resellerId value. - */ - public String resellerId() { - return this.resellerId; - } - - /** - * Get the resellerDescription property: Reseller Description. - * - * @return the resellerDescription value. - */ - public String resellerDescription() { - return this.resellerDescription; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java index 0af7e6888e00f..5fa9483dba29a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java @@ -117,7 +117,7 @@ public interface ReservationDetail { String kind(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java index 26dd1a302f203..e7d628e03193f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java @@ -24,7 +24,7 @@ public interface ReservationRecommendation { String sku(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java index c7454899d8314..f129d984809e1 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java @@ -12,13 +12,13 @@ public interface ReservationRecommendationDetails { /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -30,18 +30,18 @@ public interface ReservationRecommendationDetails { * @return reservation recommendation details. */ ReservationRecommendationDetailsModel get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product); /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. + * @param scope1 Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -54,8 +54,8 @@ ReservationRecommendationDetailsModel get( * @return reservation recommendation details. */ Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java index 993a6f596ccc3..6d750597aa73b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java @@ -87,7 +87,7 @@ public interface ReservationRecommendationDetailsModel { ReservationRecommendationDetailsUsageProperties usage(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java index 3a1469244a127..87d010ae16454 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java @@ -151,7 +151,7 @@ public interface ReservationSummary { BigDecimal utilizedPercentage(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java index e0bbf0f17769c..f79d6b4576414 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java @@ -31,7 +31,7 @@ public interface UsageDetail { String type(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */