diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/CHANGELOG.md b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/CHANGELOG.md
index b0c43a158286..fcfc778fd0df 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/CHANGELOG.md
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/CHANGELOG.md
@@ -1,6 +1,8 @@
# Release History
-## 1.0.0-beta.3 (Unreleased)
+## 1.0.0-beta.1 (2025-02-26)
+
+- Azure Resource Manager BillingBenefits client library for Java. This package contains Microsoft Azure SDK for BillingBenefits Management SDK. Azure Benefits RP let users create and manage benefits like savings plan. Package tag package-preview-2024-11-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Features Added
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/README.md b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/README.md
index fd0e4c0ffac4..6c4e9cea3420 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/README.md
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/README.md
@@ -2,7 +2,7 @@
Azure Resource Manager BillingBenefits client library for Java.
-This package contains Microsoft Azure SDK for BillingBenefits Management SDK. Azure Benefits RP let users create and manage benefits like savings plan. Package tag package-2022-11-01. 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 BillingBenefits Management SDK. Azure Benefits RP let users create and manage benefits like savings plan. Package tag package-preview-2024-11-01-preview. 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-billingbenefits
- 1.0.0-beta.2
+ 1.0.0-beta.3
```
[//]: # ({x-version-update-end})
@@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
```java
-AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
@@ -60,7 +60,7 @@ BillingBenefitsManager manager = BillingBenefitsManager
.authenticate(credential, profile);
```
-The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
See [Authentication][authenticate] for more options.
@@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
-
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/SAMPLE.md b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/SAMPLE.md
index a21ce802f8c2..ef67978357ab 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/SAMPLE.md
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/SAMPLE.md
@@ -1,6 +1,20 @@
# Code snippets and samples
+## DiscountOperation
+
+- [GetByResourceGroup](#discountoperation_getbyresourcegroup)
+- [Update](#discountoperation_update)
+
+## Discounts
+
+- [Cancel](#discounts_cancel)
+- [Create](#discounts_create)
+- [Delete](#discounts_delete)
+- [List](#discounts_list)
+- [ListByResourceGroup](#discounts_listbyresourcegroup)
+- [ScopeList](#discounts_scopelist)
+
## Operations
- [List](#operations_list)
@@ -32,6 +46,455 @@
- [Create](#savingsplanorderalias_create)
- [Get](#savingsplanorderalias_get)
+### DiscountOperation_GetByResourceGroup
+
+```java
+/**
+ * Samples for DiscountOperation GetByResourceGroup.
+ */
+public final class DiscountOperationGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountGet.json
+ */
+ /**
+ * Sample code: DiscountGet.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountGet(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discountOperations()
+ .getByResourceGroupWithResponse("testrg", "testprimarydiscount", com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### DiscountOperation_Update
+
+```java
+import com.azure.resourcemanager.billingbenefits.models.DiscountPatchRequest;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Samples for DiscountOperation Update.
+ */
+public final class DiscountOperationUpdateSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsUpdate.json
+ */
+ /**
+ * Sample code: DiscountGet.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountGet(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discountOperations()
+ .update("testrg", "testprimarydiscount",
+ new DiscountPatchRequest()
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withDisplayName("Virtual Machines D Series"),
+ com.azure.core.util.Context.NONE);
+ }
+
+ // Use "Map.of" if available
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### Discounts_Cancel
+
+```java
+/**
+ * Samples for Discounts Cancel.
+ */
+public final class DiscountsCancelSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountCancel.json
+ */
+ /**
+ * Sample code: DiscountCancel.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountCancel(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts().cancel("testrg", "testdiscount", com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### Discounts_Create
+
+```java
+import com.azure.resourcemanager.billingbenefits.models.ApplyDiscountOn;
+import com.azure.resourcemanager.billingbenefits.models.CatalogClaimsItem;
+import com.azure.resourcemanager.billingbenefits.models.ConditionsItem;
+import com.azure.resourcemanager.billingbenefits.models.CustomPriceProperties;
+import com.azure.resourcemanager.billingbenefits.models.DiscountAppliedScopeType;
+import com.azure.resourcemanager.billingbenefits.models.DiscountCombinationRule;
+import com.azure.resourcemanager.billingbenefits.models.DiscountRuleType;
+import com.azure.resourcemanager.billingbenefits.models.DiscountTypeCustomPrice;
+import com.azure.resourcemanager.billingbenefits.models.DiscountTypeCustomPriceMultiCurrency;
+import com.azure.resourcemanager.billingbenefits.models.DiscountTypeProductFamily;
+import com.azure.resourcemanager.billingbenefits.models.DiscountTypeProductSku;
+import com.azure.resourcemanager.billingbenefits.models.EntityTypeAffiliateDiscount;
+import com.azure.resourcemanager.billingbenefits.models.EntityTypePrimaryDiscount;
+import com.azure.resourcemanager.billingbenefits.models.MarketSetPricesItems;
+import com.azure.resourcemanager.billingbenefits.models.PriceGuaranteeProperties;
+import com.azure.resourcemanager.billingbenefits.models.PricingPolicy;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Samples for Discounts Create.
+ */
+public final class DiscountsCreateSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsCreatePrimaryBackfill.json
+ */
+ /**
+ * Sample code: DiscountsCreatePrimaryBackfill.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void
+ discountsCreatePrimaryBackfill(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .define("testprimarydiscount")
+ .withRegion("global")
+ .withExistingResourceGroup("testrg")
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withProperties(new EntityTypePrimaryDiscount().withProductCode("fakeTokenPlaceholder")
+ .withStartAt(OffsetDateTime.parse("2023-07-01T00:00:00Z"))
+ .withSystemId("13810867107109237")
+ .withDisplayName("Virtual Machines D Series")
+ .withAppliedScopeType(DiscountAppliedScopeType.BILLING_ACCOUNT)
+ .withDiscountTypeProperties(
+ new DiscountTypeProductFamily().withApplyDiscountOn(ApplyDiscountOn.PURCHASE)
+ .withDiscountPercentage(14.0F)
+ .withDiscountCombinationRule(DiscountCombinationRule.BEST_OF)
+ .withConditions(Arrays.asList(new ConditionsItem().withConditionName("Cloud")
+ .withValue(Arrays.asList("US-Sec"))
+ .withType("equalAny")))
+ .withProductFamilyName("Azure"))
+ .withEndAt(OffsetDateTime.parse("2024-07-01T23:59:59Z")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsCreatePrimaryWithCustomPrice.json
+ */
+ /**
+ * Sample code: DiscountsCreatePrimaryWithCustomPrice.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountsCreatePrimaryWithCustomPrice(
+ com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .define("testprimarydiscount")
+ .withRegion("global")
+ .withExistingResourceGroup("testrg")
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withProperties(new EntityTypePrimaryDiscount().withProductCode("fakeTokenPlaceholder")
+ .withStartAt(OffsetDateTime.parse("2023-07-01T00:00:00Z"))
+ .withDisplayName("Virtual Machines D Series")
+ .withAppliedScopeType(DiscountAppliedScopeType.BILLING_ACCOUNT)
+ .withDiscountTypeProperties(new DiscountTypeCustomPrice().withApplyDiscountOn(ApplyDiscountOn.PURCHASE)
+ .withDiscountPercentage(14.0F)
+ .withDiscountCombinationRule(DiscountCombinationRule.BEST_OF)
+ .withConditions(Arrays.asList(new ConditionsItem().withConditionName("Cloud")
+ .withValue(Arrays.asList("US-Sec"))
+ .withType("equalAny")))
+ .withProductFamilyName("Azure")
+ .withProductId("DZH318Z0BQ35")
+ .withSkuId("0001")
+ .withCustomPriceProperties(new CustomPriceProperties()
+ .withRuleType(DiscountRuleType.FIXED_PRICE_LOCK)
+ .withCatalogId("4")
+ .withCatalogClaims(Arrays.asList(
+ new CatalogClaimsItem().withCatalogClaimsItemType("NationalCloud").withValue("USSec")))
+ .withTermUnits("ASI1251A")
+ .withMarketSetPrices(Arrays.asList(new MarketSetPricesItems().withMarkets(Arrays.asList("US"))
+ .withValue(125.16f)
+ .withCurrency("USD")))))
+ .withEndAt(OffsetDateTime.parse("2024-07-01T23:59:59Z")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsCreatePrimaryWithPriceGuarantee.json
+ */
+ /**
+ * Sample code: DiscountsCreatePrimaryWithPriceGuarantee.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountsCreatePrimaryWithPriceGuarantee(
+ com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .define("testprimarydiscount")
+ .withRegion("global")
+ .withExistingResourceGroup("testrg")
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withProperties(new EntityTypePrimaryDiscount().withProductCode("fakeTokenPlaceholder")
+ .withStartAt(OffsetDateTime.parse("2023-07-01T00:00:00Z"))
+ .withDisplayName("Virtual Machines D Series")
+ .withAppliedScopeType(DiscountAppliedScopeType.BILLING_ACCOUNT)
+ .withDiscountTypeProperties(new DiscountTypeProductSku().withApplyDiscountOn(ApplyDiscountOn.PURCHASE)
+ .withDiscountCombinationRule(DiscountCombinationRule.BEST_OF)
+ .withPriceGuaranteeProperties(
+ new PriceGuaranteeProperties().withPricingPolicy(PricingPolicy.PROTECTED)
+ .withPriceGuaranteeDate(OffsetDateTime.parse("2024-11-01T00:00:00")))
+ .withConditions(Arrays.asList(new ConditionsItem().withConditionName("Cloud")
+ .withValue(Arrays.asList("US-Sec"))
+ .withType("equalAny")))
+ .withProductFamilyName("Azure")
+ .withProductId("DZH318Z0BQ35")
+ .withSkuId("0001"))
+ .withEndAt(OffsetDateTime.parse("2024-07-01T23:59:59Z")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsCreateAffiliate.json
+ */
+ /**
+ * Sample code: DiscountsCreateAffiliate.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void
+ discountsCreateAffiliate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .define("testaffiliatediscount")
+ .withRegion("global")
+ .withExistingResourceGroup("testrg")
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withProperties(new EntityTypeAffiliateDiscount().withProductCode("fakeTokenPlaceholder")
+ .withStartAt(OffsetDateTime.parse("2023-07-01T00:00:00Z"))
+ .withSystemId("13810867107109237")
+ .withDisplayName("Virtual Machines D Series"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsCreatePrimary.json
+ */
+ /**
+ * Sample code: DiscountsCreatePrimary.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void
+ discountsCreatePrimary(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .define("testprimarydiscount")
+ .withRegion("global")
+ .withExistingResourceGroup("testrg")
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withProperties(new EntityTypePrimaryDiscount().withProductCode("fakeTokenPlaceholder")
+ .withStartAt(OffsetDateTime.parse("2023-07-01T00:00:00Z"))
+ .withDisplayName("Virtual Machines D Series")
+ .withAppliedScopeType(DiscountAppliedScopeType.BILLING_ACCOUNT)
+ .withDiscountTypeProperties(new DiscountTypeProductSku().withApplyDiscountOn(ApplyDiscountOn.PURCHASE)
+ .withDiscountPercentage(14.0F)
+ .withDiscountCombinationRule(DiscountCombinationRule.BEST_OF)
+ .withConditions(Arrays.asList(new ConditionsItem().withConditionName("Cloud")
+ .withValue(Arrays.asList("US-Sec"))
+ .withType("equalAny")))
+ .withProductFamilyName("Azure")
+ .withProductId("DZH318Z0BQ35")
+ .withSkuId("0001"))
+ .withEndAt(OffsetDateTime.parse("2024-07-01T23:59:59Z")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsCreatePrimaryWithCustomPriceMultiCurrency.json
+ */
+ /**
+ * Sample code: DiscountsCreatePrimaryWithCustomPriceMultiCurrency.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountsCreatePrimaryWithCustomPriceMultiCurrency(
+ com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .define("testprimarydiscount")
+ .withRegion("global")
+ .withExistingResourceGroup("testrg")
+ .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder"))
+ .withProperties(
+ new EntityTypePrimaryDiscount().withProductCode("fakeTokenPlaceholder")
+ .withStartAt(OffsetDateTime.parse("2023-07-01T00:00:00Z"))
+ .withDisplayName("Virtual Machines D Series")
+ .withAppliedScopeType(DiscountAppliedScopeType.BILLING_ACCOUNT)
+ .withDiscountTypeProperties(new DiscountTypeCustomPriceMultiCurrency()
+ .withApplyDiscountOn(ApplyDiscountOn.PURCHASE)
+ .withDiscountPercentage(14.0F)
+ .withDiscountCombinationRule(DiscountCombinationRule.BEST_OF)
+ .withConditions(Arrays.asList(new ConditionsItem().withConditionName("Cloud")
+ .withValue(Arrays.asList("US-Sec"))
+ .withType("equalAny")))
+ .withProductFamilyName("Azure")
+ .withProductId("DZH318Z0BQ35")
+ .withSkuId("0001")
+ .withCustomPriceProperties(new CustomPriceProperties()
+ .withRuleType(DiscountRuleType.FIXED_PRICE_LOCK)
+ .withCatalogId("4")
+ .withCatalogClaims(Arrays.asList(
+ new CatalogClaimsItem().withCatalogClaimsItemType("NationalCloud").withValue("USSec")))
+ .withTermUnits("ASI1251A")
+ .withMarketSetPrices(Arrays.asList(
+ new MarketSetPricesItems().withMarkets(Arrays.asList("US"))
+ .withValue(125.16f)
+ .withCurrency("USD"),
+ new MarketSetPricesItems().withMarkets(Arrays.asList("FR"))
+ .withValue(110.16f)
+ .withCurrency("EUR")))))
+ .withEndAt(OffsetDateTime.parse("2024-07-01T23:59:59Z")))
+ .create();
+ }
+
+ // Use "Map.of" if available
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### Discounts_Delete
+
+```java
+/**
+ * Samples for Discounts Delete.
+ */
+public final class DiscountsDeleteSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountsDelete.json
+ */
+ /**
+ * Sample code: ReservationOrderAliasCreate.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void
+ reservationOrderAliasCreate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts().delete("testrg", "testdiscount", com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### Discounts_List
+
+```java
+/**
+ * Samples for Discounts List.
+ */
+public final class DiscountsListSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountList.json
+ */
+ /**
+ * Sample code: DiscountSubscriptionList.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void
+ discountSubscriptionList(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts().list(com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### Discounts_ListByResourceGroup
+
+```java
+/**
+ * Samples for Discounts ListByResourceGroup.
+ */
+public final class DiscountsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * DiscountList.json
+ */
+ /**
+ * Sample code: DiscountsResourceGroupList.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void
+ discountsResourceGroupList(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts().listByResourceGroup("testrg", com.azure.core.util.Context.NONE);
+ }
+}
+```
+
+### Discounts_ScopeList
+
+```java
+/**
+ * Samples for Discounts ScopeList.
+ */
+public final class DiscountsScopeListSamples {
+ /*
+ * x-ms-original-file:
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * ApplicableDiscountsList.json
+ */
+ /**
+ * Sample code: DiscountScopeList.
+ *
+ * @param manager Entry point to BillingBenefitsManager.
+ */
+ public static void discountScopeList(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
+ manager.discounts()
+ .scopeList("providers/Microsoft.Billing/billingAccounts/{acctId}", com.azure.core.util.Context.NONE);
+ }
+}
+```
+
### Operations_List
```java
@@ -41,8 +504,8 @@
public final class OperationsListSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet
- * .json
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
+ * OperationsGet.json
*/
/**
* Sample code: OperationsGet.
@@ -65,7 +528,7 @@ import com.azure.resourcemanager.billingbenefits.models.InstanceFlexibility;
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAliasRequest;
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAliasRequestPropertiesReservedResourceProperties;
import com.azure.resourcemanager.billingbenefits.models.ReservedResourceType;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
/**
@@ -74,7 +537,7 @@ import com.azure.resourcemanager.billingbenefits.models.Term;
public final class ReservationOrderAliasCreateSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* ReservationOrderAliasCreate.json
*/
/**
@@ -86,7 +549,7 @@ public final class ReservationOrderAliasCreateSamples {
reservationOrderAliasCreate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.reservationOrderAlias()
.create("reservationOrderAlias123", new ReservationOrderAliasRequest()
- .withSku(new Sku().withName("Standard_M64s_v2"))
+ .withSku(new ResourceSku().withName("Standard_M64s_v2"))
.withLocation("eastus")
.withDisplayName("ReservationOrder_2022-06-02")
.withBillingScopeId("/subscriptions/10000000-0000-0000-0000-000000000000")
@@ -114,7 +577,7 @@ public final class ReservationOrderAliasCreateSamples {
public final class ReservationOrderAliasGetSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* ReservationOrderAliasGet.json
*/
/**
@@ -137,8 +600,8 @@ import com.azure.resourcemanager.billingbenefits.models.AppliedScopeProperties;
import com.azure.resourcemanager.billingbenefits.models.AppliedScopeType;
import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.CommitmentGrain;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanPurchaseValidateRequest;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import java.util.Arrays;
@@ -148,7 +611,7 @@ import java.util.Arrays;
public final class ResourceProviderValidatePurchaseSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanValidatePurchase.json
*/
/**
@@ -160,7 +623,7 @@ public final class ResourceProviderValidatePurchaseSamples {
savingsPlanValidatePurchase(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.resourceProviders()
.validatePurchaseWithResponse(new SavingsPlanPurchaseValidateRequest().withBenefits(Arrays.asList(
- new SavingsPlanOrderAliasModelInner().withSku(new Sku().withName("Compute_Savings_Plan"))
+ new SavingsPlanOrderAliasModelInner().withSku(new ResourceSku().withName("Compute_Savings_Plan"))
.withDisplayName("ComputeSavingsPlan_2021-07-01")
.withBillingScopeId("/subscriptions/10000000-0000-0000-0000-000000000000")
.withTerm(Term.P1Y)
@@ -170,7 +633,7 @@ public final class ResourceProviderValidatePurchaseSamples {
.withCommitment(new Commitment().withCurrencyCode("fakeTokenPlaceholder")
.withAmount(15.23D)
.withGrain(CommitmentGrain.HOURLY)),
- new SavingsPlanOrderAliasModelInner().withSku(new Sku().withName("Compute_Savings_Plan"))
+ new SavingsPlanOrderAliasModelInner().withSku(new ResourceSku().withName("Compute_Savings_Plan"))
.withDisplayName("ComputeSavingsPlan_2021-07-01")
.withBillingScopeId("/subscriptions/10000000-0000-0000-0000-000000000000")
.withTerm(Term.P1Y)
@@ -194,7 +657,7 @@ public final class ResourceProviderValidatePurchaseSamples {
public final class SavingsPlanGetSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanItemGet.json
*/
/**
@@ -210,7 +673,7 @@ public final class SavingsPlanGetSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanItemExpandedGet.json
*/
/**
@@ -236,7 +699,7 @@ public final class SavingsPlanGetSamples {
public final class SavingsPlanListSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlansInOrderList.json
*/
/**
@@ -260,7 +723,7 @@ public final class SavingsPlanListSamples {
public final class SavingsPlanListAllSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlansList.json
*/
/**
@@ -286,9 +749,9 @@ import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.CommitmentGrain;
import com.azure.resourcemanager.billingbenefits.models.PurchaseRequest;
import com.azure.resourcemanager.billingbenefits.models.RenewProperties;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateRequest;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateRequestProperties;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
/**
@@ -297,7 +760,7 @@ import com.azure.resourcemanager.billingbenefits.models.Term;
public final class SavingsPlanUpdateSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanUpdate.json
*/
/**
@@ -307,7 +770,7 @@ public final class SavingsPlanUpdateSamples {
*/
public static void savingsPlanUpdate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.savingsPlans()
- .updateWithResponse("20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000",
+ .update("20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000",
new SavingsPlanUpdateRequest()
.withProperties(
new SavingsPlanUpdateRequestProperties().withDisplayName("TestDisplayName")
@@ -316,7 +779,7 @@ public final class SavingsPlanUpdateSamples {
"/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg"))
.withRenew(true)
.withRenewProperties(new RenewProperties().withPurchaseProperties(new PurchaseRequest()
- .withSku(new Sku().withName("Compute_Savings_Plan"))
+ .withSku(new ResourceSku().withName("Compute_Savings_Plan"))
.withDisplayName("TestDisplayName_renewed")
.withBillingScopeId("/subscriptions/10000000-0000-0000-0000-000000000000")
.withTerm(Term.P1Y)
@@ -348,7 +811,7 @@ import java.util.Arrays;
public final class SavingsPlanValidateUpdateSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanValidateUpdate.json
*/
/**
@@ -384,7 +847,7 @@ public final class SavingsPlanValidateUpdateSamples {
public final class SavingsPlanOrderElevateSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderElevate.json
*/
/**
@@ -409,7 +872,7 @@ public final class SavingsPlanOrderElevateSamples {
public final class SavingsPlanOrderGetSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderGet.json
*/
/**
@@ -424,7 +887,7 @@ public final class SavingsPlanOrderGetSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderExpandedGet.json
*/
/**
@@ -449,7 +912,7 @@ public final class SavingsPlanOrderGetSamples {
public final class SavingsPlanOrderListSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderList.json
*/
/**
@@ -472,7 +935,7 @@ import com.azure.resourcemanager.billingbenefits.models.AppliedScopeType;
import com.azure.resourcemanager.billingbenefits.models.BillingPlan;
import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.CommitmentGrain;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
/**
@@ -481,7 +944,7 @@ import com.azure.resourcemanager.billingbenefits.models.Term;
public final class SavingsPlanOrderAliasCreateSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderAliasCreate.json
*/
/**
@@ -493,7 +956,7 @@ public final class SavingsPlanOrderAliasCreateSamples {
savingsPlanOrderAliasCreate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.savingsPlanOrderAlias()
.create("spAlias123",
- new SavingsPlanOrderAliasModelInner().withSku(new Sku().withName("Compute_Savings_Plan"))
+ new SavingsPlanOrderAliasModelInner().withSku(new ResourceSku().withName("Compute_Savings_Plan"))
.withDisplayName("Compute_SavingsPlan_10-28-2022_16-38")
.withBillingScopeId("/subscriptions/30000000-0000-0000-0000-000000000000")
.withTerm(Term.P3Y)
@@ -507,7 +970,7 @@ public final class SavingsPlanOrderAliasCreateSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderAliasCreateSingleScope.json
*/
/**
@@ -519,7 +982,7 @@ public final class SavingsPlanOrderAliasCreateSamples {
com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.savingsPlanOrderAlias()
.create("spAlias123", new SavingsPlanOrderAliasModelInner()
- .withSku(new Sku().withName("Compute_Savings_Plan"))
+ .withSku(new ResourceSku().withName("Compute_Savings_Plan"))
.withDisplayName("Compute_SavingsPlan_10-28-2022_16-38")
.withBillingScopeId(
"/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000")
@@ -545,7 +1008,7 @@ public final class SavingsPlanOrderAliasCreateSamples {
public final class SavingsPlanOrderAliasGetSamples {
/*
* x-ms-original-file:
- * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
+ * specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/preview/2024-11-01-preview/examples/
* SavingsPlanOrderAliasGet.json
*/
/**
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml
index 2ed57d98c849..3ef82bcbc7ca 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml
@@ -18,7 +18,7 @@
jar
Microsoft Azure SDK for BillingBenefits Management
- This package contains Microsoft Azure SDK for BillingBenefits Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Benefits RP let users create and manage benefits like savings plan. Package tag package-2022-11-01.
+ This package contains Microsoft Azure SDK for BillingBenefits Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Benefits RP let users create and manage benefits like savings plan. Package tag package-preview-2024-11-01-preview.
https://github.com/Azure/azure-sdk-for-java
@@ -46,6 +46,7 @@
0
0
true
+ false
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/BillingBenefitsManager.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/BillingBenefitsManager.java
index 55d5be3b8c23..c60298143fd9 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/BillingBenefitsManager.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/BillingBenefitsManager.java
@@ -11,6 +11,7 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -19,18 +20,22 @@
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
-import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.billingbenefits.fluent.BillingBenefitsRP;
import com.azure.resourcemanager.billingbenefits.implementation.BillingBenefitsRPBuilder;
+import com.azure.resourcemanager.billingbenefits.implementation.DiscountOperationsImpl;
+import com.azure.resourcemanager.billingbenefits.implementation.DiscountsImpl;
import com.azure.resourcemanager.billingbenefits.implementation.OperationsImpl;
import com.azure.resourcemanager.billingbenefits.implementation.ReservationOrderAliasImpl;
import com.azure.resourcemanager.billingbenefits.implementation.ResourceProvidersImpl;
import com.azure.resourcemanager.billingbenefits.implementation.SavingsPlanOrderAliasImpl;
import com.azure.resourcemanager.billingbenefits.implementation.SavingsPlanOrdersImpl;
import com.azure.resourcemanager.billingbenefits.implementation.SavingsPlansImpl;
+import com.azure.resourcemanager.billingbenefits.models.DiscountOperations;
+import com.azure.resourcemanager.billingbenefits.models.Discounts;
import com.azure.resourcemanager.billingbenefits.models.Operations;
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAlias;
import com.azure.resourcemanager.billingbenefits.models.ResourceProviders;
@@ -41,6 +46,7 @@
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -61,6 +67,10 @@ public final class BillingBenefitsManager {
private ReservationOrderAlias reservationOrderAlias;
+ private Discounts discounts;
+
+ private DiscountOperations discountOperations;
+
private final BillingBenefitsRP clientObject;
private BillingBenefitsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
@@ -68,6 +78,7 @@ private BillingBenefitsManager(HttpPipeline httpPipeline, AzureProfile profile,
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject = new BillingBenefitsRPBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
.buildClient();
}
@@ -112,6 +123,9 @@ public static Configurable configure() {
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
+ private static final String SDK_VERSION = "version";
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-resourcemanager-billingbenefits.properties");
private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
@@ -219,12 +233,14 @@ public BillingBenefitsManager authenticate(TokenCredential credential, AzureProf
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.billingbenefits")
.append("/")
- .append("1.0.0-beta.2");
+ .append(clientVersion);
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -257,7 +273,7 @@ public BillingBenefitsManager authenticate(TokenCredential credential, AzureProf
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
- policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
@@ -342,6 +358,30 @@ public ReservationOrderAlias reservationOrderAlias() {
return reservationOrderAlias;
}
+ /**
+ * Gets the resource collection API of Discounts. It manages Discount.
+ *
+ * @return Resource collection API of Discounts.
+ */
+ public Discounts discounts() {
+ if (this.discounts == null) {
+ this.discounts = new DiscountsImpl(clientObject.getDiscounts(), this);
+ }
+ return discounts;
+ }
+
+ /**
+ * Gets the resource collection API of DiscountOperations.
+ *
+ * @return Resource collection API of DiscountOperations.
+ */
+ public DiscountOperations discountOperations() {
+ if (this.discountOperations == null) {
+ this.discountOperations = new DiscountOperationsImpl(clientObject.getDiscountOperations(), this);
+ }
+ return discountOperations;
+ }
+
/**
* Gets wrapped service client BillingBenefitsRP providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/BillingBenefitsRP.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/BillingBenefitsRP.java
index 447697348deb..470df3646881 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/BillingBenefitsRP.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/BillingBenefitsRP.java
@@ -11,6 +11,13 @@
* The interface for BillingBenefitsRP class.
*/
public interface BillingBenefitsRP {
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
/**
* Gets server parameter.
*
@@ -80,4 +87,18 @@ public interface BillingBenefitsRP {
* @return the ReservationOrderAliasClient object.
*/
ReservationOrderAliasClient getReservationOrderAlias();
+
+ /**
+ * Gets the DiscountsClient object to access its operations.
+ *
+ * @return the DiscountsClient object.
+ */
+ DiscountsClient getDiscounts();
+
+ /**
+ * Gets the DiscountOperationsClient object to access its operations.
+ *
+ * @return the DiscountOperationsClient object.
+ */
+ DiscountOperationsClient getDiscountOperations();
}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/DiscountOperationsClient.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/DiscountOperationsClient.java
new file mode 100644
index 000000000000..d0afa3ed3c4d
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/DiscountOperationsClient.java
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import com.azure.resourcemanager.billingbenefits.models.DiscountPatchRequest;
+
+/**
+ * An instance of this class provides access to all the operations defined in DiscountOperationsClient.
+ */
+public interface DiscountOperationsClient {
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String discountName,
+ Context context);
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner getByResourceGroup(String resourceGroupName, String discountName);
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiscountInner> beginUpdate(String resourceGroupName, String discountName,
+ DiscountPatchRequest body);
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 the {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiscountInner> beginUpdate(String resourceGroupName, String discountName,
+ DiscountPatchRequest body, Context context);
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner update(String resourceGroupName, String discountName, DiscountPatchRequest body);
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner update(String resourceGroupName, String discountName, DiscountPatchRequest body, Context context);
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/DiscountsClient.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/DiscountsClient.java
new file mode 100644
index 000000000000..48df5082bd3d
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/DiscountsClient.java
@@ -0,0 +1,257 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in DiscountsClient.
+ */
+public interface DiscountsClient {
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiscountInner> beginCreate(String resourceGroupName, String discountName,
+ DiscountInner body);
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 the {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiscountInner> beginCreate(String resourceGroupName, String discountName,
+ DiscountInner body, Context context);
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner create(String resourceGroupName, String discountName, DiscountInner body);
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner create(String resourceGroupName, String discountName, DiscountInner body, Context context);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String discountName);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String discountName, Context context);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String discountName);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String discountName, Context context);
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiscountInner> beginCancel(String resourceGroupName, String discountName);
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiscountInner> beginCancel(String resourceGroupName, String discountName,
+ Context context);
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner cancel(String resourceGroupName, String discountName);
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiscountInner cancel(String resourceGroupName, String discountName, Context context);
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable scopeList(String scope);
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable scopeList(String scope, Context context);
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/SavingsPlansClient.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/SavingsPlansClient.java
index 736a77c48e07..47a19c933b71 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/SavingsPlansClient.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/SavingsPlansClient.java
@@ -8,12 +8,13 @@
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.billingbenefits.fluent.models.SavingsPlanModelInner;
import com.azure.resourcemanager.billingbenefits.fluent.models.SavingsPlanValidateResponseInner;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateRequest;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateValidateRequest;
-import com.azure.resourcemanager.billingbenefits.models.SavingsPlansUpdateResponse;
/**
* An instance of this class provides access to all the operations defined in SavingsPlansClient.
@@ -107,6 +108,23 @@ Response getWithResponse(String savingsPlanOrderId, Strin
@ServiceMethod(returns = ReturnType.SINGLE)
SavingsPlanModelInner get(String savingsPlanOrderId, String savingsPlanId);
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SavingsPlanModelInner> beginUpdate(String savingsPlanOrderId,
+ String savingsPlanId, SavingsPlanUpdateRequest body);
+
/**
* Update savings plan.
*
@@ -119,11 +137,27 @@ Response getWithResponse(String savingsPlanOrderId, Strin
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
* status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SavingsPlanModelInner> beginUpdate(String savingsPlanOrderId,
+ String savingsPlanId, SavingsPlanUpdateRequest body, Context context);
+
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return savings plan.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- SavingsPlansUpdateResponse updateWithResponse(String savingsPlanOrderId, String savingsPlanId,
- SavingsPlanUpdateRequest body, Context context);
+ SavingsPlanModelInner update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body);
/**
* Update savings plan.
@@ -131,6 +165,7 @@ SavingsPlansUpdateResponse updateWithResponse(String savingsPlanOrderId, String
* @param savingsPlanOrderId Order ID of the savings plan.
* @param savingsPlanId ID of the savings plan.
* @param body Request body for patching a savings plan order alias.
+ * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
@@ -139,7 +174,8 @@ SavingsPlansUpdateResponse updateWithResponse(String savingsPlanOrderId, String
* @return savings plan.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- SavingsPlanModelInner update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body);
+ SavingsPlanModelInner update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body,
+ Context context);
/**
* Validate savings plan patch.
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/DiscountInner.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/DiscountInner.java
new file mode 100644
index 000000000000..4857bfdd3217
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/DiscountInner.java
@@ -0,0 +1,289 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.billingbenefits.models.DiscountProperties;
+import com.azure.resourcemanager.billingbenefits.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.billingbenefits.models.Plan;
+import com.azure.resourcemanager.billingbenefits.models.ResourceModelWithAllowedPropertySet;
+import com.azure.resourcemanager.billingbenefits.models.Sku;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Resource definition for Discounts.
+ */
+@Fluent
+public final class DiscountInner extends ResourceModelWithAllowedPropertySet {
+ /*
+ * Discount properties
+ */
+ private DiscountProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header
+ * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested
+ * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section
+ * 14.26), and If-Range (section 14.27) header fields.
+ */
+ private String etag;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of DiscountInner class.
+ */
+ public DiscountInner() {
+ }
+
+ /**
+ * Get the properties property: Discount properties.
+ *
+ * @return the properties value.
+ */
+ public DiscountProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Discount properties.
+ *
+ * @param properties the properties value to set.
+ * @return the DiscountInner object itself.
+ */
+ public DiscountInner withProperties(DiscountProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ @Override
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be
+ * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from
+ * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24),
+ * If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ *
+ * @return the etag value.
+ */
+ @Override
+ public String etag() {
+ return this.etag;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withManagedBy(String managedBy) {
+ super.withManagedBy(managedBy);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withKind(String kind) {
+ super.withKind(kind);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withIdentity(ManagedServiceIdentity identity) {
+ super.withIdentity(identity);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withSku(Sku sku) {
+ super.withSku(sku);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withPlan(Plan plan) {
+ super.withPlan(plan);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (sku() != null) {
+ sku().validate();
+ }
+ if (plan() != null) {
+ plan().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("managedBy", managedBy());
+ jsonWriter.writeStringField("kind", kind());
+ jsonWriter.writeJsonField("identity", identity());
+ jsonWriter.writeJsonField("sku", sku());
+ jsonWriter.writeJsonField("plan", plan());
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountInner.
+ */
+ public static DiscountInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountInner deserializedDiscountInner = new DiscountInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedDiscountInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedDiscountInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedDiscountInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedDiscountInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedDiscountInner.withTags(tags);
+ } else if ("managedBy".equals(fieldName)) {
+ deserializedDiscountInner.withManagedBy(reader.getString());
+ } else if ("kind".equals(fieldName)) {
+ deserializedDiscountInner.withKind(reader.getString());
+ } else if ("etag".equals(fieldName)) {
+ deserializedDiscountInner.etag = reader.getString();
+ } else if ("identity".equals(fieldName)) {
+ deserializedDiscountInner.withIdentity(ManagedServiceIdentity.fromJson(reader));
+ } else if ("sku".equals(fieldName)) {
+ deserializedDiscountInner.withSku(Sku.fromJson(reader));
+ } else if ("plan".equals(fieldName)) {
+ deserializedDiscountInner.withPlan(Plan.fromJson(reader));
+ } else if ("systemData".equals(fieldName)) {
+ deserializedDiscountInner.systemData = SystemData.fromJson(reader);
+ } else if ("properties".equals(fieldName)) {
+ deserializedDiscountInner.properties = DiscountProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountInner;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/DiscountPatchRequestProperties.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/DiscountPatchRequestProperties.java
new file mode 100644
index 000000000000..b6de4cb9e75a
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/DiscountPatchRequestProperties.java
@@ -0,0 +1,94 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Discounts patch request properties.
+ */
+@Fluent
+public final class DiscountPatchRequestProperties implements JsonSerializable {
+ /*
+ * Display name
+ */
+ private String displayName;
+
+ /**
+ * Creates an instance of DiscountPatchRequestProperties class.
+ */
+ public DiscountPatchRequestProperties() {
+ }
+
+ /**
+ * Get the displayName property: Display name.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: Display name.
+ *
+ * @param displayName the displayName value to set.
+ * @return the DiscountPatchRequestProperties object itself.
+ */
+ public DiscountPatchRequestProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("displayName", this.displayName);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountPatchRequestProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountPatchRequestProperties if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the DiscountPatchRequestProperties.
+ */
+ public static DiscountPatchRequestProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountPatchRequestProperties deserializedDiscountPatchRequestProperties
+ = new DiscountPatchRequestProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("displayName".equals(fieldName)) {
+ deserializedDiscountPatchRequestProperties.displayName = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountPatchRequestProperties;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/ReservationOrderAliasResponseInner.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/ReservationOrderAliasResponseInner.java
index 58008001fe2b..2efba63ea29d 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/ReservationOrderAliasResponseInner.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/ReservationOrderAliasResponseInner.java
@@ -17,7 +17,7 @@
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAliasResponsePropertiesReservedResourceProperties;
import com.azure.resourcemanager.billingbenefits.models.ReservedResourceType;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import java.io.IOException;
import java.time.OffsetDateTime;
@@ -30,7 +30,7 @@ public final class ReservationOrderAliasResponseInner extends ProxyResource {
/*
* Reservation order SKU
*/
- private Sku sku;
+ private ResourceSku sku;
/*
* The Azure Region where the reserved resource lives.
@@ -73,7 +73,7 @@ public ReservationOrderAliasResponseInner() {
*
* @return the sku value.
*/
- public Sku sku() {
+ public ResourceSku sku() {
return this.sku;
}
@@ -83,7 +83,7 @@ public Sku sku() {
* @param sku the sku value to set.
* @return the ReservationOrderAliasResponseInner object itself.
*/
- public ReservationOrderAliasResponseInner withSku(Sku sku) {
+ public ReservationOrderAliasResponseInner withSku(ResourceSku sku) {
this.sku = sku;
return this;
}
@@ -493,7 +493,7 @@ public static ReservationOrderAliasResponseInner fromJson(JsonReader jsonReader)
} else if ("type".equals(fieldName)) {
deserializedReservationOrderAliasResponseInner.type = reader.getString();
} else if ("sku".equals(fieldName)) {
- deserializedReservationOrderAliasResponseInner.sku = Sku.fromJson(reader);
+ deserializedReservationOrderAliasResponseInner.sku = ResourceSku.fromJson(reader);
} else if ("location".equals(fieldName)) {
deserializedReservationOrderAliasResponseInner.location = reader.getString();
} else if ("properties".equals(fieldName)) {
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanModelInner.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanModelInner.java
index c5a1cbfd2618..64317bddf5c8 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanModelInner.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanModelInner.java
@@ -18,7 +18,7 @@
import com.azure.resourcemanager.billingbenefits.models.ExtendedStatusInfo;
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
import com.azure.resourcemanager.billingbenefits.models.RenewProperties;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import com.azure.resourcemanager.billingbenefits.models.Utilization;
import java.io.IOException;
@@ -32,7 +32,7 @@ public final class SavingsPlanModelInner extends ProxyResource {
/*
* Savings plan SKU
*/
- private Sku sku;
+ private ResourceSku sku;
/*
* Savings plan properties
@@ -70,7 +70,7 @@ public SavingsPlanModelInner() {
*
* @return the sku value.
*/
- public Sku sku() {
+ public ResourceSku sku() {
return this.sku;
}
@@ -80,7 +80,7 @@ public Sku sku() {
* @param sku the sku value to set.
* @return the SavingsPlanModelInner object itself.
*/
- public SavingsPlanModelInner withSku(Sku sku) {
+ public SavingsPlanModelInner withSku(ResourceSku sku) {
this.sku = sku;
return this;
}
@@ -572,7 +572,7 @@ public static SavingsPlanModelInner fromJson(JsonReader jsonReader) throws IOExc
} else if ("type".equals(fieldName)) {
deserializedSavingsPlanModelInner.type = reader.getString();
} else if ("sku".equals(fieldName)) {
- deserializedSavingsPlanModelInner.sku = Sku.fromJson(reader);
+ deserializedSavingsPlanModelInner.sku = ResourceSku.fromJson(reader);
} else if ("properties".equals(fieldName)) {
deserializedSavingsPlanModelInner.innerProperties = SavingsPlanModelProperties.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderAliasModelInner.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderAliasModelInner.java
index 7f21d3650adb..453420d007f8 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderAliasModelInner.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderAliasModelInner.java
@@ -16,7 +16,7 @@
import com.azure.resourcemanager.billingbenefits.models.BillingPlan;
import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import java.io.IOException;
@@ -28,7 +28,7 @@ public final class SavingsPlanOrderAliasModelInner extends ProxyResource {
/*
* Savings plan SKU
*/
- private Sku sku;
+ private ResourceSku sku;
/*
* Resource provider kind
@@ -71,7 +71,7 @@ public SavingsPlanOrderAliasModelInner() {
*
* @return the sku value.
*/
- public Sku sku() {
+ public ResourceSku sku() {
return this.sku;
}
@@ -81,7 +81,7 @@ public Sku sku() {
* @param sku the sku value to set.
* @return the SavingsPlanOrderAliasModelInner object itself.
*/
- public SavingsPlanOrderAliasModelInner withSku(Sku sku) {
+ public SavingsPlanOrderAliasModelInner withSku(ResourceSku sku) {
this.sku = sku;
return this;
}
@@ -418,7 +418,7 @@ public static SavingsPlanOrderAliasModelInner fromJson(JsonReader jsonReader) th
} else if ("type".equals(fieldName)) {
deserializedSavingsPlanOrderAliasModelInner.type = reader.getString();
} else if ("sku".equals(fieldName)) {
- deserializedSavingsPlanOrderAliasModelInner.sku = Sku.fromJson(reader);
+ deserializedSavingsPlanOrderAliasModelInner.sku = ResourceSku.fromJson(reader);
} else if ("kind".equals(fieldName)) {
deserializedSavingsPlanOrderAliasModelInner.kind = reader.getString();
} else if ("properties".equals(fieldName)) {
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderModelInner.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderModelInner.java
index 28206530409f..e208ab6bbc28 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderModelInner.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/fluent/models/SavingsPlanOrderModelInner.java
@@ -15,7 +15,7 @@
import com.azure.resourcemanager.billingbenefits.models.BillingPlanInformation;
import com.azure.resourcemanager.billingbenefits.models.ExtendedStatusInfo;
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import java.io.IOException;
import java.time.OffsetDateTime;
@@ -29,7 +29,7 @@ public final class SavingsPlanOrderModelInner extends ProxyResource {
/*
* Savings plan SKU
*/
- private Sku sku;
+ private ResourceSku sku;
/*
* Savings plan order properties
@@ -67,7 +67,7 @@ public SavingsPlanOrderModelInner() {
*
* @return the sku value.
*/
- public Sku sku() {
+ public ResourceSku sku() {
return this.sku;
}
@@ -77,7 +77,7 @@ public Sku sku() {
* @param sku the sku value to set.
* @return the SavingsPlanOrderModelInner object itself.
*/
- public SavingsPlanOrderModelInner withSku(Sku sku) {
+ public SavingsPlanOrderModelInner withSku(ResourceSku sku) {
this.sku = sku;
return this;
}
@@ -403,7 +403,7 @@ public static SavingsPlanOrderModelInner fromJson(JsonReader jsonReader) throws
} else if ("type".equals(fieldName)) {
deserializedSavingsPlanOrderModelInner.type = reader.getString();
} else if ("sku".equals(fieldName)) {
- deserializedSavingsPlanOrderModelInner.sku = Sku.fromJson(reader);
+ deserializedSavingsPlanOrderModelInner.sku = ResourceSku.fromJson(reader);
} else if ("properties".equals(fieldName)) {
deserializedSavingsPlanOrderModelInner.innerProperties
= SavingsPlanOrderModelProperties.fromJson(reader);
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPBuilder.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPBuilder.java
index ae4cc07c2574..e3bddef1e5cd 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPBuilder.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPBuilder.java
@@ -19,6 +19,22 @@
*/
@ServiceClientBuilder(serviceClients = { BillingBenefitsRPImpl.class })
public final class BillingBenefitsRPBuilder {
+ /*
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the BillingBenefitsRPBuilder.
+ */
+ public BillingBenefitsRPBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
/*
* server parameter
*/
@@ -116,7 +132,7 @@ public BillingBenefitsRPImpl buildClient() {
? serializerAdapter
: SerializerFactory.createDefaultManagementSerializerAdapter();
BillingBenefitsRPImpl client = new BillingBenefitsRPImpl(localPipeline, localSerializerAdapter,
- localDefaultPollInterval, localEnvironment, localEndpoint);
+ localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);
return client;
}
}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPImpl.java
index 0397636846d7..e12faffb4b48 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/BillingBenefitsRPImpl.java
@@ -24,6 +24,8 @@
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.billingbenefits.fluent.BillingBenefitsRP;
+import com.azure.resourcemanager.billingbenefits.fluent.DiscountOperationsClient;
+import com.azure.resourcemanager.billingbenefits.fluent.DiscountsClient;
import com.azure.resourcemanager.billingbenefits.fluent.OperationsClient;
import com.azure.resourcemanager.billingbenefits.fluent.ReservationOrderAliasClient;
import com.azure.resourcemanager.billingbenefits.fluent.ResourceProvidersClient;
@@ -44,6 +46,20 @@
*/
@ServiceClient(builder = BillingBenefitsRPBuilder.class)
public final class BillingBenefitsRPImpl implements BillingBenefitsRP {
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
/**
* server parameter.
*/
@@ -198,6 +214,34 @@ public ReservationOrderAliasClient getReservationOrderAlias() {
return this.reservationOrderAlias;
}
+ /**
+ * The DiscountsClient object to access its operations.
+ */
+ private final DiscountsClient discounts;
+
+ /**
+ * Gets the DiscountsClient object to access its operations.
+ *
+ * @return the DiscountsClient object.
+ */
+ public DiscountsClient getDiscounts() {
+ return this.discounts;
+ }
+
+ /**
+ * The DiscountOperationsClient object to access its operations.
+ */
+ private final DiscountOperationsClient discountOperations;
+
+ /**
+ * Gets the DiscountOperationsClient object to access its operations.
+ *
+ * @return the DiscountOperationsClient object.
+ */
+ public DiscountOperationsClient getDiscountOperations() {
+ return this.discountOperations;
+ }
+
/**
* Initializes an instance of BillingBenefitsRP client.
*
@@ -205,21 +249,25 @@ public ReservationOrderAliasClient getReservationOrderAlias() {
* @param serializerAdapter The serializer to serialize an object into a string.
* @param defaultPollInterval The default poll interval for long-running operation.
* @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
* @param endpoint server parameter.
*/
BillingBenefitsRPImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval,
- AzureEnvironment environment, String endpoint) {
+ AzureEnvironment environment, String subscriptionId, String endpoint) {
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
- this.apiVersion = "2022-11-01";
+ this.apiVersion = "2024-11-01-preview";
this.operations = new OperationsClientImpl(this);
this.savingsPlanOrderAlias = new SavingsPlanOrderAliasClientImpl(this);
this.savingsPlanOrders = new SavingsPlanOrdersClientImpl(this);
this.savingsPlans = new SavingsPlansClientImpl(this);
this.resourceProviders = new ResourceProvidersClientImpl(this);
this.reservationOrderAlias = new ReservationOrderAliasClientImpl(this);
+ this.discounts = new DiscountsClientImpl(this);
+ this.discountOperations = new DiscountOperationsClientImpl(this);
}
/**
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountImpl.java
new file mode 100644
index 000000000000..18ee186c769d
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountImpl.java
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import com.azure.resourcemanager.billingbenefits.models.Discount;
+import com.azure.resourcemanager.billingbenefits.models.DiscountProperties;
+import com.azure.resourcemanager.billingbenefits.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.billingbenefits.models.Plan;
+import com.azure.resourcemanager.billingbenefits.models.Sku;
+import java.util.Collections;
+import java.util.Map;
+
+public final class DiscountImpl implements Discount, Discount.Definition {
+ private DiscountInner innerObject;
+
+ private final com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager;
+
+ DiscountImpl(DiscountInner innerObject,
+ com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public String managedBy() {
+ return this.innerModel().managedBy();
+ }
+
+ public String kind() {
+ return this.innerModel().kind();
+ }
+
+ public String etag() {
+ return this.innerModel().etag();
+ }
+
+ public ManagedServiceIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public Sku sku() {
+ return this.innerModel().sku();
+ }
+
+ public Plan plan() {
+ return this.innerModel().plan();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public DiscountProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public DiscountInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String discountName;
+
+ public DiscountImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public Discount create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getDiscounts()
+ .create(resourceGroupName, discountName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public Discount create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getDiscounts()
+ .create(resourceGroupName, discountName, this.innerModel(), context);
+ return this;
+ }
+
+ DiscountImpl(String name, com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager) {
+ this.innerObject = new DiscountInner();
+ this.serviceManager = serviceManager;
+ this.discountName = name;
+ }
+
+ public Discount cancel() {
+ return serviceManager.discounts().cancel(resourceGroupName, discountName);
+ }
+
+ public Discount cancel(Context context) {
+ return serviceManager.discounts().cancel(resourceGroupName, discountName, context);
+ }
+
+ public DiscountImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public DiscountImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public DiscountImpl withTags(Map tags) {
+ this.innerModel().withTags(tags);
+ return this;
+ }
+
+ public DiscountImpl withManagedBy(String managedBy) {
+ this.innerModel().withManagedBy(managedBy);
+ return this;
+ }
+
+ public DiscountImpl withKind(String kind) {
+ this.innerModel().withKind(kind);
+ return this;
+ }
+
+ public DiscountImpl withIdentity(ManagedServiceIdentity identity) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ }
+
+ public DiscountImpl withSku(Sku sku) {
+ this.innerModel().withSku(sku);
+ return this;
+ }
+
+ public DiscountImpl withPlan(Plan plan) {
+ this.innerModel().withPlan(plan);
+ return this;
+ }
+
+ public DiscountImpl withProperties(DiscountProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountOperationsClientImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountOperationsClientImpl.java
new file mode 100644
index 000000000000..f5c79678f1f8
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountOperationsClientImpl.java
@@ -0,0 +1,433 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.billingbenefits.fluent.DiscountOperationsClient;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import com.azure.resourcemanager.billingbenefits.models.DiscountPatchRequest;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in DiscountOperationsClient.
+ */
+public final class DiscountOperationsClientImpl implements DiscountOperationsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DiscountOperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final BillingBenefitsRPImpl client;
+
+ /**
+ * Initializes an instance of DiscountOperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DiscountOperationsClientImpl(BillingBenefitsRPImpl client) {
+ this.service = RestProxy.create(DiscountOperationsService.class, client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for BillingBenefitsRPDiscountOperations to be used by the proxy service
+ * to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "BillingBenefitsRPDis")
+ public interface DiscountOperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/discounts/{discountName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("discountName") String discountName,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/discounts/{discountName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("discountName") String discountName,
+ @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DiscountPatchRequest body,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String discountName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, discountName, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String discountName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
+ discountName, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String discountName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, discountName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String discountName,
+ Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, discountName, context).block();
+ }
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner getByResourceGroup(String resourceGroupName, String discountName) {
+ return getByResourceGroupWithResponse(resourceGroupName, discountName, Context.NONE).getValue();
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String discountName,
+ DiscountPatchRequest body) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, discountName, this.client.getApiVersion(), body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String discountName,
+ DiscountPatchRequest body, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
+ discountName, this.client.getApiVersion(), body, accept, context);
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 {@link PollerFlux} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, DiscountInner> beginUpdateAsync(String resourceGroupName,
+ String discountName, DiscountPatchRequest body) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, discountName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ DiscountInner.class, DiscountInner.class, this.client.getContext());
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 the {@link PollerFlux} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, DiscountInner> beginUpdateAsync(String resourceGroupName,
+ String discountName, DiscountPatchRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, discountName, body, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ DiscountInner.class, DiscountInner.class, context);
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, DiscountInner> beginUpdate(String resourceGroupName,
+ String discountName, DiscountPatchRequest body) {
+ return this.beginUpdateAsync(resourceGroupName, discountName, body).getSyncPoller();
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 the {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, DiscountInner> beginUpdate(String resourceGroupName,
+ String discountName, DiscountPatchRequest body, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, discountName, body, context).getSyncPoller();
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String discountName, DiscountPatchRequest body) {
+ return beginUpdateAsync(resourceGroupName, discountName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String discountName, DiscountPatchRequest body,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, discountName, body, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner update(String resourceGroupName, String discountName, DiscountPatchRequest body) {
+ return updateAsync(resourceGroupName, discountName, body).block();
+ }
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner update(String resourceGroupName, String discountName, DiscountPatchRequest body,
+ Context context) {
+ return updateAsync(resourceGroupName, discountName, body, context).block();
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountOperationsImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountOperationsImpl.java
new file mode 100644
index 000000000000..1db01b91e590
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountOperationsImpl.java
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.billingbenefits.fluent.DiscountOperationsClient;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import com.azure.resourcemanager.billingbenefits.models.Discount;
+import com.azure.resourcemanager.billingbenefits.models.DiscountOperations;
+import com.azure.resourcemanager.billingbenefits.models.DiscountPatchRequest;
+
+public final class DiscountOperationsImpl implements DiscountOperations {
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountOperationsImpl.class);
+
+ private final DiscountOperationsClient innerClient;
+
+ private final com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager;
+
+ public DiscountOperationsImpl(DiscountOperationsClient innerClient,
+ com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String discountName,
+ Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, discountName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new DiscountImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Discount getByResourceGroup(String resourceGroupName, String discountName) {
+ DiscountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, discountName);
+ if (inner != null) {
+ return new DiscountImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Discount update(String resourceGroupName, String discountName, DiscountPatchRequest body) {
+ DiscountInner inner = this.serviceClient().update(resourceGroupName, discountName, body);
+ if (inner != null) {
+ return new DiscountImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Discount update(String resourceGroupName, String discountName, DiscountPatchRequest body, Context context) {
+ DiscountInner inner = this.serviceClient().update(resourceGroupName, discountName, body, context);
+ if (inner != null) {
+ return new DiscountImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private DiscountOperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountsClientImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountsClientImpl.java
new file mode 100644
index 000000000000..debd8030dbdf
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountsClientImpl.java
@@ -0,0 +1,1279 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.billingbenefits.fluent.DiscountsClient;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import com.azure.resourcemanager.billingbenefits.models.DiscountList;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in DiscountsClient.
+ */
+public final class DiscountsClientImpl implements DiscountsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DiscountsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final BillingBenefitsRPImpl client;
+
+ /**
+ * Initializes an instance of DiscountsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DiscountsClientImpl(BillingBenefitsRPImpl client) {
+ this.service
+ = RestProxy.create(DiscountsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for BillingBenefitsRPDiscounts to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "BillingBenefitsRPDis")
+ public interface DiscountsService {
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/discounts/{discountName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("discountName") String discountName,
+ @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DiscountInner body,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/discounts/{discountName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("discountName") String discountName,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/discounts")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.BillingBenefits/discounts")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/discounts/{discountName}/cancel")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> cancel(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("discountName") String discountName,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{scope}/providers/Microsoft.BillingBenefits/applicableDiscounts")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> scopeList(@HostParam("$host") String endpoint, @PathParam("scope") String scope,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> resourceGroupListNext(
+ @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> subscriptionListNext(
+ @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> scopeListNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(String resourceGroupName, String discountName,
+ DiscountInner body) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, discountName, this.client.getApiVersion(), body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(String resourceGroupName, String discountName,
+ DiscountInner body, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
+ discountName, this.client.getApiVersion(), body, accept, context);
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 {@link PollerFlux} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, DiscountInner> beginCreateAsync(String resourceGroupName,
+ String discountName, DiscountInner body) {
+ Mono>> mono = createWithResponseAsync(resourceGroupName, discountName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ DiscountInner.class, DiscountInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 the {@link PollerFlux} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, DiscountInner> beginCreateAsync(String resourceGroupName,
+ String discountName, DiscountInner body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = createWithResponseAsync(resourceGroupName, discountName, body, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ DiscountInner.class, DiscountInner.class, context);
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, DiscountInner> beginCreate(String resourceGroupName,
+ String discountName, DiscountInner body) {
+ return this.beginCreateAsync(resourceGroupName, discountName, body).getSyncPoller();
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 the {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, DiscountInner> beginCreate(String resourceGroupName,
+ String discountName, DiscountInner body, Context context) {
+ return this.beginCreateAsync(resourceGroupName, discountName, body, context).getSyncPoller();
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(String resourceGroupName, String discountName, DiscountInner body) {
+ return beginCreateAsync(resourceGroupName, discountName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(String resourceGroupName, String discountName, DiscountInner body,
+ Context context) {
+ return beginCreateAsync(resourceGroupName, discountName, body, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner create(String resourceGroupName, String discountName, DiscountInner body) {
+ return createAsync(resourceGroupName, discountName, body).block();
+ }
+
+ /**
+ * Create discount.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for creating a discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner create(String resourceGroupName, String discountName, DiscountInner body, Context context) {
+ return createAsync(resourceGroupName, discountName, body, context).block();
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String discountName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, discountName, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String discountName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
+ discountName, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String discountName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, discountName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String discountName,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, discountName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String discountName) {
+ return this.beginDeleteAsync(resourceGroupName, discountName).getSyncPoller();
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String discountName,
+ Context context) {
+ return this.beginDeleteAsync(resourceGroupName, discountName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String discountName) {
+ return beginDeleteAsync(resourceGroupName, discountName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String discountName, Context context) {
+ return beginDeleteAsync(resourceGroupName, discountName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String discountName) {
+ deleteAsync(resourceGroupName, discountName).block();
+ }
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String discountName, Context context) {
+ deleteAsync(resourceGroupName, discountName, context).block();
+ }
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(),
+ this.client.getSubscriptionId(), resourceGroupName, 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()));
+ }
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
+ this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> resourceGroupListNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> resourceGroupListNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ 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()));
+ }
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept,
+ context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> subscriptionListNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> subscriptionListNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> cancelWithResponseAsync(String resourceGroupName, String discountName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, discountName, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> cancelWithResponseAsync(String resourceGroupName, String discountName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (discountName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter discountName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
+ discountName, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link PollerFlux} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, DiscountInner> beginCancelAsync(String resourceGroupName,
+ String discountName) {
+ Mono>> mono = cancelWithResponseAsync(resourceGroupName, discountName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ DiscountInner.class, DiscountInner.class, this.client.getContext());
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link PollerFlux} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, DiscountInner> beginCancelAsync(String resourceGroupName,
+ String discountName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = cancelWithResponseAsync(resourceGroupName, discountName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ DiscountInner.class, DiscountInner.class, context);
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, DiscountInner> beginCancel(String resourceGroupName,
+ String discountName) {
+ return this.beginCancelAsync(resourceGroupName, discountName).getSyncPoller();
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 the {@link SyncPoller} for polling of resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, DiscountInner> beginCancel(String resourceGroupName,
+ String discountName, Context context) {
+ return this.beginCancelAsync(resourceGroupName, discountName, context).getSyncPoller();
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono cancelAsync(String resourceGroupName, String discountName) {
+ return beginCancelAsync(resourceGroupName, discountName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono cancelAsync(String resourceGroupName, String discountName, Context context) {
+ return beginCancelAsync(resourceGroupName, discountName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner cancel(String resourceGroupName, String discountName) {
+ return cancelAsync(resourceGroupName, discountName).block();
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiscountInner cancel(String resourceGroupName, String discountName, Context context) {
+ return cancelAsync(resourceGroupName, discountName, context).block();
+ }
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> scopeListSinglePageAsync(String scope) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.scopeList(this.client.getEndpoint(), scope, 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()));
+ }
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> scopeListSinglePageAsync(String scope, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.scopeList(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux scopeListAsync(String scope) {
+ return new PagedFlux<>(() -> scopeListSinglePageAsync(scope),
+ nextLink -> scopeListNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux scopeListAsync(String scope, Context context) {
+ return new PagedFlux<>(() -> scopeListSinglePageAsync(scope, context),
+ nextLink -> scopeListNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable scopeList(String scope) {
+ return new PagedIterable<>(scopeListAsync(scope));
+ }
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable scopeList(String scope, Context context) {
+ return new PagedIterable<>(scopeListAsync(scope, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> resourceGroupListNextSinglePageAsync(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.resourceGroupListNext(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 URL to get the next list of items.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> resourceGroupListNextSinglePageAsync(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.resourceGroupListNext(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 URL to get the next list of items.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> subscriptionListNextSinglePageAsync(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.subscriptionListNext(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 URL to get the next list of items.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> subscriptionListNextSinglePageAsync(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.subscriptionListNext(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 URL to get the next list of items.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> scopeListNextSinglePageAsync(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.scopeListNext(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 URL to get the next list of items.
+ * @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 discount list along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> scopeListNextSinglePageAsync(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.scopeListNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountsImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountsImpl.java
new file mode 100644
index 000000000000..98827dc11513
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/DiscountsImpl.java
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.billingbenefits.fluent.DiscountsClient;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import com.azure.resourcemanager.billingbenefits.models.Discount;
+import com.azure.resourcemanager.billingbenefits.models.Discounts;
+
+public final class DiscountsImpl implements Discounts {
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountsImpl.class);
+
+ private final DiscountsClient innerClient;
+
+ private final com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager;
+
+ public DiscountsImpl(DiscountsClient innerClient,
+ com.azure.resourcemanager.billingbenefits.BillingBenefitsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String discountName) {
+ this.serviceClient().delete(resourceGroupName, discountName);
+ }
+
+ public void delete(String resourceGroupName, String discountName, Context context) {
+ this.serviceClient().delete(resourceGroupName, discountName, context);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscountImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscountImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscountImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscountImpl(inner1, this.manager()));
+ }
+
+ public Discount cancel(String resourceGroupName, String discountName) {
+ DiscountInner inner = this.serviceClient().cancel(resourceGroupName, discountName);
+ if (inner != null) {
+ return new DiscountImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Discount cancel(String resourceGroupName, String discountName, Context context) {
+ DiscountInner inner = this.serviceClient().cancel(resourceGroupName, discountName, context);
+ if (inner != null) {
+ return new DiscountImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public PagedIterable scopeList(String scope) {
+ PagedIterable inner = this.serviceClient().scopeList(scope);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscountImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable scopeList(String scope, Context context) {
+ PagedIterable inner = this.serviceClient().scopeList(scope, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscountImpl(inner1, this.manager()));
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String discountName = ResourceManagerUtils.getValueFromIdByName(id, "discounts");
+ if (discountName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'discounts'.", id)));
+ }
+ this.delete(resourceGroupName, discountName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String discountName = ResourceManagerUtils.getValueFromIdByName(id, "discounts");
+ if (discountName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'discounts'.", id)));
+ }
+ this.delete(resourceGroupName, discountName, context);
+ }
+
+ private DiscountsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager() {
+ return this.serviceManager;
+ }
+
+ public DiscountImpl define(String name) {
+ return new DiscountImpl(name, this.manager());
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/ReservationOrderAliasResponseImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/ReservationOrderAliasResponseImpl.java
index 26c8d0f25397..bb3a09cf718d 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/ReservationOrderAliasResponseImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/ReservationOrderAliasResponseImpl.java
@@ -13,7 +13,7 @@
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAliasResponse;
import com.azure.resourcemanager.billingbenefits.models.ReservationOrderAliasResponsePropertiesReservedResourceProperties;
import com.azure.resourcemanager.billingbenefits.models.ReservedResourceType;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import java.time.OffsetDateTime;
@@ -40,7 +40,7 @@ public String type() {
return this.innerModel().type();
}
- public Sku sku() {
+ public ResourceSku sku() {
return this.innerModel().sku();
}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanModelImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanModelImpl.java
index c9f8f0a3071b..b91eda76968b 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanModelImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanModelImpl.java
@@ -13,8 +13,8 @@
import com.azure.resourcemanager.billingbenefits.models.ExtendedStatusInfo;
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
import com.azure.resourcemanager.billingbenefits.models.RenewProperties;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanModel;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import com.azure.resourcemanager.billingbenefits.models.Utilization;
import java.time.OffsetDateTime;
@@ -42,7 +42,7 @@ public String type() {
return this.innerModel().type();
}
- public Sku sku() {
+ public ResourceSku sku() {
return this.innerModel().sku();
}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderAliasModelImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderAliasModelImpl.java
index ce5e42cbbb32..8f7c55e4eae0 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderAliasModelImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderAliasModelImpl.java
@@ -11,8 +11,8 @@
import com.azure.resourcemanager.billingbenefits.models.BillingPlan;
import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanOrderAliasModel;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
public final class SavingsPlanOrderAliasModelImpl implements SavingsPlanOrderAliasModel {
@@ -38,7 +38,7 @@ public String type() {
return this.innerModel().type();
}
- public Sku sku() {
+ public ResourceSku sku() {
return this.innerModel().sku();
}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderModelImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderModelImpl.java
index 1af470e64780..6106c5d3f35c 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderModelImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlanOrderModelImpl.java
@@ -10,8 +10,8 @@
import com.azure.resourcemanager.billingbenefits.models.BillingPlanInformation;
import com.azure.resourcemanager.billingbenefits.models.ExtendedStatusInfo;
import com.azure.resourcemanager.billingbenefits.models.ProvisioningState;
+import com.azure.resourcemanager.billingbenefits.models.ResourceSku;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanOrderModel;
-import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
import java.time.OffsetDateTime;
import java.util.Collections;
@@ -40,7 +40,7 @@ public String type() {
return this.innerModel().type();
}
- public Sku sku() {
+ public ResourceSku sku() {
return this.innerModel().sku();
}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansClientImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansClientImpl.java
index 02bfa5315ad0..273f42d5a8cf 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansClientImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansClientImpl.java
@@ -26,8 +26,11 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.billingbenefits.fluent.SavingsPlansClient;
import com.azure.resourcemanager.billingbenefits.fluent.models.SavingsPlanModelInner;
import com.azure.resourcemanager.billingbenefits.fluent.models.SavingsPlanValidateResponseInner;
@@ -35,7 +38,8 @@
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanModelListResult;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateRequest;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateValidateRequest;
-import com.azure.resourcemanager.billingbenefits.models.SavingsPlansUpdateResponse;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
@@ -102,7 +106,7 @@ Mono> get(@HostParam("$host") String endpoint,
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono update(@HostParam("$host") String endpoint,
+ Mono>> update(@HostParam("$host") String endpoint,
@PathParam("savingsPlanOrderId") String savingsPlanOrderId,
@PathParam("savingsPlanId") String savingsPlanId, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") SavingsPlanUpdateRequest body, @HeaderParam("Accept") String accept,
@@ -565,10 +569,10 @@ public SavingsPlanModelInner get(String savingsPlanOrderId, String savingsPlanId
* @throws ManagementException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return savings plan on successful completion of {@link Mono}.
+ * @return savings plan along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono updateWithResponseAsync(String savingsPlanOrderId, String savingsPlanId,
+ private Mono>> updateWithResponseAsync(String savingsPlanOrderId, String savingsPlanId,
SavingsPlanUpdateRequest body) {
if (this.client.getEndpoint() == null) {
return Mono.error(
@@ -604,10 +608,10 @@ private Mono updateWithResponseAsync(String savingsP
* @throws ManagementException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return savings plan on successful completion of {@link Mono}.
+ * @return savings plan along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono updateWithResponseAsync(String savingsPlanOrderId, String savingsPlanId,
+ private Mono>> updateWithResponseAsync(String savingsPlanOrderId, String savingsPlanId,
SavingsPlanUpdateRequest body, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
@@ -631,6 +635,87 @@ private Mono updateWithResponseAsync(String savingsP
body, accept, context);
}
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws ManagementException thrown if the request is rejected by server on status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SavingsPlanModelInner>
+ beginUpdateAsync(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body) {
+ Mono>> mono = updateWithResponseAsync(savingsPlanOrderId, savingsPlanId, body);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), SavingsPlanModelInner.class, SavingsPlanModelInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @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 ManagementException thrown if the request is rejected by server on status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SavingsPlanModelInner> beginUpdateAsync(
+ String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = updateWithResponseAsync(savingsPlanOrderId, savingsPlanId, body, context);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), SavingsPlanModelInner.class, SavingsPlanModelInner.class, context);
+ }
+
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws ManagementException thrown if the request is rejected by server on status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SavingsPlanModelInner> beginUpdate(String savingsPlanOrderId,
+ String savingsPlanId, SavingsPlanUpdateRequest body) {
+ return this.beginUpdateAsync(savingsPlanOrderId, savingsPlanId, body).getSyncPoller();
+ }
+
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @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 ManagementException thrown if the request is rejected by server on status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SavingsPlanModelInner> beginUpdate(String savingsPlanOrderId,
+ String savingsPlanId, SavingsPlanUpdateRequest body, Context context) {
+ return this.beginUpdateAsync(savingsPlanOrderId, savingsPlanId, body, context).getSyncPoller();
+ }
+
/**
* Update savings plan.
*
@@ -646,8 +731,8 @@ private Mono updateWithResponseAsync(String savingsP
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String savingsPlanOrderId, String savingsPlanId,
SavingsPlanUpdateRequest body) {
- return updateWithResponseAsync(savingsPlanOrderId, savingsPlanId, body)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ return beginUpdateAsync(savingsPlanOrderId, savingsPlanId, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -661,12 +746,13 @@ private Mono updateAsync(String savingsPlanOrderId, Strin
* @throws ManagementException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return savings plan.
+ * @return savings plan on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public SavingsPlansUpdateResponse updateWithResponse(String savingsPlanOrderId, String savingsPlanId,
+ private Mono updateAsync(String savingsPlanOrderId, String savingsPlanId,
SavingsPlanUpdateRequest body, Context context) {
- return updateWithResponseAsync(savingsPlanOrderId, savingsPlanId, body, context).block();
+ return beginUpdateAsync(savingsPlanOrderId, savingsPlanId, body, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -684,7 +770,26 @@ public SavingsPlansUpdateResponse updateWithResponse(String savingsPlanOrderId,
@ServiceMethod(returns = ReturnType.SINGLE)
public SavingsPlanModelInner update(String savingsPlanOrderId, String savingsPlanId,
SavingsPlanUpdateRequest body) {
- return updateWithResponse(savingsPlanOrderId, savingsPlanId, body, Context.NONE).getValue();
+ return updateAsync(savingsPlanOrderId, savingsPlanId, body).block();
+ }
+
+ /**
+ * Update savings plan.
+ *
+ * @param savingsPlanOrderId Order ID of the savings plan.
+ * @param savingsPlanId ID of the savings plan.
+ * @param body Request body for patching a savings plan order alias.
+ * @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 ManagementException thrown if the request is rejected by server on status code 404.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return savings plan.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SavingsPlanModelInner update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body,
+ Context context) {
+ return updateAsync(savingsPlanOrderId, savingsPlanId, body, context).block();
}
/**
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansImpl.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansImpl.java
index 81a7262f6883..bbc04fa241fe 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansImpl.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/implementation/SavingsPlansImpl.java
@@ -17,7 +17,6 @@
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanUpdateValidateRequest;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanValidateResponse;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlans;
-import com.azure.resourcemanager.billingbenefits.models.SavingsPlansUpdateResponse;
public final class SavingsPlansImpl implements SavingsPlans {
private static final ClientLogger LOGGER = new ClientLogger(SavingsPlansImpl.class);
@@ -75,20 +74,18 @@ public SavingsPlanModel get(String savingsPlanOrderId, String savingsPlanId) {
}
}
- public Response updateWithResponse(String savingsPlanOrderId, String savingsPlanId,
- SavingsPlanUpdateRequest body, Context context) {
- SavingsPlansUpdateResponse inner
- = this.serviceClient().updateWithResponse(savingsPlanOrderId, savingsPlanId, body, context);
+ public SavingsPlanModel update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body) {
+ SavingsPlanModelInner inner = this.serviceClient().update(savingsPlanOrderId, savingsPlanId, body);
if (inner != null) {
- return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
- new SavingsPlanModelImpl(inner.getValue(), this.manager()));
+ return new SavingsPlanModelImpl(inner, this.manager());
} else {
return null;
}
}
- public SavingsPlanModel update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body) {
- SavingsPlanModelInner inner = this.serviceClient().update(savingsPlanOrderId, savingsPlanId, body);
+ public SavingsPlanModel update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body,
+ Context context) {
+ SavingsPlanModelInner inner = this.serviceClient().update(savingsPlanOrderId, savingsPlanId, body, context);
if (inner != null) {
return new SavingsPlanModelImpl(inner, this.manager());
} else {
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ApplyDiscountOn.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ApplyDiscountOn.java
new file mode 100644
index 000000000000..8b76cbbbc2f2
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ApplyDiscountOn.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The customer action on which the discount is applied. Supported values are Purchase, Consume, and Renew. Validation:
+ * Required, one of supported values.
+ */
+public final class ApplyDiscountOn extends ExpandableStringEnum {
+ /**
+ * Static value Purchase for ApplyDiscountOn.
+ */
+ public static final ApplyDiscountOn PURCHASE = fromString("Purchase");
+
+ /**
+ * Static value Consume for ApplyDiscountOn.
+ */
+ public static final ApplyDiscountOn CONSUME = fromString("Consume");
+
+ /**
+ * Static value Renew for ApplyDiscountOn.
+ */
+ public static final ApplyDiscountOn RENEW = fromString("Renew");
+
+ /**
+ * Creates a new instance of ApplyDiscountOn value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ApplyDiscountOn() {
+ }
+
+ /**
+ * Creates or finds a ApplyDiscountOn from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ApplyDiscountOn.
+ */
+ public static ApplyDiscountOn fromString(String name) {
+ return fromString(name, ApplyDiscountOn.class);
+ }
+
+ /**
+ * Gets known ApplyDiscountOn values.
+ *
+ * @return known ApplyDiscountOn values.
+ */
+ public static Collection values() {
+ return values(ApplyDiscountOn.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CatalogClaimsItem.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CatalogClaimsItem.java
new file mode 100644
index 000000000000..98dacf9d7262
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CatalogClaimsItem.java
@@ -0,0 +1,121 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Catalog claim for a discount.
+ */
+@Fluent
+public final class CatalogClaimsItem implements JsonSerializable {
+ /*
+ * The catalogClaimsItemType property.
+ */
+ private String catalogClaimsItemType;
+
+ /*
+ * The value property.
+ */
+ private String value;
+
+ /**
+ * Creates an instance of CatalogClaimsItem class.
+ */
+ public CatalogClaimsItem() {
+ }
+
+ /**
+ * Get the catalogClaimsItemType property: The catalogClaimsItemType property.
+ *
+ * @return the catalogClaimsItemType value.
+ */
+ public String catalogClaimsItemType() {
+ return this.catalogClaimsItemType;
+ }
+
+ /**
+ * Set the catalogClaimsItemType property: The catalogClaimsItemType property.
+ *
+ * @param catalogClaimsItemType the catalogClaimsItemType value to set.
+ * @return the CatalogClaimsItem object itself.
+ */
+ public CatalogClaimsItem withCatalogClaimsItemType(String catalogClaimsItemType) {
+ this.catalogClaimsItemType = catalogClaimsItemType;
+ return this;
+ }
+
+ /**
+ * Get the value property: The value property.
+ *
+ * @return the value value.
+ */
+ public String value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: The value property.
+ *
+ * @param value the value value to set.
+ * @return the CatalogClaimsItem object itself.
+ */
+ public CatalogClaimsItem withValue(String value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("catalogClaimsItemType", this.catalogClaimsItemType);
+ jsonWriter.writeStringField("value", this.value);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CatalogClaimsItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CatalogClaimsItem if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the CatalogClaimsItem.
+ */
+ public static CatalogClaimsItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CatalogClaimsItem deserializedCatalogClaimsItem = new CatalogClaimsItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("catalogClaimsItemType".equals(fieldName)) {
+ deserializedCatalogClaimsItem.catalogClaimsItemType = reader.getString();
+ } else if ("value".equals(fieldName)) {
+ deserializedCatalogClaimsItem.value = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCatalogClaimsItem;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CommitmentGrain.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CommitmentGrain.java
index 674a8f602627..73e4f61ce9e5 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CommitmentGrain.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CommitmentGrain.java
@@ -16,6 +16,16 @@ public final class CommitmentGrain extends ExpandableStringEnum
*/
public static final CommitmentGrain HOURLY = fromString("Hourly");
+ /**
+ * Static value FullTerm for CommitmentGrain.
+ */
+ public static final CommitmentGrain FULL_TERM = fromString("FullTerm");
+
+ /**
+ * Static value Unknown for CommitmentGrain.
+ */
+ public static final CommitmentGrain UNKNOWN = fromString("Unknown");
+
/**
* Creates a new instance of CommitmentGrain value.
*
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ConditionsItem.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ConditionsItem.java
new file mode 100644
index 000000000000..06403ddff591
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ConditionsItem.java
@@ -0,0 +1,151 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Condition for a discount.
+ */
+@Fluent
+public final class ConditionsItem implements JsonSerializable {
+ /*
+ * The conditionName property.
+ */
+ private String conditionName;
+
+ /*
+ * These items are open-ended strings.
+ */
+ private List value;
+
+ /*
+ * The type property.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of ConditionsItem class.
+ */
+ public ConditionsItem() {
+ }
+
+ /**
+ * Get the conditionName property: The conditionName property.
+ *
+ * @return the conditionName value.
+ */
+ public String conditionName() {
+ return this.conditionName;
+ }
+
+ /**
+ * Set the conditionName property: The conditionName property.
+ *
+ * @param conditionName the conditionName value to set.
+ * @return the ConditionsItem object itself.
+ */
+ public ConditionsItem withConditionName(String conditionName) {
+ this.conditionName = conditionName;
+ return this;
+ }
+
+ /**
+ * Get the value property: These items are open-ended strings.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: These items are open-ended strings.
+ *
+ * @param value the value value to set.
+ * @return the ConditionsItem object itself.
+ */
+ public ConditionsItem withValue(List value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Get the type property: The type property.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: The type property.
+ *
+ * @param type the type value to set.
+ * @return the ConditionsItem object itself.
+ */
+ public ConditionsItem withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("conditionName", this.conditionName);
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("type", this.type);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ConditionsItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ConditionsItem if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ConditionsItem.
+ */
+ public static ConditionsItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ConditionsItem deserializedConditionsItem = new ConditionsItem();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("conditionName".equals(fieldName)) {
+ deserializedConditionsItem.conditionName = reader.getString();
+ } else if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> reader1.getString());
+ deserializedConditionsItem.value = value;
+ } else if ("type".equals(fieldName)) {
+ deserializedConditionsItem.type = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedConditionsItem;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CustomPriceProperties.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CustomPriceProperties.java
new file mode 100644
index 000000000000..d150726fbfcb
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/CustomPriceProperties.java
@@ -0,0 +1,323 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Custom price properties for a given discount.
+ */
+@Fluent
+public final class CustomPriceProperties implements JsonSerializable {
+ /*
+ * The type of the priceable node pricing rule. Validation: Required. Supported values are fixedPriceLock,
+ * fixedListPrice, and priceCeiling.
+ */
+ private DiscountRuleType ruleType;
+
+ /*
+ * The catalog instance where the priceable node lives. Validation: Required. No defined format, will vary per team.
+ */
+ private String catalogId;
+
+ /*
+ * The set of BigCat claims. Validation: Required. Must contain AgreementType, NationalCloud, and PricingAudience
+ * claims. Additionally requires AccessPass claim when creating custom price with action == consume on the pricing
+ * instructions.
+ */
+ private List catalogClaims;
+
+ /*
+ * The term units for the priceable node. Validation: Optional, Maximum length 128 characters. Must be present if
+ * and only if the availability derived by market, product, sku, and claims has terms.
+ */
+ private String termUnits;
+
+ /*
+ * The billing period of the priceable node. Validation: Optional, Maximum length 128 characters. Only allowed if
+ * the availability derived by market, product, sku, and claims has terms and at least one of those terms has a
+ * billing period. When specified, termUnits must be specified.
+ */
+ private String billingPeriod;
+
+ /*
+ * Must be present if the market, product, sku, and claims, and optional term information resolves to multiple
+ * availabilities that only differ by meter type. Validation: Maximum length 128 characters.
+ */
+ private String meterType;
+
+ /*
+ * The set of market set prices of the priceable node. Validation: Required. Must contain at least one element.
+ */
+ private List marketSetPrices;
+
+ /**
+ * Creates an instance of CustomPriceProperties class.
+ */
+ public CustomPriceProperties() {
+ }
+
+ /**
+ * Get the ruleType property: The type of the priceable node pricing rule. Validation: Required. Supported values
+ * are fixedPriceLock, fixedListPrice, and priceCeiling.
+ *
+ * @return the ruleType value.
+ */
+ public DiscountRuleType ruleType() {
+ return this.ruleType;
+ }
+
+ /**
+ * Set the ruleType property: The type of the priceable node pricing rule. Validation: Required. Supported values
+ * are fixedPriceLock, fixedListPrice, and priceCeiling.
+ *
+ * @param ruleType the ruleType value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withRuleType(DiscountRuleType ruleType) {
+ this.ruleType = ruleType;
+ return this;
+ }
+
+ /**
+ * Get the catalogId property: The catalog instance where the priceable node lives. Validation: Required. No defined
+ * format, will vary per team.
+ *
+ * @return the catalogId value.
+ */
+ public String catalogId() {
+ return this.catalogId;
+ }
+
+ /**
+ * Set the catalogId property: The catalog instance where the priceable node lives. Validation: Required. No defined
+ * format, will vary per team.
+ *
+ * @param catalogId the catalogId value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withCatalogId(String catalogId) {
+ this.catalogId = catalogId;
+ return this;
+ }
+
+ /**
+ * Get the catalogClaims property: The set of BigCat claims. Validation: Required. Must contain AgreementType,
+ * NationalCloud, and PricingAudience claims. Additionally requires AccessPass claim when creating custom price with
+ * action == consume on the pricing instructions.
+ *
+ * @return the catalogClaims value.
+ */
+ public List catalogClaims() {
+ return this.catalogClaims;
+ }
+
+ /**
+ * Set the catalogClaims property: The set of BigCat claims. Validation: Required. Must contain AgreementType,
+ * NationalCloud, and PricingAudience claims. Additionally requires AccessPass claim when creating custom price with
+ * action == consume on the pricing instructions.
+ *
+ * @param catalogClaims the catalogClaims value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withCatalogClaims(List catalogClaims) {
+ this.catalogClaims = catalogClaims;
+ return this;
+ }
+
+ /**
+ * Get the termUnits property: The term units for the priceable node. Validation: Optional, Maximum length 128
+ * characters. Must be present if and only if the availability derived by market, product, sku, and claims has
+ * terms.
+ *
+ * @return the termUnits value.
+ */
+ public String termUnits() {
+ return this.termUnits;
+ }
+
+ /**
+ * Set the termUnits property: The term units for the priceable node. Validation: Optional, Maximum length 128
+ * characters. Must be present if and only if the availability derived by market, product, sku, and claims has
+ * terms.
+ *
+ * @param termUnits the termUnits value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withTermUnits(String termUnits) {
+ this.termUnits = termUnits;
+ return this;
+ }
+
+ /**
+ * Get the billingPeriod property: The billing period of the priceable node. Validation: Optional, Maximum length
+ * 128 characters. Only allowed if the availability derived by market, product, sku, and claims has terms and at
+ * least one of those terms has a billing period. When specified, termUnits must be specified.
+ *
+ * @return the billingPeriod value.
+ */
+ public String billingPeriod() {
+ return this.billingPeriod;
+ }
+
+ /**
+ * Set the billingPeriod property: The billing period of the priceable node. Validation: Optional, Maximum length
+ * 128 characters. Only allowed if the availability derived by market, product, sku, and claims has terms and at
+ * least one of those terms has a billing period. When specified, termUnits must be specified.
+ *
+ * @param billingPeriod the billingPeriod value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withBillingPeriod(String billingPeriod) {
+ this.billingPeriod = billingPeriod;
+ return this;
+ }
+
+ /**
+ * Get the meterType property: Must be present if the market, product, sku, and claims, and optional term
+ * information resolves to multiple availabilities that only differ by meter type. Validation: Maximum length 128
+ * characters.
+ *
+ * @return the meterType value.
+ */
+ public String meterType() {
+ return this.meterType;
+ }
+
+ /**
+ * Set the meterType property: Must be present if the market, product, sku, and claims, and optional term
+ * information resolves to multiple availabilities that only differ by meter type. Validation: Maximum length 128
+ * characters.
+ *
+ * @param meterType the meterType value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withMeterType(String meterType) {
+ this.meterType = meterType;
+ return this;
+ }
+
+ /**
+ * Get the marketSetPrices property: The set of market set prices of the priceable node. Validation: Required. Must
+ * contain at least one element.
+ *
+ * @return the marketSetPrices value.
+ */
+ public List marketSetPrices() {
+ return this.marketSetPrices;
+ }
+
+ /**
+ * Set the marketSetPrices property: The set of market set prices of the priceable node. Validation: Required. Must
+ * contain at least one element.
+ *
+ * @param marketSetPrices the marketSetPrices value to set.
+ * @return the CustomPriceProperties object itself.
+ */
+ public CustomPriceProperties withMarketSetPrices(List marketSetPrices) {
+ this.marketSetPrices = marketSetPrices;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (ruleType() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property ruleType in model CustomPriceProperties"));
+ }
+ if (catalogId() == null) {
+ throw LOGGER.atError()
+ .log(
+ new IllegalArgumentException("Missing required property catalogId in model CustomPriceProperties"));
+ }
+ if (catalogClaims() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property catalogClaims in model CustomPriceProperties"));
+ } else {
+ catalogClaims().forEach(e -> e.validate());
+ }
+ if (marketSetPrices() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property marketSetPrices in model CustomPriceProperties"));
+ } else {
+ marketSetPrices().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(CustomPriceProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString());
+ jsonWriter.writeStringField("catalogId", this.catalogId);
+ jsonWriter.writeArrayField("catalogClaims", this.catalogClaims, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("marketSetPrices", this.marketSetPrices,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("termUnits", this.termUnits);
+ jsonWriter.writeStringField("billingPeriod", this.billingPeriod);
+ jsonWriter.writeStringField("meterType", this.meterType);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CustomPriceProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CustomPriceProperties if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the CustomPriceProperties.
+ */
+ public static CustomPriceProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CustomPriceProperties deserializedCustomPriceProperties = new CustomPriceProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("ruleType".equals(fieldName)) {
+ deserializedCustomPriceProperties.ruleType = DiscountRuleType.fromString(reader.getString());
+ } else if ("catalogId".equals(fieldName)) {
+ deserializedCustomPriceProperties.catalogId = reader.getString();
+ } else if ("catalogClaims".equals(fieldName)) {
+ List catalogClaims
+ = reader.readArray(reader1 -> CatalogClaimsItem.fromJson(reader1));
+ deserializedCustomPriceProperties.catalogClaims = catalogClaims;
+ } else if ("marketSetPrices".equals(fieldName)) {
+ List marketSetPrices
+ = reader.readArray(reader1 -> MarketSetPricesItems.fromJson(reader1));
+ deserializedCustomPriceProperties.marketSetPrices = marketSetPrices;
+ } else if ("termUnits".equals(fieldName)) {
+ deserializedCustomPriceProperties.termUnits = reader.getString();
+ } else if ("billingPeriod".equals(fieldName)) {
+ deserializedCustomPriceProperties.billingPeriod = reader.getString();
+ } else if ("meterType".equals(fieldName)) {
+ deserializedCustomPriceProperties.meterType = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCustomPriceProperties;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Discount.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Discount.java
new file mode 100644
index 000000000000..d0f060bf55ee
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Discount.java
@@ -0,0 +1,331 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import java.util.Map;
+
+/**
+ * An immutable client-side representation of Discount.
+ */
+public interface Discount {
+ /**
+ * Gets the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * Gets the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * Gets the location property: The geo-location where the resource lives.
+ *
+ * @return the location value.
+ */
+ String location();
+
+ /**
+ * Gets the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ Map tags();
+
+ /**
+ * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource.
+ * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment
+ * will not delete the resource if it is removed from the template since it is managed by another resource.
+ *
+ * @return the managedBy value.
+ */
+ String managedBy();
+
+ /**
+ * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of
+ * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must
+ * validate and persist this value.
+ *
+ * @return the kind value.
+ */
+ String kind();
+
+ /**
+ * Gets the etag property: The etag field is *not* required. If it is provided in the response body, it must also be
+ * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from
+ * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24),
+ * If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ *
+ * @return the etag value.
+ */
+ String etag();
+
+ /**
+ * Gets the identity property: Managed service identity (system assigned and/or user assigned identities).
+ *
+ * @return the identity value.
+ */
+ ManagedServiceIdentity identity();
+
+ /**
+ * Gets the sku property: The resource model definition representing SKU.
+ *
+ * @return the sku value.
+ */
+ Sku sku();
+
+ /**
+ * Gets the plan property: Plan for the resource.
+ *
+ * @return the plan value.
+ */
+ Plan plan();
+
+ /**
+ * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ SystemData systemData();
+
+ /**
+ * Gets the properties property: Discount properties.
+ *
+ * @return the properties value.
+ */
+ DiscountProperties properties();
+
+ /**
+ * Gets the region of the resource.
+ *
+ * @return the region of the resource.
+ */
+ Region region();
+
+ /**
+ * Gets the name of the resource region.
+ *
+ * @return the name of the resource region.
+ */
+ String regionName();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner object.
+ *
+ * @return the inner object.
+ */
+ DiscountInner innerModel();
+
+ /**
+ * The entirety of the Discount definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation,
+ DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * The Discount definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of the Discount definition.
+ */
+ interface Blank extends WithLocation {
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify location.
+ */
+ interface WithLocation {
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(Region location);
+
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(String location);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify parent resource.
+ */
+ interface WithResourceGroup {
+ /**
+ * Specifies resourceGroupName.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @return the next definition stage.
+ */
+ WithCreate withExistingResourceGroup(String resourceGroupName);
+ }
+
+ /**
+ * The stage of the Discount definition which contains all the minimum required properties for the resource to
+ * be created, but also allows for any other optional properties to be specified.
+ */
+ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy,
+ DefinitionStages.WithKind, DefinitionStages.WithIdentity, DefinitionStages.WithSku,
+ DefinitionStages.WithPlan, DefinitionStages.WithProperties {
+ /**
+ * Executes the create request.
+ *
+ * @return the created resource.
+ */
+ Discount create();
+
+ /**
+ * Executes the create request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the created resource.
+ */
+ Discount create(Context context);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify tags.
+ */
+ interface WithTags {
+ /**
+ * Specifies the tags property: Resource tags..
+ *
+ * @param tags Resource tags.
+ * @return the next definition stage.
+ */
+ WithCreate withTags(Map tags);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify managedBy.
+ */
+ interface WithManagedBy {
+ /**
+ * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this
+ * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete
+ * mode deployment will not delete the resource if it is removed from the template since it is managed by
+ * another resource..
+ *
+ * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if
+ * this resource is managed by another Azure resource. If this is present, complete mode deployment will not
+ * delete the resource if it is removed from the template since it is managed by another resource.
+ * @return the next definition stage.
+ */
+ WithCreate withManagedBy(String managedBy);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify kind.
+ */
+ interface WithKind {
+ /**
+ * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for
+ * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the
+ * resource provider must validate and persist this value..
+ *
+ * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the
+ * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must
+ * validate and persist this value.
+ * @return the next definition stage.
+ */
+ WithCreate withKind(String kind);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify identity.
+ */
+ interface WithIdentity {
+ /**
+ * Specifies the identity property: Managed service identity (system assigned and/or user assigned
+ * identities).
+ *
+ * @param identity Managed service identity (system assigned and/or user assigned identities).
+ * @return the next definition stage.
+ */
+ WithCreate withIdentity(ManagedServiceIdentity identity);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify sku.
+ */
+ interface WithSku {
+ /**
+ * Specifies the sku property: The resource model definition representing SKU.
+ *
+ * @param sku The resource model definition representing SKU.
+ * @return the next definition stage.
+ */
+ WithCreate withSku(Sku sku);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify plan.
+ */
+ interface WithPlan {
+ /**
+ * Specifies the plan property: Plan for the resource..
+ *
+ * @param plan Plan for the resource.
+ * @return the next definition stage.
+ */
+ WithCreate withPlan(Plan plan);
+ }
+
+ /**
+ * The stage of the Discount definition allowing to specify properties.
+ */
+ interface WithProperties {
+ /**
+ * Specifies the properties property: Discount properties.
+ *
+ * @param properties Discount properties.
+ * @return the next definition stage.
+ */
+ WithCreate withProperties(DiscountProperties properties);
+ }
+ }
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @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 resource definition for Discounts.
+ */
+ Discount cancel();
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @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 resource definition for Discounts.
+ */
+ Discount cancel(Context context);
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountAppliedScopeType.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountAppliedScopeType.java
new file mode 100644
index 000000000000..7b88de8e0024
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountAppliedScopeType.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * List of applied scopes supported for discounts.
+ */
+public final class DiscountAppliedScopeType extends ExpandableStringEnum {
+ /**
+ * Static value BillingAccount for DiscountAppliedScopeType.
+ */
+ public static final DiscountAppliedScopeType BILLING_ACCOUNT = fromString("BillingAccount");
+
+ /**
+ * Static value BillingProfile for DiscountAppliedScopeType.
+ */
+ public static final DiscountAppliedScopeType BILLING_PROFILE = fromString("BillingProfile");
+
+ /**
+ * Static value Customer for DiscountAppliedScopeType.
+ */
+ public static final DiscountAppliedScopeType CUSTOMER = fromString("Customer");
+
+ /**
+ * Creates a new instance of DiscountAppliedScopeType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountAppliedScopeType() {
+ }
+
+ /**
+ * Creates or finds a DiscountAppliedScopeType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountAppliedScopeType.
+ */
+ public static DiscountAppliedScopeType fromString(String name) {
+ return fromString(name, DiscountAppliedScopeType.class);
+ }
+
+ /**
+ * Gets known DiscountAppliedScopeType values.
+ *
+ * @return known DiscountAppliedScopeType values.
+ */
+ public static Collection values() {
+ return values(DiscountAppliedScopeType.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountCombinationRule.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountCombinationRule.java
new file mode 100644
index 000000000000..253322324774
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountCombinationRule.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The discount combination rule when there are multiple applicable custom prices. Validation: Required. Supported
+ * values are Stackable and BestOf.
+ */
+public final class DiscountCombinationRule extends ExpandableStringEnum {
+ /**
+ * Static value BestOf for DiscountCombinationRule.
+ */
+ public static final DiscountCombinationRule BEST_OF = fromString("BestOf");
+
+ /**
+ * Static value Stackable for DiscountCombinationRule.
+ */
+ public static final DiscountCombinationRule STACKABLE = fromString("Stackable");
+
+ /**
+ * Creates a new instance of DiscountCombinationRule value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountCombinationRule() {
+ }
+
+ /**
+ * Creates or finds a DiscountCombinationRule from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountCombinationRule.
+ */
+ public static DiscountCombinationRule fromString(String name) {
+ return fromString(name, DiscountCombinationRule.class);
+ }
+
+ /**
+ * Gets known DiscountCombinationRule values.
+ *
+ * @return known DiscountCombinationRule values.
+ */
+ public static Collection values() {
+ return values(DiscountCombinationRule.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountEntityType.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountEntityType.java
new file mode 100644
index 000000000000..089e2f84cdba
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountEntityType.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * This defines whether the entity being created is primary or affiliate. Supported values: primary, affiliate.
+ * Validation: Required, must match one of the 2 values.
+ */
+public final class DiscountEntityType extends ExpandableStringEnum {
+ /**
+ * Static value Primary for DiscountEntityType.
+ */
+ public static final DiscountEntityType PRIMARY = fromString("Primary");
+
+ /**
+ * Static value Affiliate for DiscountEntityType.
+ */
+ public static final DiscountEntityType AFFILIATE = fromString("Affiliate");
+
+ /**
+ * Creates a new instance of DiscountEntityType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountEntityType() {
+ }
+
+ /**
+ * Creates or finds a DiscountEntityType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountEntityType.
+ */
+ public static DiscountEntityType fromString(String name) {
+ return fromString(name, DiscountEntityType.class);
+ }
+
+ /**
+ * Gets known DiscountEntityType values.
+ *
+ * @return known DiscountEntityType values.
+ */
+ public static Collection values() {
+ return values(DiscountEntityType.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountList.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountList.java
new file mode 100644
index 000000000000..9dbad3ba927f
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountList.java
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Discount list.
+ */
+@Fluent
+public final class DiscountList implements JsonSerializable {
+ /*
+ * List of discounts.
+ */
+ private List value;
+
+ /*
+ * Url to get the next page.
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of DiscountList class.
+ */
+ public DiscountList() {
+ }
+
+ /**
+ * Get the value property: List of discounts.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: List of discounts.
+ *
+ * @param value the value value to set.
+ * @return the DiscountList object itself.
+ */
+ public DiscountList withValue(List value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Get the nextLink property: Url to get the next page.
+ *
+ * @return the nextLink value.
+ */
+ public String nextLink() {
+ return this.nextLink;
+ }
+
+ /**
+ * Set the nextLink property: Url to get the next page.
+ *
+ * @param nextLink the nextLink value to set.
+ * @return the DiscountList object itself.
+ */
+ public DiscountList withNextLink(String nextLink) {
+ this.nextLink = nextLink;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() != null) {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountList from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountList if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the DiscountList.
+ */
+ public static DiscountList fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountList deserializedDiscountList = new DiscountList();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> DiscountInner.fromJson(reader1));
+ deserializedDiscountList.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedDiscountList.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountList;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountOperations.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountOperations.java
new file mode 100644
index 000000000000..75a592a062dc
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountOperations.java
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of DiscountOperations.
+ */
+public interface DiscountOperations {
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level along with {@link Response}.
+ */
+ Response getByResourceGroupWithResponse(String resourceGroupName, String discountName, Context context);
+
+ /**
+ * Get discount at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 discount at resource group level.
+ */
+ Discount getByResourceGroup(String resourceGroupName, String discountName);
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts.
+ */
+ Discount update(String resourceGroupName, String discountName, DiscountPatchRequest body);
+
+ /**
+ * Update discounts.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @param body Request body for updating discounts.
+ * @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 resource definition for Discounts.
+ */
+ Discount update(String resourceGroupName, String discountName, DiscountPatchRequest body, Context context);
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountPatchRequest.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountPatchRequest.java
new file mode 100644
index 000000000000..ba24a2c53c0d
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountPatchRequest.java
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.billingbenefits.fluent.models.DiscountPatchRequestProperties;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Discounts patch request.
+ */
+@Fluent
+public final class DiscountPatchRequest implements JsonSerializable {
+ /*
+ * Discounts patch request properties
+ */
+ private DiscountPatchRequestProperties innerProperties;
+
+ /*
+ * Resource tags.
+ */
+ private Map tags;
+
+ /**
+ * Creates an instance of DiscountPatchRequest class.
+ */
+ public DiscountPatchRequest() {
+ }
+
+ /**
+ * Get the innerProperties property: Discounts patch request properties.
+ *
+ * @return the innerProperties value.
+ */
+ private DiscountPatchRequestProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: Resource tags.
+ *
+ * @param tags the tags value to set.
+ * @return the DiscountPatchRequest object itself.
+ */
+ public DiscountPatchRequest withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Get the displayName property: Display name.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.innerProperties() == null ? null : this.innerProperties().displayName();
+ }
+
+ /**
+ * Set the displayName property: Display name.
+ *
+ * @param displayName the displayName value to set.
+ * @return the DiscountPatchRequest object itself.
+ */
+ public DiscountPatchRequest withDisplayName(String displayName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new DiscountPatchRequestProperties();
+ }
+ this.innerProperties().withDisplayName(displayName);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountPatchRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountPatchRequest if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the DiscountPatchRequest.
+ */
+ public static DiscountPatchRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountPatchRequest deserializedDiscountPatchRequest = new DiscountPatchRequest();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("properties".equals(fieldName)) {
+ deserializedDiscountPatchRequest.innerProperties = DiscountPatchRequestProperties.fromJson(reader);
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedDiscountPatchRequest.tags = tags;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountPatchRequest;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountProperties.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountProperties.java
new file mode 100644
index 000000000000..c77f0cdfaf9c
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountProperties.java
@@ -0,0 +1,439 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Properties belonging to discounts.
+ */
+@Fluent
+public class DiscountProperties implements JsonSerializable {
+ /*
+ * This defines whether the entity being created is primary or affiliate. Supported values: primary, affiliate.
+ * Validation: Required, must match one of the 2 values.
+ */
+ private DiscountEntityType entityType = DiscountEntityType.fromString("DiscountProperties");
+
+ /*
+ * This is the catalog UPN for the product.
+ */
+ private String productCode;
+
+ /*
+ * Start date of the discount. Value is the date the discount started or will start in the future.
+ */
+ private OffsetDateTime startAt;
+
+ /*
+ * This is the globally unique identifier of the Discount which will not change for the lifetime of the Discount.
+ */
+ private String systemId;
+
+ /*
+ * The state of the resource. Supported values are Pending, Failed, Succeeded, Canceled.
+ */
+ private DiscountProvisioningState provisioningState;
+
+ /*
+ * Billing account resource id where the discount metadata is present.
+ */
+ private String billingAccountResourceId;
+
+ /*
+ * Billing profile resource id where the discount is scoped to.
+ */
+ private String billingProfileResourceId;
+
+ /*
+ * Customer resource id where the discount is scoped to.
+ */
+ private String customerResourceId;
+
+ /*
+ * This defines a user friendly display name for the discount.
+ */
+ private String displayName;
+
+ /*
+ * Represents the current status of the discount.
+ */
+ private DiscountStatus status;
+
+ /*
+ * Fully-qualified identifier of the benefit under applicable benefit list.
+ */
+ private String benefitResourceId;
+
+ /*
+ * List of applied scopes supported for discounts.
+ */
+ private DiscountAppliedScopeType appliedScopeType;
+
+ /**
+ * Creates an instance of DiscountProperties class.
+ */
+ public DiscountProperties() {
+ }
+
+ /**
+ * Get the entityType property: This defines whether the entity being created is primary or affiliate. Supported
+ * values: primary, affiliate. Validation: Required, must match one of the 2 values.
+ *
+ * @return the entityType value.
+ */
+ public DiscountEntityType entityType() {
+ return this.entityType;
+ }
+
+ /**
+ * Get the productCode property: This is the catalog UPN for the product.
+ *
+ * @return the productCode value.
+ */
+ public String productCode() {
+ return this.productCode;
+ }
+
+ /**
+ * Set the productCode property: This is the catalog UPN for the product.
+ *
+ * @param productCode the productCode value to set.
+ * @return the DiscountProperties object itself.
+ */
+ public DiscountProperties withProductCode(String productCode) {
+ this.productCode = productCode;
+ return this;
+ }
+
+ /**
+ * Get the startAt property: Start date of the discount. Value is the date the discount started or will start in the
+ * future.
+ *
+ * @return the startAt value.
+ */
+ public OffsetDateTime startAt() {
+ return this.startAt;
+ }
+
+ /**
+ * Set the startAt property: Start date of the discount. Value is the date the discount started or will start in the
+ * future.
+ *
+ * @param startAt the startAt value to set.
+ * @return the DiscountProperties object itself.
+ */
+ public DiscountProperties withStartAt(OffsetDateTime startAt) {
+ this.startAt = startAt;
+ return this;
+ }
+
+ /**
+ * Get the systemId property: This is the globally unique identifier of the Discount which will not change for the
+ * lifetime of the Discount.
+ *
+ * @return the systemId value.
+ */
+ public String systemId() {
+ return this.systemId;
+ }
+
+ /**
+ * Set the systemId property: This is the globally unique identifier of the Discount which will not change for the
+ * lifetime of the Discount.
+ *
+ * @param systemId the systemId value to set.
+ * @return the DiscountProperties object itself.
+ */
+ public DiscountProperties withSystemId(String systemId) {
+ this.systemId = systemId;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The state of the resource. Supported values are Pending, Failed, Succeeded,
+ * Canceled.
+ *
+ * @return the provisioningState value.
+ */
+ public DiscountProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Set the provisioningState property: The state of the resource. Supported values are Pending, Failed, Succeeded,
+ * Canceled.
+ *
+ * @param provisioningState the provisioningState value to set.
+ * @return the DiscountProperties object itself.
+ */
+ DiscountProperties withProvisioningState(DiscountProvisioningState provisioningState) {
+ this.provisioningState = provisioningState;
+ return this;
+ }
+
+ /**
+ * Get the billingAccountResourceId property: Billing account resource id where the discount metadata is present.
+ *
+ * @return the billingAccountResourceId value.
+ */
+ public String billingAccountResourceId() {
+ return this.billingAccountResourceId;
+ }
+
+ /**
+ * Set the billingAccountResourceId property: Billing account resource id where the discount metadata is present.
+ *
+ * @param billingAccountResourceId the billingAccountResourceId value to set.
+ * @return the DiscountProperties object itself.
+ */
+ DiscountProperties withBillingAccountResourceId(String billingAccountResourceId) {
+ this.billingAccountResourceId = billingAccountResourceId;
+ return this;
+ }
+
+ /**
+ * Get the billingProfileResourceId property: Billing profile resource id where the discount is scoped to.
+ *
+ * @return the billingProfileResourceId value.
+ */
+ public String billingProfileResourceId() {
+ return this.billingProfileResourceId;
+ }
+
+ /**
+ * Set the billingProfileResourceId property: Billing profile resource id where the discount is scoped to.
+ *
+ * @param billingProfileResourceId the billingProfileResourceId value to set.
+ * @return the DiscountProperties object itself.
+ */
+ DiscountProperties withBillingProfileResourceId(String billingProfileResourceId) {
+ this.billingProfileResourceId = billingProfileResourceId;
+ return this;
+ }
+
+ /**
+ * Get the customerResourceId property: Customer resource id where the discount is scoped to.
+ *
+ * @return the customerResourceId value.
+ */
+ public String customerResourceId() {
+ return this.customerResourceId;
+ }
+
+ /**
+ * Set the customerResourceId property: Customer resource id where the discount is scoped to.
+ *
+ * @param customerResourceId the customerResourceId value to set.
+ * @return the DiscountProperties object itself.
+ */
+ DiscountProperties withCustomerResourceId(String customerResourceId) {
+ this.customerResourceId = customerResourceId;
+ return this;
+ }
+
+ /**
+ * Get the displayName property: This defines a user friendly display name for the discount.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: This defines a user friendly display name for the discount.
+ *
+ * @param displayName the displayName value to set.
+ * @return the DiscountProperties object itself.
+ */
+ public DiscountProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the status property: Represents the current status of the discount.
+ *
+ * @return the status value.
+ */
+ public DiscountStatus status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: Represents the current status of the discount.
+ *
+ * @param status the status value to set.
+ * @return the DiscountProperties object itself.
+ */
+ DiscountProperties withStatus(DiscountStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the benefitResourceId property: Fully-qualified identifier of the benefit under applicable benefit list.
+ *
+ * @return the benefitResourceId value.
+ */
+ public String benefitResourceId() {
+ return this.benefitResourceId;
+ }
+
+ /**
+ * Set the benefitResourceId property: Fully-qualified identifier of the benefit under applicable benefit list.
+ *
+ * @param benefitResourceId the benefitResourceId value to set.
+ * @return the DiscountProperties object itself.
+ */
+ DiscountProperties withBenefitResourceId(String benefitResourceId) {
+ this.benefitResourceId = benefitResourceId;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopeType property: List of applied scopes supported for discounts.
+ *
+ * @return the appliedScopeType value.
+ */
+ public DiscountAppliedScopeType appliedScopeType() {
+ return this.appliedScopeType;
+ }
+
+ /**
+ * Set the appliedScopeType property: List of applied scopes supported for discounts.
+ *
+ * @param appliedScopeType the appliedScopeType value to set.
+ * @return the DiscountProperties object itself.
+ */
+ public DiscountProperties withAppliedScopeType(DiscountAppliedScopeType appliedScopeType) {
+ this.appliedScopeType = appliedScopeType;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (productCode() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property productCode in model DiscountProperties"));
+ }
+ if (startAt() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property startAt in model DiscountProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("productCode", this.productCode);
+ jsonWriter.writeStringField("startAt",
+ this.startAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startAt));
+ jsonWriter.writeStringField("entityType", this.entityType == null ? null : this.entityType.toString());
+ jsonWriter.writeStringField("systemId", this.systemId);
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeStringField("appliedScopeType",
+ this.appliedScopeType == null ? null : this.appliedScopeType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountProperties if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountProperties.
+ */
+ public static DiscountProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("entityType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("Affiliate".equals(discriminatorValue)) {
+ return EntityTypeAffiliateDiscount.fromJson(readerToUse.reset());
+ } else if ("Primary".equals(discriminatorValue)) {
+ return EntityTypePrimaryDiscount.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static DiscountProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountProperties deserializedDiscountProperties = new DiscountProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("productCode".equals(fieldName)) {
+ deserializedDiscountProperties.productCode = reader.getString();
+ } else if ("startAt".equals(fieldName)) {
+ deserializedDiscountProperties.startAt = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("entityType".equals(fieldName)) {
+ deserializedDiscountProperties.entityType = DiscountEntityType.fromString(reader.getString());
+ } else if ("systemId".equals(fieldName)) {
+ deserializedDiscountProperties.systemId = reader.getString();
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedDiscountProperties.provisioningState
+ = DiscountProvisioningState.fromString(reader.getString());
+ } else if ("billingAccountResourceId".equals(fieldName)) {
+ deserializedDiscountProperties.billingAccountResourceId = reader.getString();
+ } else if ("billingProfileResourceId".equals(fieldName)) {
+ deserializedDiscountProperties.billingProfileResourceId = reader.getString();
+ } else if ("customerResourceId".equals(fieldName)) {
+ deserializedDiscountProperties.customerResourceId = reader.getString();
+ } else if ("displayName".equals(fieldName)) {
+ deserializedDiscountProperties.displayName = reader.getString();
+ } else if ("status".equals(fieldName)) {
+ deserializedDiscountProperties.status = DiscountStatus.fromString(reader.getString());
+ } else if ("benefitResourceId".equals(fieldName)) {
+ deserializedDiscountProperties.benefitResourceId = reader.getString();
+ } else if ("appliedScopeType".equals(fieldName)) {
+ deserializedDiscountProperties.appliedScopeType
+ = DiscountAppliedScopeType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountProperties;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountProvisioningState.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountProvisioningState.java
new file mode 100644
index 000000000000..b4c2e3e21968
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountProvisioningState.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Provisioning states of Discount.
+ */
+public final class DiscountProvisioningState extends ExpandableStringEnum {
+ /**
+ * Static value Unknown for DiscountProvisioningState.
+ */
+ public static final DiscountProvisioningState UNKNOWN = fromString("Unknown");
+
+ /**
+ * Static value Pending for DiscountProvisioningState.
+ */
+ public static final DiscountProvisioningState PENDING = fromString("Pending");
+
+ /**
+ * Static value Succeeded for DiscountProvisioningState.
+ */
+ public static final DiscountProvisioningState SUCCEEDED = fromString("Succeeded");
+
+ /**
+ * Static value Canceled for DiscountProvisioningState.
+ */
+ public static final DiscountProvisioningState CANCELED = fromString("Canceled");
+
+ /**
+ * Static value Failed for DiscountProvisioningState.
+ */
+ public static final DiscountProvisioningState FAILED = fromString("Failed");
+
+ /**
+ * Creates a new instance of DiscountProvisioningState value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountProvisioningState() {
+ }
+
+ /**
+ * Creates or finds a DiscountProvisioningState from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountProvisioningState.
+ */
+ public static DiscountProvisioningState fromString(String name) {
+ return fromString(name, DiscountProvisioningState.class);
+ }
+
+ /**
+ * Gets known DiscountProvisioningState values.
+ *
+ * @return known DiscountProvisioningState values.
+ */
+ public static Collection values() {
+ return values(DiscountProvisioningState.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountRuleType.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountRuleType.java
new file mode 100644
index 000000000000..90c41c01c185
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountRuleType.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The type of the priceable node pricing rule. Validation: Required. Supported values are fixedPriceLock,
+ * fixedListPrice, and priceCeiling.
+ */
+public final class DiscountRuleType extends ExpandableStringEnum {
+ /**
+ * Static value FixedPriceLock for DiscountRuleType.
+ */
+ public static final DiscountRuleType FIXED_PRICE_LOCK = fromString("FixedPriceLock");
+
+ /**
+ * Static value FixedListPrice for DiscountRuleType.
+ */
+ public static final DiscountRuleType FIXED_LIST_PRICE = fromString("FixedListPrice");
+
+ /**
+ * Static value PriceCeiling for DiscountRuleType.
+ */
+ public static final DiscountRuleType PRICE_CEILING = fromString("PriceCeiling");
+
+ /**
+ * Creates a new instance of DiscountRuleType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountRuleType() {
+ }
+
+ /**
+ * Creates or finds a DiscountRuleType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountRuleType.
+ */
+ public static DiscountRuleType fromString(String name) {
+ return fromString(name, DiscountRuleType.class);
+ }
+
+ /**
+ * Gets known DiscountRuleType values.
+ *
+ * @return known DiscountRuleType values.
+ */
+ public static Collection values() {
+ return values(DiscountRuleType.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountStatus.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountStatus.java
new file mode 100644
index 000000000000..135e76cc54c5
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountStatus.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Represents the current status of the discount.
+ */
+public final class DiscountStatus extends ExpandableStringEnum {
+ /**
+ * Static value Active for DiscountStatus.
+ */
+ public static final DiscountStatus ACTIVE = fromString("Active");
+
+ /**
+ * Static value Pending for DiscountStatus.
+ */
+ public static final DiscountStatus PENDING = fromString("Pending");
+
+ /**
+ * Static value Failed for DiscountStatus.
+ */
+ public static final DiscountStatus FAILED = fromString("Failed");
+
+ /**
+ * Static value Canceled for DiscountStatus.
+ */
+ public static final DiscountStatus CANCELED = fromString("Canceled");
+
+ /**
+ * Static value Expired for DiscountStatus.
+ */
+ public static final DiscountStatus EXPIRED = fromString("Expired");
+
+ /**
+ * Creates a new instance of DiscountStatus value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountStatus() {
+ }
+
+ /**
+ * Creates or finds a DiscountStatus from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountStatus.
+ */
+ public static DiscountStatus fromString(String name) {
+ return fromString(name, DiscountStatus.class);
+ }
+
+ /**
+ * Gets known DiscountStatus values.
+ *
+ * @return known DiscountStatus values.
+ */
+ public static Collection values() {
+ return values(DiscountStatus.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountType.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountType.java
new file mode 100644
index 000000000000..d9ee30a0286b
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountType.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+public final class DiscountType extends ExpandableStringEnum {
+ /**
+ * Static value ProductFamily for DiscountType.
+ */
+ public static final DiscountType PRODUCT_FAMILY = fromString("ProductFamily");
+
+ /**
+ * Static value Product for DiscountType.
+ */
+ public static final DiscountType PRODUCT = fromString("Product");
+
+ /**
+ * Static value Sku for DiscountType.
+ */
+ public static final DiscountType SKU = fromString("Sku");
+
+ /**
+ * Static value CustomPrice for DiscountType.
+ */
+ public static final DiscountType CUSTOM_PRICE = fromString("CustomPrice");
+
+ /**
+ * Static value CustomPriceMultiCurrency for DiscountType.
+ */
+ public static final DiscountType CUSTOM_PRICE_MULTI_CURRENCY = fromString("CustomPriceMultiCurrency");
+
+ /**
+ * Creates a new instance of DiscountType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public DiscountType() {
+ }
+
+ /**
+ * Creates or finds a DiscountType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding DiscountType.
+ */
+ public static DiscountType fromString(String name) {
+ return fromString(name, DiscountType.class);
+ }
+
+ /**
+ * Gets known DiscountType values.
+ *
+ * @return known DiscountType values.
+ */
+ public static Collection values() {
+ return values(DiscountType.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeCustomPrice.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeCustomPrice.java
new file mode 100644
index 000000000000..3216e14818f7
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeCustomPrice.java
@@ -0,0 +1,310 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Discount type properties including product family name, product id, sku, and custom price properties. Allows a single
+ * entry in marketSetPrices.
+ */
+@Fluent
+public class DiscountTypeCustomPrice extends DiscountTypeProperties {
+ /*
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+ private DiscountType discountType = DiscountType.CUSTOM_PRICE;
+
+ /*
+ * Product family for which the discount is given. Validation: Optional
+ */
+ private String productFamilyName;
+
+ /*
+ * Product ID for which the discount is given. Validation: Optional. No specific format, example: DZH318Z09V6F
+ */
+ private String productId;
+
+ /*
+ * ResourceSku for the given discount. Validation: Optional.
+ */
+ private String skuId;
+
+ /*
+ * Custom price properties for a given discount.
+ */
+ private CustomPriceProperties customPriceProperties;
+
+ /**
+ * Creates an instance of DiscountTypeCustomPrice class.
+ */
+ public DiscountTypeCustomPrice() {
+ }
+
+ /**
+ * Get the discountType property: Defines the type of discount. Supported values are ProductFamily, Product, Sku,
+ * CustomPrice, and CustomPriceMultiCurrency.
+ *
+ * @return the discountType value.
+ */
+ @Override
+ public DiscountType discountType() {
+ return this.discountType;
+ }
+
+ /**
+ * Get the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @return the productFamilyName value.
+ */
+ public String productFamilyName() {
+ return this.productFamilyName;
+ }
+
+ /**
+ * Set the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @param productFamilyName the productFamilyName value to set.
+ * @return the DiscountTypeCustomPrice object itself.
+ */
+ public DiscountTypeCustomPrice withProductFamilyName(String productFamilyName) {
+ this.productFamilyName = productFamilyName;
+ return this;
+ }
+
+ /**
+ * Get the productId property: Product ID for which the discount is given. Validation: Optional. No specific format,
+ * example: DZH318Z09V6F.
+ *
+ * @return the productId value.
+ */
+ public String productId() {
+ return this.productId;
+ }
+
+ /**
+ * Set the productId property: Product ID for which the discount is given. Validation: Optional. No specific format,
+ * example: DZH318Z09V6F.
+ *
+ * @param productId the productId value to set.
+ * @return the DiscountTypeCustomPrice object itself.
+ */
+ public DiscountTypeCustomPrice withProductId(String productId) {
+ this.productId = productId;
+ return this;
+ }
+
+ /**
+ * Get the skuId property: ResourceSku for the given discount. Validation: Optional.
+ *
+ * @return the skuId value.
+ */
+ public String skuId() {
+ return this.skuId;
+ }
+
+ /**
+ * Set the skuId property: ResourceSku for the given discount. Validation: Optional.
+ *
+ * @param skuId the skuId value to set.
+ * @return the DiscountTypeCustomPrice object itself.
+ */
+ public DiscountTypeCustomPrice withSkuId(String skuId) {
+ this.skuId = skuId;
+ return this;
+ }
+
+ /**
+ * Get the customPriceProperties property: Custom price properties for a given discount.
+ *
+ * @return the customPriceProperties value.
+ */
+ public CustomPriceProperties customPriceProperties() {
+ return this.customPriceProperties;
+ }
+
+ /**
+ * Set the customPriceProperties property: Custom price properties for a given discount.
+ *
+ * @param customPriceProperties the customPriceProperties value to set.
+ * @return the DiscountTypeCustomPrice object itself.
+ */
+ public DiscountTypeCustomPrice withCustomPriceProperties(CustomPriceProperties customPriceProperties) {
+ this.customPriceProperties = customPriceProperties;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPrice withApplyDiscountOn(ApplyDiscountOn applyDiscountOn) {
+ super.withApplyDiscountOn(applyDiscountOn);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPrice withDiscountPercentage(Float discountPercentage) {
+ super.withDiscountPercentage(discountPercentage);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPrice withDiscountCombinationRule(DiscountCombinationRule discountCombinationRule) {
+ super.withDiscountCombinationRule(discountCombinationRule);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPrice withPriceGuaranteeProperties(PriceGuaranteeProperties priceGuaranteeProperties) {
+ super.withPriceGuaranteeProperties(priceGuaranteeProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPrice withConditions(List conditions) {
+ super.withConditions(conditions);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (customPriceProperties() != null) {
+ customPriceProperties().validate();
+ }
+ if (applyDiscountOn() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property applyDiscountOn in model DiscountTypeCustomPrice"));
+ }
+ if (priceGuaranteeProperties() != null) {
+ priceGuaranteeProperties().validate();
+ }
+ if (conditions() != null) {
+ conditions().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountTypeCustomPrice.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("applyDiscountOn", applyDiscountOn() == null ? null : applyDiscountOn().toString());
+ jsonWriter.writeNumberField("discountPercentage", discountPercentage());
+ jsonWriter.writeStringField("discountCombinationRule",
+ discountCombinationRule() == null ? null : discountCombinationRule().toString());
+ jsonWriter.writeJsonField("priceGuaranteeProperties", priceGuaranteeProperties());
+ jsonWriter.writeArrayField("conditions", conditions(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("discountType", this.discountType == null ? null : this.discountType.toString());
+ jsonWriter.writeStringField("productFamilyName", this.productFamilyName);
+ jsonWriter.writeStringField("productId", this.productId);
+ jsonWriter.writeStringField("skuId", this.skuId);
+ jsonWriter.writeJsonField("customPriceProperties", this.customPriceProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountTypeCustomPrice from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountTypeCustomPrice if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountTypeCustomPrice.
+ */
+ public static DiscountTypeCustomPrice fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("discountType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("CustomPriceMultiCurrency".equals(discriminatorValue)) {
+ return DiscountTypeCustomPriceMultiCurrency.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static DiscountTypeCustomPrice fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountTypeCustomPrice deserializedDiscountTypeCustomPrice = new DiscountTypeCustomPrice();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("applyDiscountOn".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice
+ .withApplyDiscountOn(ApplyDiscountOn.fromString(reader.getString()));
+ } else if ("discountPercentage".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice
+ .withDiscountPercentage(reader.getNullable(JsonReader::getFloat));
+ } else if ("discountCombinationRule".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice
+ .withDiscountCombinationRule(DiscountCombinationRule.fromString(reader.getString()));
+ } else if ("priceGuaranteeProperties".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice
+ .withPriceGuaranteeProperties(PriceGuaranteeProperties.fromJson(reader));
+ } else if ("conditions".equals(fieldName)) {
+ List conditions = reader.readArray(reader1 -> ConditionsItem.fromJson(reader1));
+ deserializedDiscountTypeCustomPrice.withConditions(conditions);
+ } else if ("discountType".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice.discountType = DiscountType.fromString(reader.getString());
+ } else if ("productFamilyName".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice.productFamilyName = reader.getString();
+ } else if ("productId".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice.productId = reader.getString();
+ } else if ("skuId".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice.skuId = reader.getString();
+ } else if ("customPriceProperties".equals(fieldName)) {
+ deserializedDiscountTypeCustomPrice.customPriceProperties = CustomPriceProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountTypeCustomPrice;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeCustomPriceMultiCurrency.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeCustomPriceMultiCurrency.java
new file mode 100644
index 000000000000..777b280cf384
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeCustomPriceMultiCurrency.java
@@ -0,0 +1,224 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Discount type properties including product family name, product id, sku, and custom price properties. Allows multiple
+ * entries in marketSetPrices.
+ */
+@Fluent
+public final class DiscountTypeCustomPriceMultiCurrency extends DiscountTypeCustomPrice {
+ /*
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+ private DiscountType discountType = DiscountType.CUSTOM_PRICE_MULTI_CURRENCY;
+
+ /**
+ * Creates an instance of DiscountTypeCustomPriceMultiCurrency class.
+ */
+ public DiscountTypeCustomPriceMultiCurrency() {
+ }
+
+ /**
+ * Get the discountType property: Defines the type of discount. Supported values are ProductFamily, Product, Sku,
+ * CustomPrice, and CustomPriceMultiCurrency.
+ *
+ * @return the discountType value.
+ */
+ @Override
+ public DiscountType discountType() {
+ return this.discountType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withProductFamilyName(String productFamilyName) {
+ super.withProductFamilyName(productFamilyName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withProductId(String productId) {
+ super.withProductId(productId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withSkuId(String skuId) {
+ super.withSkuId(skuId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withCustomPriceProperties(CustomPriceProperties customPriceProperties) {
+ super.withCustomPriceProperties(customPriceProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withApplyDiscountOn(ApplyDiscountOn applyDiscountOn) {
+ super.withApplyDiscountOn(applyDiscountOn);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withDiscountPercentage(Float discountPercentage) {
+ super.withDiscountPercentage(discountPercentage);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency
+ withDiscountCombinationRule(DiscountCombinationRule discountCombinationRule) {
+ super.withDiscountCombinationRule(discountCombinationRule);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency
+ withPriceGuaranteeProperties(PriceGuaranteeProperties priceGuaranteeProperties) {
+ super.withPriceGuaranteeProperties(priceGuaranteeProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeCustomPriceMultiCurrency withConditions(List conditions) {
+ super.withConditions(conditions);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (applyDiscountOn() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property applyDiscountOn in model DiscountTypeCustomPriceMultiCurrency"));
+ }
+ if (priceGuaranteeProperties() != null) {
+ priceGuaranteeProperties().validate();
+ }
+ if (conditions() != null) {
+ conditions().forEach(e -> e.validate());
+ }
+ if (customPriceProperties() != null) {
+ customPriceProperties().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountTypeCustomPriceMultiCurrency.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("applyDiscountOn", applyDiscountOn() == null ? null : applyDiscountOn().toString());
+ jsonWriter.writeNumberField("discountPercentage", discountPercentage());
+ jsonWriter.writeStringField("discountCombinationRule",
+ discountCombinationRule() == null ? null : discountCombinationRule().toString());
+ jsonWriter.writeJsonField("priceGuaranteeProperties", priceGuaranteeProperties());
+ jsonWriter.writeArrayField("conditions", conditions(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("productFamilyName", productFamilyName());
+ jsonWriter.writeStringField("productId", productId());
+ jsonWriter.writeStringField("skuId", skuId());
+ jsonWriter.writeJsonField("customPriceProperties", customPriceProperties());
+ jsonWriter.writeStringField("discountType", this.discountType == null ? null : this.discountType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountTypeCustomPriceMultiCurrency from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountTypeCustomPriceMultiCurrency if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountTypeCustomPriceMultiCurrency.
+ */
+ public static DiscountTypeCustomPriceMultiCurrency fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountTypeCustomPriceMultiCurrency deserializedDiscountTypeCustomPriceMultiCurrency
+ = new DiscountTypeCustomPriceMultiCurrency();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("applyDiscountOn".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency
+ .withApplyDiscountOn(ApplyDiscountOn.fromString(reader.getString()));
+ } else if ("discountPercentage".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency
+ .withDiscountPercentage(reader.getNullable(JsonReader::getFloat));
+ } else if ("discountCombinationRule".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency
+ .withDiscountCombinationRule(DiscountCombinationRule.fromString(reader.getString()));
+ } else if ("priceGuaranteeProperties".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency
+ .withPriceGuaranteeProperties(PriceGuaranteeProperties.fromJson(reader));
+ } else if ("conditions".equals(fieldName)) {
+ List conditions = reader.readArray(reader1 -> ConditionsItem.fromJson(reader1));
+ deserializedDiscountTypeCustomPriceMultiCurrency.withConditions(conditions);
+ } else if ("productFamilyName".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency.withProductFamilyName(reader.getString());
+ } else if ("productId".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency.withProductId(reader.getString());
+ } else if ("skuId".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency.withSkuId(reader.getString());
+ } else if ("customPriceProperties".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency
+ .withCustomPriceProperties(CustomPriceProperties.fromJson(reader));
+ } else if ("discountType".equals(fieldName)) {
+ deserializedDiscountTypeCustomPriceMultiCurrency.discountType
+ = DiscountType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountTypeCustomPriceMultiCurrency;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProduct.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProduct.java
new file mode 100644
index 000000000000..e17aa773d6b3
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProduct.java
@@ -0,0 +1,223 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Discount type properties including product family name and product id.
+ */
+@Fluent
+public final class DiscountTypeProduct extends DiscountTypeProperties {
+ /*
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+ private DiscountType discountType = DiscountType.PRODUCT;
+
+ /*
+ * Product family for which the discount is given. Validation: Optional
+ */
+ private String productFamilyName;
+
+ /*
+ * Product ID for which the discount is given. Validation: Optional. No specific format, example: DZH318Z09V6F
+ */
+ private String productId;
+
+ /**
+ * Creates an instance of DiscountTypeProduct class.
+ */
+ public DiscountTypeProduct() {
+ }
+
+ /**
+ * Get the discountType property: Defines the type of discount. Supported values are ProductFamily, Product, Sku,
+ * CustomPrice, and CustomPriceMultiCurrency.
+ *
+ * @return the discountType value.
+ */
+ @Override
+ public DiscountType discountType() {
+ return this.discountType;
+ }
+
+ /**
+ * Get the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @return the productFamilyName value.
+ */
+ public String productFamilyName() {
+ return this.productFamilyName;
+ }
+
+ /**
+ * Set the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @param productFamilyName the productFamilyName value to set.
+ * @return the DiscountTypeProduct object itself.
+ */
+ public DiscountTypeProduct withProductFamilyName(String productFamilyName) {
+ this.productFamilyName = productFamilyName;
+ return this;
+ }
+
+ /**
+ * Get the productId property: Product ID for which the discount is given. Validation: Optional. No specific format,
+ * example: DZH318Z09V6F.
+ *
+ * @return the productId value.
+ */
+ public String productId() {
+ return this.productId;
+ }
+
+ /**
+ * Set the productId property: Product ID for which the discount is given. Validation: Optional. No specific format,
+ * example: DZH318Z09V6F.
+ *
+ * @param productId the productId value to set.
+ * @return the DiscountTypeProduct object itself.
+ */
+ public DiscountTypeProduct withProductId(String productId) {
+ this.productId = productId;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProduct withApplyDiscountOn(ApplyDiscountOn applyDiscountOn) {
+ super.withApplyDiscountOn(applyDiscountOn);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProduct withDiscountPercentage(Float discountPercentage) {
+ super.withDiscountPercentage(discountPercentage);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProduct withDiscountCombinationRule(DiscountCombinationRule discountCombinationRule) {
+ super.withDiscountCombinationRule(discountCombinationRule);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProduct withPriceGuaranteeProperties(PriceGuaranteeProperties priceGuaranteeProperties) {
+ super.withPriceGuaranteeProperties(priceGuaranteeProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProduct withConditions(List conditions) {
+ super.withConditions(conditions);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (applyDiscountOn() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property applyDiscountOn in model DiscountTypeProduct"));
+ }
+ if (priceGuaranteeProperties() != null) {
+ priceGuaranteeProperties().validate();
+ }
+ if (conditions() != null) {
+ conditions().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountTypeProduct.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("applyDiscountOn", applyDiscountOn() == null ? null : applyDiscountOn().toString());
+ jsonWriter.writeNumberField("discountPercentage", discountPercentage());
+ jsonWriter.writeStringField("discountCombinationRule",
+ discountCombinationRule() == null ? null : discountCombinationRule().toString());
+ jsonWriter.writeJsonField("priceGuaranteeProperties", priceGuaranteeProperties());
+ jsonWriter.writeArrayField("conditions", conditions(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("discountType", this.discountType == null ? null : this.discountType.toString());
+ jsonWriter.writeStringField("productFamilyName", this.productFamilyName);
+ jsonWriter.writeStringField("productId", this.productId);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountTypeProduct from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountTypeProduct if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountTypeProduct.
+ */
+ public static DiscountTypeProduct fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountTypeProduct deserializedDiscountTypeProduct = new DiscountTypeProduct();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("applyDiscountOn".equals(fieldName)) {
+ deserializedDiscountTypeProduct.withApplyDiscountOn(ApplyDiscountOn.fromString(reader.getString()));
+ } else if ("discountPercentage".equals(fieldName)) {
+ deserializedDiscountTypeProduct.withDiscountPercentage(reader.getNullable(JsonReader::getFloat));
+ } else if ("discountCombinationRule".equals(fieldName)) {
+ deserializedDiscountTypeProduct
+ .withDiscountCombinationRule(DiscountCombinationRule.fromString(reader.getString()));
+ } else if ("priceGuaranteeProperties".equals(fieldName)) {
+ deserializedDiscountTypeProduct
+ .withPriceGuaranteeProperties(PriceGuaranteeProperties.fromJson(reader));
+ } else if ("conditions".equals(fieldName)) {
+ List conditions = reader.readArray(reader1 -> ConditionsItem.fromJson(reader1));
+ deserializedDiscountTypeProduct.withConditions(conditions);
+ } else if ("discountType".equals(fieldName)) {
+ deserializedDiscountTypeProduct.discountType = DiscountType.fromString(reader.getString());
+ } else if ("productFamilyName".equals(fieldName)) {
+ deserializedDiscountTypeProduct.productFamilyName = reader.getString();
+ } else if ("productId".equals(fieldName)) {
+ deserializedDiscountTypeProduct.productId = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountTypeProduct;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProductFamily.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProductFamily.java
new file mode 100644
index 000000000000..70796e8f0d54
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProductFamily.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Discount type properties including product family name.
+ */
+@Fluent
+public final class DiscountTypeProductFamily extends DiscountTypeProperties {
+ /*
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+ private DiscountType discountType = DiscountType.PRODUCT_FAMILY;
+
+ /*
+ * Product family for which the discount is given. Validation: Optional
+ */
+ private String productFamilyName;
+
+ /**
+ * Creates an instance of DiscountTypeProductFamily class.
+ */
+ public DiscountTypeProductFamily() {
+ }
+
+ /**
+ * Get the discountType property: Defines the type of discount. Supported values are ProductFamily, Product, Sku,
+ * CustomPrice, and CustomPriceMultiCurrency.
+ *
+ * @return the discountType value.
+ */
+ @Override
+ public DiscountType discountType() {
+ return this.discountType;
+ }
+
+ /**
+ * Get the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @return the productFamilyName value.
+ */
+ public String productFamilyName() {
+ return this.productFamilyName;
+ }
+
+ /**
+ * Set the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @param productFamilyName the productFamilyName value to set.
+ * @return the DiscountTypeProductFamily object itself.
+ */
+ public DiscountTypeProductFamily withProductFamilyName(String productFamilyName) {
+ this.productFamilyName = productFamilyName;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductFamily withApplyDiscountOn(ApplyDiscountOn applyDiscountOn) {
+ super.withApplyDiscountOn(applyDiscountOn);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductFamily withDiscountPercentage(Float discountPercentage) {
+ super.withDiscountPercentage(discountPercentage);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductFamily withDiscountCombinationRule(DiscountCombinationRule discountCombinationRule) {
+ super.withDiscountCombinationRule(discountCombinationRule);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductFamily withPriceGuaranteeProperties(PriceGuaranteeProperties priceGuaranteeProperties) {
+ super.withPriceGuaranteeProperties(priceGuaranteeProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductFamily withConditions(List conditions) {
+ super.withConditions(conditions);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (applyDiscountOn() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property applyDiscountOn in model DiscountTypeProductFamily"));
+ }
+ if (priceGuaranteeProperties() != null) {
+ priceGuaranteeProperties().validate();
+ }
+ if (conditions() != null) {
+ conditions().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountTypeProductFamily.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("applyDiscountOn", applyDiscountOn() == null ? null : applyDiscountOn().toString());
+ jsonWriter.writeNumberField("discountPercentage", discountPercentage());
+ jsonWriter.writeStringField("discountCombinationRule",
+ discountCombinationRule() == null ? null : discountCombinationRule().toString());
+ jsonWriter.writeJsonField("priceGuaranteeProperties", priceGuaranteeProperties());
+ jsonWriter.writeArrayField("conditions", conditions(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("discountType", this.discountType == null ? null : this.discountType.toString());
+ jsonWriter.writeStringField("productFamilyName", this.productFamilyName);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountTypeProductFamily from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountTypeProductFamily if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountTypeProductFamily.
+ */
+ public static DiscountTypeProductFamily fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountTypeProductFamily deserializedDiscountTypeProductFamily = new DiscountTypeProductFamily();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("applyDiscountOn".equals(fieldName)) {
+ deserializedDiscountTypeProductFamily
+ .withApplyDiscountOn(ApplyDiscountOn.fromString(reader.getString()));
+ } else if ("discountPercentage".equals(fieldName)) {
+ deserializedDiscountTypeProductFamily
+ .withDiscountPercentage(reader.getNullable(JsonReader::getFloat));
+ } else if ("discountCombinationRule".equals(fieldName)) {
+ deserializedDiscountTypeProductFamily
+ .withDiscountCombinationRule(DiscountCombinationRule.fromString(reader.getString()));
+ } else if ("priceGuaranteeProperties".equals(fieldName)) {
+ deserializedDiscountTypeProductFamily
+ .withPriceGuaranteeProperties(PriceGuaranteeProperties.fromJson(reader));
+ } else if ("conditions".equals(fieldName)) {
+ List conditions = reader.readArray(reader1 -> ConditionsItem.fromJson(reader1));
+ deserializedDiscountTypeProductFamily.withConditions(conditions);
+ } else if ("discountType".equals(fieldName)) {
+ deserializedDiscountTypeProductFamily.discountType = DiscountType.fromString(reader.getString());
+ } else if ("productFamilyName".equals(fieldName)) {
+ deserializedDiscountTypeProductFamily.productFamilyName = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountTypeProductFamily;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProductSku.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProductSku.java
new file mode 100644
index 000000000000..9e59f06d6eae
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProductSku.java
@@ -0,0 +1,252 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Discount type properties including product family name, product id, and sku id.
+ */
+@Fluent
+public final class DiscountTypeProductSku extends DiscountTypeProperties {
+ /*
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+ private DiscountType discountType = DiscountType.SKU;
+
+ /*
+ * Product family for which the discount is given. Validation: Optional
+ */
+ private String productFamilyName;
+
+ /*
+ * Product ID for which the discount is given. Validation: Optional. No specific format, example: DZH318Z09V6F
+ */
+ private String productId;
+
+ /*
+ * ResourceSku for the given discount. Validation: Optional.
+ */
+ private String skuId;
+
+ /**
+ * Creates an instance of DiscountTypeProductSku class.
+ */
+ public DiscountTypeProductSku() {
+ }
+
+ /**
+ * Get the discountType property: Defines the type of discount. Supported values are ProductFamily, Product, Sku,
+ * CustomPrice, and CustomPriceMultiCurrency.
+ *
+ * @return the discountType value.
+ */
+ @Override
+ public DiscountType discountType() {
+ return this.discountType;
+ }
+
+ /**
+ * Get the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @return the productFamilyName value.
+ */
+ public String productFamilyName() {
+ return this.productFamilyName;
+ }
+
+ /**
+ * Set the productFamilyName property: Product family for which the discount is given. Validation: Optional.
+ *
+ * @param productFamilyName the productFamilyName value to set.
+ * @return the DiscountTypeProductSku object itself.
+ */
+ public DiscountTypeProductSku withProductFamilyName(String productFamilyName) {
+ this.productFamilyName = productFamilyName;
+ return this;
+ }
+
+ /**
+ * Get the productId property: Product ID for which the discount is given. Validation: Optional. No specific format,
+ * example: DZH318Z09V6F.
+ *
+ * @return the productId value.
+ */
+ public String productId() {
+ return this.productId;
+ }
+
+ /**
+ * Set the productId property: Product ID for which the discount is given. Validation: Optional. No specific format,
+ * example: DZH318Z09V6F.
+ *
+ * @param productId the productId value to set.
+ * @return the DiscountTypeProductSku object itself.
+ */
+ public DiscountTypeProductSku withProductId(String productId) {
+ this.productId = productId;
+ return this;
+ }
+
+ /**
+ * Get the skuId property: ResourceSku for the given discount. Validation: Optional.
+ *
+ * @return the skuId value.
+ */
+ public String skuId() {
+ return this.skuId;
+ }
+
+ /**
+ * Set the skuId property: ResourceSku for the given discount. Validation: Optional.
+ *
+ * @param skuId the skuId value to set.
+ * @return the DiscountTypeProductSku object itself.
+ */
+ public DiscountTypeProductSku withSkuId(String skuId) {
+ this.skuId = skuId;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductSku withApplyDiscountOn(ApplyDiscountOn applyDiscountOn) {
+ super.withApplyDiscountOn(applyDiscountOn);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductSku withDiscountPercentage(Float discountPercentage) {
+ super.withDiscountPercentage(discountPercentage);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductSku withDiscountCombinationRule(DiscountCombinationRule discountCombinationRule) {
+ super.withDiscountCombinationRule(discountCombinationRule);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductSku withPriceGuaranteeProperties(PriceGuaranteeProperties priceGuaranteeProperties) {
+ super.withPriceGuaranteeProperties(priceGuaranteeProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiscountTypeProductSku withConditions(List conditions) {
+ super.withConditions(conditions);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (applyDiscountOn() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property applyDiscountOn in model DiscountTypeProductSku"));
+ }
+ if (priceGuaranteeProperties() != null) {
+ priceGuaranteeProperties().validate();
+ }
+ if (conditions() != null) {
+ conditions().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountTypeProductSku.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("applyDiscountOn", applyDiscountOn() == null ? null : applyDiscountOn().toString());
+ jsonWriter.writeNumberField("discountPercentage", discountPercentage());
+ jsonWriter.writeStringField("discountCombinationRule",
+ discountCombinationRule() == null ? null : discountCombinationRule().toString());
+ jsonWriter.writeJsonField("priceGuaranteeProperties", priceGuaranteeProperties());
+ jsonWriter.writeArrayField("conditions", conditions(), (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("discountType", this.discountType == null ? null : this.discountType.toString());
+ jsonWriter.writeStringField("productFamilyName", this.productFamilyName);
+ jsonWriter.writeStringField("productId", this.productId);
+ jsonWriter.writeStringField("skuId", this.skuId);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountTypeProductSku from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountTypeProductSku if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountTypeProductSku.
+ */
+ public static DiscountTypeProductSku fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountTypeProductSku deserializedDiscountTypeProductSku = new DiscountTypeProductSku();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("applyDiscountOn".equals(fieldName)) {
+ deserializedDiscountTypeProductSku
+ .withApplyDiscountOn(ApplyDiscountOn.fromString(reader.getString()));
+ } else if ("discountPercentage".equals(fieldName)) {
+ deserializedDiscountTypeProductSku.withDiscountPercentage(reader.getNullable(JsonReader::getFloat));
+ } else if ("discountCombinationRule".equals(fieldName)) {
+ deserializedDiscountTypeProductSku
+ .withDiscountCombinationRule(DiscountCombinationRule.fromString(reader.getString()));
+ } else if ("priceGuaranteeProperties".equals(fieldName)) {
+ deserializedDiscountTypeProductSku
+ .withPriceGuaranteeProperties(PriceGuaranteeProperties.fromJson(reader));
+ } else if ("conditions".equals(fieldName)) {
+ List conditions = reader.readArray(reader1 -> ConditionsItem.fromJson(reader1));
+ deserializedDiscountTypeProductSku.withConditions(conditions);
+ } else if ("discountType".equals(fieldName)) {
+ deserializedDiscountTypeProductSku.discountType = DiscountType.fromString(reader.getString());
+ } else if ("productFamilyName".equals(fieldName)) {
+ deserializedDiscountTypeProductSku.productFamilyName = reader.getString();
+ } else if ("productId".equals(fieldName)) {
+ deserializedDiscountTypeProductSku.productId = reader.getString();
+ } else if ("skuId".equals(fieldName)) {
+ deserializedDiscountTypeProductSku.skuId = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountTypeProductSku;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProperties.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProperties.java
new file mode 100644
index 000000000000..a4195d438433
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/DiscountTypeProperties.java
@@ -0,0 +1,286 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * This defines the conditions for a given discount type.
+ */
+@Fluent
+public class DiscountTypeProperties implements JsonSerializable {
+ /*
+ * Defines the type of discount. Supported values are ProductFamily, Product, Sku, CustomPrice, and
+ * CustomPriceMultiCurrency.
+ */
+ private DiscountType discountType = DiscountType.fromString("DiscountTypeProperties");
+
+ /*
+ * The customer action on which the discount is applied. Supported values are Purchase, Consume, and Renew.
+ * Validation: Required, one of supported values.
+ */
+ private ApplyDiscountOn applyDiscountOn;
+
+ /*
+ * Discount percentage provided for the customer. Validation: Required unless this is a price rule.
+ */
+ private Float discountPercentage;
+
+ /*
+ * The discount combination rule when there are multiple applicable custom prices. Validation: Required. Supported
+ * values are Stackable and BestOf.
+ */
+ private DiscountCombinationRule discountCombinationRule;
+
+ /*
+ * Set only in price guarantee scenario.
+ */
+ private PriceGuaranteeProperties priceGuaranteeProperties;
+
+ /*
+ * Array of conditions for the discount. Validation: Optional. Maximum length is 1000.
+ */
+ private List conditions;
+
+ /**
+ * Creates an instance of DiscountTypeProperties class.
+ */
+ public DiscountTypeProperties() {
+ }
+
+ /**
+ * Get the discountType property: Defines the type of discount. Supported values are ProductFamily, Product, Sku,
+ * CustomPrice, and CustomPriceMultiCurrency.
+ *
+ * @return the discountType value.
+ */
+ public DiscountType discountType() {
+ return this.discountType;
+ }
+
+ /**
+ * Get the applyDiscountOn property: The customer action on which the discount is applied. Supported values are
+ * Purchase, Consume, and Renew. Validation: Required, one of supported values.
+ *
+ * @return the applyDiscountOn value.
+ */
+ public ApplyDiscountOn applyDiscountOn() {
+ return this.applyDiscountOn;
+ }
+
+ /**
+ * Set the applyDiscountOn property: The customer action on which the discount is applied. Supported values are
+ * Purchase, Consume, and Renew. Validation: Required, one of supported values.
+ *
+ * @param applyDiscountOn the applyDiscountOn value to set.
+ * @return the DiscountTypeProperties object itself.
+ */
+ public DiscountTypeProperties withApplyDiscountOn(ApplyDiscountOn applyDiscountOn) {
+ this.applyDiscountOn = applyDiscountOn;
+ return this;
+ }
+
+ /**
+ * Get the discountPercentage property: Discount percentage provided for the customer. Validation: Required unless
+ * this is a price rule.
+ *
+ * @return the discountPercentage value.
+ */
+ public Float discountPercentage() {
+ return this.discountPercentage;
+ }
+
+ /**
+ * Set the discountPercentage property: Discount percentage provided for the customer. Validation: Required unless
+ * this is a price rule.
+ *
+ * @param discountPercentage the discountPercentage value to set.
+ * @return the DiscountTypeProperties object itself.
+ */
+ public DiscountTypeProperties withDiscountPercentage(Float discountPercentage) {
+ this.discountPercentage = discountPercentage;
+ return this;
+ }
+
+ /**
+ * Get the discountCombinationRule property: The discount combination rule when there are multiple applicable custom
+ * prices. Validation: Required. Supported values are Stackable and BestOf.
+ *
+ * @return the discountCombinationRule value.
+ */
+ public DiscountCombinationRule discountCombinationRule() {
+ return this.discountCombinationRule;
+ }
+
+ /**
+ * Set the discountCombinationRule property: The discount combination rule when there are multiple applicable custom
+ * prices. Validation: Required. Supported values are Stackable and BestOf.
+ *
+ * @param discountCombinationRule the discountCombinationRule value to set.
+ * @return the DiscountTypeProperties object itself.
+ */
+ public DiscountTypeProperties withDiscountCombinationRule(DiscountCombinationRule discountCombinationRule) {
+ this.discountCombinationRule = discountCombinationRule;
+ return this;
+ }
+
+ /**
+ * Get the priceGuaranteeProperties property: Set only in price guarantee scenario.
+ *
+ * @return the priceGuaranteeProperties value.
+ */
+ public PriceGuaranteeProperties priceGuaranteeProperties() {
+ return this.priceGuaranteeProperties;
+ }
+
+ /**
+ * Set the priceGuaranteeProperties property: Set only in price guarantee scenario.
+ *
+ * @param priceGuaranteeProperties the priceGuaranteeProperties value to set.
+ * @return the DiscountTypeProperties object itself.
+ */
+ public DiscountTypeProperties withPriceGuaranteeProperties(PriceGuaranteeProperties priceGuaranteeProperties) {
+ this.priceGuaranteeProperties = priceGuaranteeProperties;
+ return this;
+ }
+
+ /**
+ * Get the conditions property: Array of conditions for the discount. Validation: Optional. Maximum length is 1000.
+ *
+ * @return the conditions value.
+ */
+ public List conditions() {
+ return this.conditions;
+ }
+
+ /**
+ * Set the conditions property: Array of conditions for the discount. Validation: Optional. Maximum length is 1000.
+ *
+ * @param conditions the conditions value to set.
+ * @return the DiscountTypeProperties object itself.
+ */
+ public DiscountTypeProperties withConditions(List conditions) {
+ this.conditions = conditions;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (applyDiscountOn() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property applyDiscountOn in model DiscountTypeProperties"));
+ }
+ if (priceGuaranteeProperties() != null) {
+ priceGuaranteeProperties().validate();
+ }
+ if (conditions() != null) {
+ conditions().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DiscountTypeProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("applyDiscountOn",
+ this.applyDiscountOn == null ? null : this.applyDiscountOn.toString());
+ jsonWriter.writeStringField("discountType", this.discountType == null ? null : this.discountType.toString());
+ jsonWriter.writeNumberField("discountPercentage", this.discountPercentage);
+ jsonWriter.writeStringField("discountCombinationRule",
+ this.discountCombinationRule == null ? null : this.discountCombinationRule.toString());
+ jsonWriter.writeJsonField("priceGuaranteeProperties", this.priceGuaranteeProperties);
+ jsonWriter.writeArrayField("conditions", this.conditions, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiscountTypeProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiscountTypeProperties if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DiscountTypeProperties.
+ */
+ public static DiscountTypeProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("discountType".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("ProductFamily".equals(discriminatorValue)) {
+ return DiscountTypeProductFamily.fromJson(readerToUse.reset());
+ } else if ("Product".equals(discriminatorValue)) {
+ return DiscountTypeProduct.fromJson(readerToUse.reset());
+ } else if ("Sku".equals(discriminatorValue)) {
+ return DiscountTypeProductSku.fromJson(readerToUse.reset());
+ } else if ("CustomPrice".equals(discriminatorValue)) {
+ return DiscountTypeCustomPrice.fromJsonKnownDiscriminator(readerToUse.reset());
+ } else if ("CustomPriceMultiCurrency".equals(discriminatorValue)) {
+ return DiscountTypeCustomPriceMultiCurrency.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static DiscountTypeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiscountTypeProperties deserializedDiscountTypeProperties = new DiscountTypeProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("applyDiscountOn".equals(fieldName)) {
+ deserializedDiscountTypeProperties.applyDiscountOn = ApplyDiscountOn.fromString(reader.getString());
+ } else if ("discountType".equals(fieldName)) {
+ deserializedDiscountTypeProperties.discountType = DiscountType.fromString(reader.getString());
+ } else if ("discountPercentage".equals(fieldName)) {
+ deserializedDiscountTypeProperties.discountPercentage = reader.getNullable(JsonReader::getFloat);
+ } else if ("discountCombinationRule".equals(fieldName)) {
+ deserializedDiscountTypeProperties.discountCombinationRule
+ = DiscountCombinationRule.fromString(reader.getString());
+ } else if ("priceGuaranteeProperties".equals(fieldName)) {
+ deserializedDiscountTypeProperties.priceGuaranteeProperties
+ = PriceGuaranteeProperties.fromJson(reader);
+ } else if ("conditions".equals(fieldName)) {
+ List conditions = reader.readArray(reader1 -> ConditionsItem.fromJson(reader1));
+ deserializedDiscountTypeProperties.conditions = conditions;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiscountTypeProperties;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Discounts.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Discounts.java
new file mode 100644
index 000000000000..00755b8995a2
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Discounts.java
@@ -0,0 +1,156 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of Discounts.
+ */
+public interface Discounts {
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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.
+ */
+ void deleteByResourceGroup(String resourceGroupName, String discountName);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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.
+ */
+ void delete(String resourceGroupName, String discountName, Context context);
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List discounts at resource group level.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list();
+
+ /**
+ * List discounts at subscription level.
+ *
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list(Context context);
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts.
+ */
+ Discount cancel(String resourceGroupName, String discountName);
+
+ /**
+ * Cancel discount. Stops applying the benefit.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param discountName Name of the discount.
+ * @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 resource definition for Discounts.
+ */
+ Discount cancel(String resourceGroupName, String discountName, Context context);
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable scopeList(String scope);
+
+ /**
+ * List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
+ *
+ * @param scope The scope at which the benefits are listed.
+ * @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 discount list as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable scopeList(String scope, Context context);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param id the resource 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.
+ */
+ void deleteById(String id);
+
+ /**
+ * Delete discount. Clears the metadata from the user's view.
+ *
+ * @param id the resource 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.
+ */
+ void deleteByIdWithResponse(String id, Context context);
+
+ /**
+ * Begins definition for a new Discount resource.
+ *
+ * @param name resource name.
+ * @return the first stage of the new Discount definition.
+ */
+ Discount.DefinitionStages.Blank define(String name);
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/EntityTypeAffiliateDiscount.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/EntityTypeAffiliateDiscount.java
new file mode 100644
index 000000000000..e1834b9f621b
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/EntityTypeAffiliateDiscount.java
@@ -0,0 +1,215 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Entity type for affiliate discounts.
+ */
+@Fluent
+public final class EntityTypeAffiliateDiscount extends DiscountProperties {
+ /*
+ * This defines whether the entity being created is primary or affiliate. Supported values: primary, affiliate.
+ * Validation: Required, must match one of the 2 values.
+ */
+ private DiscountEntityType entityType = DiscountEntityType.AFFILIATE;
+
+ /*
+ * This will be present in the response if the primary has a resource ID
+ */
+ private String primaryResourceId;
+
+ /*
+ * End date of the discount. No duration will be supported. Allowed value is any date greater than or equal to
+ * startDate.
+ */
+ private OffsetDateTime endAt;
+
+ /**
+ * Creates an instance of EntityTypeAffiliateDiscount class.
+ */
+ public EntityTypeAffiliateDiscount() {
+ }
+
+ /**
+ * Get the entityType property: This defines whether the entity being created is primary or affiliate. Supported
+ * values: primary, affiliate. Validation: Required, must match one of the 2 values.
+ *
+ * @return the entityType value.
+ */
+ @Override
+ public DiscountEntityType entityType() {
+ return this.entityType;
+ }
+
+ /**
+ * Get the primaryResourceId property: This will be present in the response if the primary has a resource ID.
+ *
+ * @return the primaryResourceId value.
+ */
+ public String primaryResourceId() {
+ return this.primaryResourceId;
+ }
+
+ /**
+ * Get the endAt property: End date of the discount. No duration will be supported. Allowed value is any date
+ * greater than or equal to startDate.
+ *
+ * @return the endAt value.
+ */
+ public OffsetDateTime endAt() {
+ return this.endAt;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypeAffiliateDiscount withProductCode(String productCode) {
+ super.withProductCode(productCode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypeAffiliateDiscount withStartAt(OffsetDateTime startAt) {
+ super.withStartAt(startAt);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypeAffiliateDiscount withSystemId(String systemId) {
+ super.withSystemId(systemId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypeAffiliateDiscount withDisplayName(String displayName) {
+ super.withDisplayName(displayName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypeAffiliateDiscount withAppliedScopeType(DiscountAppliedScopeType appliedScopeType) {
+ super.withAppliedScopeType(appliedScopeType);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (productCode() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property productCode in model EntityTypeAffiliateDiscount"));
+ }
+ if (startAt() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property startAt in model EntityTypeAffiliateDiscount"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(EntityTypeAffiliateDiscount.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("productCode", productCode());
+ jsonWriter.writeStringField("startAt",
+ startAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startAt()));
+ jsonWriter.writeStringField("systemId", systemId());
+ jsonWriter.writeStringField("displayName", displayName());
+ jsonWriter.writeStringField("appliedScopeType",
+ appliedScopeType() == null ? null : appliedScopeType().toString());
+ jsonWriter.writeStringField("entityType", this.entityType == null ? null : this.entityType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of EntityTypeAffiliateDiscount from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of EntityTypeAffiliateDiscount if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the EntityTypeAffiliateDiscount.
+ */
+ public static EntityTypeAffiliateDiscount fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ EntityTypeAffiliateDiscount deserializedEntityTypeAffiliateDiscount = new EntityTypeAffiliateDiscount();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("productCode".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withProductCode(reader.getString());
+ } else if ("startAt".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withStartAt(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("systemId".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withSystemId(reader.getString());
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount
+ .withProvisioningState(DiscountProvisioningState.fromString(reader.getString()));
+ } else if ("billingAccountResourceId".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withBillingAccountResourceId(reader.getString());
+ } else if ("billingProfileResourceId".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withBillingProfileResourceId(reader.getString());
+ } else if ("customerResourceId".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withCustomerResourceId(reader.getString());
+ } else if ("displayName".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withDisplayName(reader.getString());
+ } else if ("status".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withStatus(DiscountStatus.fromString(reader.getString()));
+ } else if ("benefitResourceId".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.withBenefitResourceId(reader.getString());
+ } else if ("appliedScopeType".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount
+ .withAppliedScopeType(DiscountAppliedScopeType.fromString(reader.getString()));
+ } else if ("entityType".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.entityType
+ = DiscountEntityType.fromString(reader.getString());
+ } else if ("primaryResourceId".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.primaryResourceId = reader.getString();
+ } else if ("endAt".equals(fieldName)) {
+ deserializedEntityTypeAffiliateDiscount.endAt = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedEntityTypeAffiliateDiscount;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/EntityTypePrimaryDiscount.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/EntityTypePrimaryDiscount.java
new file mode 100644
index 000000000000..5120e74322f2
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/EntityTypePrimaryDiscount.java
@@ -0,0 +1,250 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Entity type for primary discounts.
+ */
+@Fluent
+public final class EntityTypePrimaryDiscount extends DiscountProperties {
+ /*
+ * This defines whether the entity being created is primary or affiliate. Supported values: primary, affiliate.
+ * Validation: Required, must match one of the 2 values.
+ */
+ private DiscountEntityType entityType = DiscountEntityType.PRIMARY;
+
+ /*
+ * This defines the conditions for a given discount type.
+ */
+ private DiscountTypeProperties discountTypeProperties;
+
+ /*
+ * End date of the discount. No duration will be supported. Allowed value is any date greater than or equal to
+ * startDate.
+ */
+ private OffsetDateTime endAt;
+
+ /**
+ * Creates an instance of EntityTypePrimaryDiscount class.
+ */
+ public EntityTypePrimaryDiscount() {
+ }
+
+ /**
+ * Get the entityType property: This defines whether the entity being created is primary or affiliate. Supported
+ * values: primary, affiliate. Validation: Required, must match one of the 2 values.
+ *
+ * @return the entityType value.
+ */
+ @Override
+ public DiscountEntityType entityType() {
+ return this.entityType;
+ }
+
+ /**
+ * Get the discountTypeProperties property: This defines the conditions for a given discount type.
+ *
+ * @return the discountTypeProperties value.
+ */
+ public DiscountTypeProperties discountTypeProperties() {
+ return this.discountTypeProperties;
+ }
+
+ /**
+ * Set the discountTypeProperties property: This defines the conditions for a given discount type.
+ *
+ * @param discountTypeProperties the discountTypeProperties value to set.
+ * @return the EntityTypePrimaryDiscount object itself.
+ */
+ public EntityTypePrimaryDiscount withDiscountTypeProperties(DiscountTypeProperties discountTypeProperties) {
+ this.discountTypeProperties = discountTypeProperties;
+ return this;
+ }
+
+ /**
+ * Get the endAt property: End date of the discount. No duration will be supported. Allowed value is any date
+ * greater than or equal to startDate.
+ *
+ * @return the endAt value.
+ */
+ public OffsetDateTime endAt() {
+ return this.endAt;
+ }
+
+ /**
+ * Set the endAt property: End date of the discount. No duration will be supported. Allowed value is any date
+ * greater than or equal to startDate.
+ *
+ * @param endAt the endAt value to set.
+ * @return the EntityTypePrimaryDiscount object itself.
+ */
+ public EntityTypePrimaryDiscount withEndAt(OffsetDateTime endAt) {
+ this.endAt = endAt;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypePrimaryDiscount withProductCode(String productCode) {
+ super.withProductCode(productCode);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypePrimaryDiscount withStartAt(OffsetDateTime startAt) {
+ super.withStartAt(startAt);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypePrimaryDiscount withSystemId(String systemId) {
+ super.withSystemId(systemId);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypePrimaryDiscount withDisplayName(String displayName) {
+ super.withDisplayName(displayName);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EntityTypePrimaryDiscount withAppliedScopeType(DiscountAppliedScopeType appliedScopeType) {
+ super.withAppliedScopeType(appliedScopeType);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (discountTypeProperties() != null) {
+ discountTypeProperties().validate();
+ }
+ if (endAt() == null) {
+ throw LOGGER.atError()
+ .log(
+ new IllegalArgumentException("Missing required property endAt in model EntityTypePrimaryDiscount"));
+ }
+ if (productCode() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property productCode in model EntityTypePrimaryDiscount"));
+ }
+ if (startAt() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property startAt in model EntityTypePrimaryDiscount"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(EntityTypePrimaryDiscount.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("productCode", productCode());
+ jsonWriter.writeStringField("startAt",
+ startAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startAt()));
+ jsonWriter.writeStringField("systemId", systemId());
+ jsonWriter.writeStringField("displayName", displayName());
+ jsonWriter.writeStringField("appliedScopeType",
+ appliedScopeType() == null ? null : appliedScopeType().toString());
+ jsonWriter.writeStringField("endAt",
+ this.endAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endAt));
+ jsonWriter.writeStringField("entityType", this.entityType == null ? null : this.entityType.toString());
+ jsonWriter.writeJsonField("discountTypeProperties", this.discountTypeProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of EntityTypePrimaryDiscount from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of EntityTypePrimaryDiscount if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the EntityTypePrimaryDiscount.
+ */
+ public static EntityTypePrimaryDiscount fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ EntityTypePrimaryDiscount deserializedEntityTypePrimaryDiscount = new EntityTypePrimaryDiscount();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("productCode".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withProductCode(reader.getString());
+ } else if ("startAt".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withStartAt(reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
+ } else if ("systemId".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withSystemId(reader.getString());
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount
+ .withProvisioningState(DiscountProvisioningState.fromString(reader.getString()));
+ } else if ("billingAccountResourceId".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withBillingAccountResourceId(reader.getString());
+ } else if ("billingProfileResourceId".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withBillingProfileResourceId(reader.getString());
+ } else if ("customerResourceId".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withCustomerResourceId(reader.getString());
+ } else if ("displayName".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withDisplayName(reader.getString());
+ } else if ("status".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withStatus(DiscountStatus.fromString(reader.getString()));
+ } else if ("benefitResourceId".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.withBenefitResourceId(reader.getString());
+ } else if ("appliedScopeType".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount
+ .withAppliedScopeType(DiscountAppliedScopeType.fromString(reader.getString()));
+ } else if ("endAt".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.endAt = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("entityType".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.entityType
+ = DiscountEntityType.fromString(reader.getString());
+ } else if ("discountTypeProperties".equals(fieldName)) {
+ deserializedEntityTypePrimaryDiscount.discountTypeProperties
+ = DiscountTypeProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedEntityTypePrimaryDiscount;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ManagedServiceIdentity.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ManagedServiceIdentity.java
new file mode 100644
index 000000000000..afae9f537085
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ManagedServiceIdentity.java
@@ -0,0 +1,190 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * Managed service identity (system assigned and/or user assigned identities).
+ */
+@Fluent
+public final class ManagedServiceIdentity implements JsonSerializable {
+ /*
+ * The service principal ID of the system assigned identity. This property will only be provided for a system
+ * assigned identity.
+ */
+ private UUID principalId;
+
+ /*
+ * The tenant ID of the system assigned identity. This property will only be provided for a system assigned
+ * identity.
+ */
+ private UUID tenantId;
+
+ /*
+ * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
+ */
+ private ManagedServiceIdentityType type;
+
+ /*
+ * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will
+ * be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/
+ * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.
+ */
+ private Map userAssignedIdentities;
+
+ /**
+ * Creates an instance of ManagedServiceIdentity class.
+ */
+ public ManagedServiceIdentity() {
+ }
+
+ /**
+ * Get the principalId property: The service principal ID of the system assigned identity. This property will only
+ * be provided for a system assigned identity.
+ *
+ * @return the principalId value.
+ */
+ public UUID principalId() {
+ return this.principalId;
+ }
+
+ /**
+ * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for
+ * a system assigned identity.
+ *
+ * @return the tenantId value.
+ */
+ public UUID tenantId() {
+ return this.tenantId;
+ }
+
+ /**
+ * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are
+ * allowed).
+ *
+ * @return the type value.
+ */
+ public ManagedServiceIdentityType type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are
+ * allowed).
+ *
+ * @param type the type value to set.
+ * @return the ManagedServiceIdentity object itself.
+ */
+ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The
+ * userAssignedIdentities dictionary keys will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
+ * The dictionary values can be empty objects ({}) in requests.
+ *
+ * @return the userAssignedIdentities value.
+ */
+ public Map userAssignedIdentities() {
+ return this.userAssignedIdentities;
+ }
+
+ /**
+ * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The
+ * userAssignedIdentities dictionary keys will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
+ * The dictionary values can be empty objects ({}) in requests.
+ *
+ * @param userAssignedIdentities the userAssignedIdentities value to set.
+ * @return the ManagedServiceIdentity object itself.
+ */
+ public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) {
+ this.userAssignedIdentities = userAssignedIdentities;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (type() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity"));
+ }
+ if (userAssignedIdentities() != null) {
+ userAssignedIdentities().values().forEach(e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
+ jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ManagedServiceIdentity from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ManagedServiceIdentity.
+ */
+ public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("type".equals(fieldName)) {
+ deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString());
+ } else if ("principalId".equals(fieldName)) {
+ deserializedManagedServiceIdentity.principalId
+ = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
+ } else if ("tenantId".equals(fieldName)) {
+ deserializedManagedServiceIdentity.tenantId
+ = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
+ } else if ("userAssignedIdentities".equals(fieldName)) {
+ Map userAssignedIdentities
+ = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1));
+ deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedManagedServiceIdentity;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ManagedServiceIdentityType.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ManagedServiceIdentityType.java
new file mode 100644
index 000000000000..37526e0892b4
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ManagedServiceIdentityType.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
+ */
+public final class ManagedServiceIdentityType extends ExpandableStringEnum {
+ /**
+ * Static value None for ManagedServiceIdentityType.
+ */
+ public static final ManagedServiceIdentityType NONE = fromString("None");
+
+ /**
+ * Static value SystemAssigned for ManagedServiceIdentityType.
+ */
+ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned");
+
+ /**
+ * Static value UserAssigned for ManagedServiceIdentityType.
+ */
+ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned");
+
+ /**
+ * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType.
+ */
+ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED
+ = fromString("SystemAssigned,UserAssigned");
+
+ /**
+ * Creates a new instance of ManagedServiceIdentityType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ManagedServiceIdentityType() {
+ }
+
+ /**
+ * Creates or finds a ManagedServiceIdentityType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ManagedServiceIdentityType.
+ */
+ public static ManagedServiceIdentityType fromString(String name) {
+ return fromString(name, ManagedServiceIdentityType.class);
+ }
+
+ /**
+ * Gets known ManagedServiceIdentityType values.
+ *
+ * @return known ManagedServiceIdentityType values.
+ */
+ public static Collection values() {
+ return values(ManagedServiceIdentityType.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/MarketSetPricesItems.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/MarketSetPricesItems.java
new file mode 100644
index 000000000000..be000540665b
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/MarketSetPricesItems.java
@@ -0,0 +1,168 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Items in the MarketSetPrices array.
+ */
+@Fluent
+public final class MarketSetPricesItems implements JsonSerializable {
+ /*
+ * The markets property.
+ */
+ private List markets;
+
+ /*
+ * The locked price for the priceable node. Validation: Required. Must be greater than or equal to 0. If the case of
+ * billing plans. This represents the price for each cycle charge.
+ */
+ private float value;
+
+ /*
+ * The currency of the locked price value. Validation: Required. Must be a valid ISO 4217 3-letter currency code.
+ */
+ private String currency;
+
+ /**
+ * Creates an instance of MarketSetPricesItems class.
+ */
+ public MarketSetPricesItems() {
+ }
+
+ /**
+ * Get the markets property: The markets property.
+ *
+ * @return the markets value.
+ */
+ public List markets() {
+ return this.markets;
+ }
+
+ /**
+ * Set the markets property: The markets property.
+ *
+ * @param markets the markets value to set.
+ * @return the MarketSetPricesItems object itself.
+ */
+ public MarketSetPricesItems withMarkets(List markets) {
+ this.markets = markets;
+ return this;
+ }
+
+ /**
+ * Get the value property: The locked price for the priceable node. Validation: Required. Must be greater than or
+ * equal to 0. If the case of billing plans. This represents the price for each cycle charge.
+ *
+ * @return the value value.
+ */
+ public float value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: The locked price for the priceable node. Validation: Required. Must be greater than or
+ * equal to 0. If the case of billing plans. This represents the price for each cycle charge.
+ *
+ * @param value the value value to set.
+ * @return the MarketSetPricesItems object itself.
+ */
+ public MarketSetPricesItems withValue(float value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Get the currency property: The currency of the locked price value. Validation: Required. Must be a valid ISO 4217
+ * 3-letter currency code.
+ *
+ * @return the currency value.
+ */
+ public String currency() {
+ return this.currency;
+ }
+
+ /**
+ * Set the currency property: The currency of the locked price value. Validation: Required. Must be a valid ISO 4217
+ * 3-letter currency code.
+ *
+ * @param currency the currency value to set.
+ * @return the MarketSetPricesItems object itself.
+ */
+ public MarketSetPricesItems withCurrency(String currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (markets() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property markets in model MarketSetPricesItems"));
+ }
+ if (currency() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property currency in model MarketSetPricesItems"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(MarketSetPricesItems.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("markets", this.markets, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeFloatField("value", this.value);
+ jsonWriter.writeStringField("currency", this.currency);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of MarketSetPricesItems from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of MarketSetPricesItems if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the MarketSetPricesItems.
+ */
+ public static MarketSetPricesItems fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ MarketSetPricesItems deserializedMarketSetPricesItems = new MarketSetPricesItems();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("markets".equals(fieldName)) {
+ List markets = reader.readArray(reader1 -> reader1.getString());
+ deserializedMarketSetPricesItems.markets = markets;
+ } else if ("value".equals(fieldName)) {
+ deserializedMarketSetPricesItems.value = reader.getFloat();
+ } else if ("currency".equals(fieldName)) {
+ deserializedMarketSetPricesItems.currency = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedMarketSetPricesItems;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Plan.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Plan.java
new file mode 100644
index 000000000000..b73b562de7e0
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/Plan.java
@@ -0,0 +1,224 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Plan for the resource.
+ */
+@Fluent
+public final class Plan implements JsonSerializable {
+ /*
+ * A user defined name of the 3rd Party Artifact that is being procured.
+ */
+ private String name;
+
+ /*
+ * The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic
+ */
+ private String publisher;
+
+ /*
+ * The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the
+ * artifact at the time of Data Market onboarding.
+ */
+ private String product;
+
+ /*
+ * A publisher provided promotion code as provisioned in Data Market for the said product/artifact.
+ */
+ private String promotionCode;
+
+ /*
+ * The version of the desired product/artifact.
+ */
+ private String version;
+
+ /**
+ * Creates an instance of Plan class.
+ */
+ public Plan() {
+ }
+
+ /**
+ * Get the name property: A user defined name of the 3rd Party Artifact that is being procured.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: A user defined name of the 3rd Party Artifact that is being procured.
+ *
+ * @param name the name value to set.
+ * @return the Plan object itself.
+ */
+ public Plan withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic.
+ *
+ * @return the publisher value.
+ */
+ public String publisher() {
+ return this.publisher;
+ }
+
+ /**
+ * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic.
+ *
+ * @param publisher the publisher value to set.
+ * @return the Plan object itself.
+ */
+ public Plan withPublisher(String publisher) {
+ this.publisher = publisher;
+ return this;
+ }
+
+ /**
+ * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the
+ * OfferID specified for the artifact at the time of Data Market onboarding.
+ *
+ * @return the product value.
+ */
+ public String product() {
+ return this.product;
+ }
+
+ /**
+ * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the
+ * OfferID specified for the artifact at the time of Data Market onboarding.
+ *
+ * @param product the product value to set.
+ * @return the Plan object itself.
+ */
+ public Plan withProduct(String product) {
+ this.product = product;
+ return this;
+ }
+
+ /**
+ * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said
+ * product/artifact.
+ *
+ * @return the promotionCode value.
+ */
+ public String promotionCode() {
+ return this.promotionCode;
+ }
+
+ /**
+ * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said
+ * product/artifact.
+ *
+ * @param promotionCode the promotionCode value to set.
+ * @return the Plan object itself.
+ */
+ public Plan withPromotionCode(String promotionCode) {
+ this.promotionCode = promotionCode;
+ return this;
+ }
+
+ /**
+ * Get the version property: The version of the desired product/artifact.
+ *
+ * @return the version value.
+ */
+ public String version() {
+ return this.version;
+ }
+
+ /**
+ * Set the version property: The version of the desired product/artifact.
+ *
+ * @param version the version value to set.
+ * @return the Plan object itself.
+ */
+ public Plan withVersion(String version) {
+ this.version = version;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (name() == null) {
+ throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Plan"));
+ }
+ if (publisher() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property publisher in model Plan"));
+ }
+ if (product() == null) {
+ throw LOGGER.atError().log(new IllegalArgumentException("Missing required property product in model Plan"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(Plan.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeStringField("publisher", this.publisher);
+ jsonWriter.writeStringField("product", this.product);
+ jsonWriter.writeStringField("promotionCode", this.promotionCode);
+ jsonWriter.writeStringField("version", this.version);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of Plan from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of Plan if the JsonReader was pointing to an instance of it, or null if it was pointing to
+ * JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the Plan.
+ */
+ public static Plan fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ Plan deserializedPlan = new Plan();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedPlan.name = reader.getString();
+ } else if ("publisher".equals(fieldName)) {
+ deserializedPlan.publisher = reader.getString();
+ } else if ("product".equals(fieldName)) {
+ deserializedPlan.product = reader.getString();
+ } else if ("promotionCode".equals(fieldName)) {
+ deserializedPlan.promotionCode = reader.getString();
+ } else if ("version".equals(fieldName)) {
+ deserializedPlan.version = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPlan;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PriceGuaranteeProperties.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PriceGuaranteeProperties.java
new file mode 100644
index 000000000000..9d45b4a33861
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PriceGuaranteeProperties.java
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Set only in price guarantee scenario.
+ */
+@Fluent
+public final class PriceGuaranteeProperties implements JsonSerializable {
+ /*
+ * Supported values: Protected, Locked
+ */
+ private PricingPolicy pricingPolicy;
+
+ /*
+ * The date on which prices are to be used for guarantee calculation. Validation: expected to be 00 hours, Format:
+ * 2024-09-30T00:00:00Z. Must be in UTC.
+ */
+ private OffsetDateTime priceGuaranteeDate;
+
+ /**
+ * Creates an instance of PriceGuaranteeProperties class.
+ */
+ public PriceGuaranteeProperties() {
+ }
+
+ /**
+ * Get the pricingPolicy property: Supported values: Protected, Locked.
+ *
+ * @return the pricingPolicy value.
+ */
+ public PricingPolicy pricingPolicy() {
+ return this.pricingPolicy;
+ }
+
+ /**
+ * Set the pricingPolicy property: Supported values: Protected, Locked.
+ *
+ * @param pricingPolicy the pricingPolicy value to set.
+ * @return the PriceGuaranteeProperties object itself.
+ */
+ public PriceGuaranteeProperties withPricingPolicy(PricingPolicy pricingPolicy) {
+ this.pricingPolicy = pricingPolicy;
+ return this;
+ }
+
+ /**
+ * Get the priceGuaranteeDate property: The date on which prices are to be used for guarantee calculation.
+ * Validation: expected to be 00 hours, Format: 2024-09-30T00:00:00Z. Must be in UTC.
+ *
+ * @return the priceGuaranteeDate value.
+ */
+ public OffsetDateTime priceGuaranteeDate() {
+ return this.priceGuaranteeDate;
+ }
+
+ /**
+ * Set the priceGuaranteeDate property: The date on which prices are to be used for guarantee calculation.
+ * Validation: expected to be 00 hours, Format: 2024-09-30T00:00:00Z. Must be in UTC.
+ *
+ * @param priceGuaranteeDate the priceGuaranteeDate value to set.
+ * @return the PriceGuaranteeProperties object itself.
+ */
+ public PriceGuaranteeProperties withPriceGuaranteeDate(OffsetDateTime priceGuaranteeDate) {
+ this.priceGuaranteeDate = priceGuaranteeDate;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("pricingPolicy", this.pricingPolicy == null ? null : this.pricingPolicy.toString());
+ jsonWriter.writeStringField("priceGuaranteeDate",
+ this.priceGuaranteeDate == null
+ ? null
+ : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.priceGuaranteeDate));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PriceGuaranteeProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PriceGuaranteeProperties if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the PriceGuaranteeProperties.
+ */
+ public static PriceGuaranteeProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PriceGuaranteeProperties deserializedPriceGuaranteeProperties = new PriceGuaranteeProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("pricingPolicy".equals(fieldName)) {
+ deserializedPriceGuaranteeProperties.pricingPolicy = PricingPolicy.fromString(reader.getString());
+ } else if ("priceGuaranteeDate".equals(fieldName)) {
+ deserializedPriceGuaranteeProperties.priceGuaranteeDate = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPriceGuaranteeProperties;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PricingPolicy.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PricingPolicy.java
new file mode 100644
index 000000000000..fb21dfd41db0
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PricingPolicy.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Supported values: Protected, Locked.
+ */
+public final class PricingPolicy extends ExpandableStringEnum {
+ /**
+ * Static value Protected for PricingPolicy.
+ */
+ public static final PricingPolicy PROTECTED = fromString("Protected");
+
+ /**
+ * Static value Locked for PricingPolicy.
+ */
+ public static final PricingPolicy LOCKED = fromString("Locked");
+
+ /**
+ * Creates a new instance of PricingPolicy value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public PricingPolicy() {
+ }
+
+ /**
+ * Creates or finds a PricingPolicy from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding PricingPolicy.
+ */
+ public static PricingPolicy fromString(String name) {
+ return fromString(name, PricingPolicy.class);
+ }
+
+ /**
+ * Gets known PricingPolicy values.
+ *
+ * @return known PricingPolicy values.
+ */
+ public static Collection values() {
+ return values(PricingPolicy.class);
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PurchaseRequest.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PurchaseRequest.java
index e3dde5ce000f..61937fd7ed9c 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PurchaseRequest.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/PurchaseRequest.java
@@ -21,7 +21,7 @@ public final class PurchaseRequest implements JsonSerializable
/*
* The SKU to be applied for this resource
*/
- private Sku sku;
+ private ResourceSku sku;
/*
* The properties property.
@@ -39,7 +39,7 @@ public PurchaseRequest() {
*
* @return the sku value.
*/
- public Sku sku() {
+ public ResourceSku sku() {
return this.sku;
}
@@ -49,7 +49,7 @@ public Sku sku() {
* @param sku the sku value to set.
* @return the PurchaseRequest object itself.
*/
- public PurchaseRequest withSku(Sku sku) {
+ public PurchaseRequest withSku(ResourceSku sku) {
this.sku = sku;
return this;
}
@@ -303,7 +303,7 @@ public static PurchaseRequest fromJson(JsonReader jsonReader) throws IOException
reader.nextToken();
if ("sku".equals(fieldName)) {
- deserializedPurchaseRequest.sku = Sku.fromJson(reader);
+ deserializedPurchaseRequest.sku = ResourceSku.fromJson(reader);
} else if ("properties".equals(fieldName)) {
deserializedPurchaseRequest.innerProperties = PurchaseRequestProperties.fromJson(reader);
} else {
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasRequest.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasRequest.java
index abadc319e9ac..075f375ea05d 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasRequest.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasRequest.java
@@ -23,7 +23,7 @@ public final class ReservationOrderAliasRequest extends ProxyResource {
/*
* Reservation order SKU
*/
- private Sku sku;
+ private ResourceSku sku;
/*
* The Azure Region where the reservation benefits are applied to.
@@ -66,7 +66,7 @@ public ReservationOrderAliasRequest() {
*
* @return the sku value.
*/
- public Sku sku() {
+ public ResourceSku sku() {
return this.sku;
}
@@ -76,7 +76,7 @@ public Sku sku() {
* @param sku the sku value to set.
* @return the ReservationOrderAliasRequest object itself.
*/
- public ReservationOrderAliasRequest withSku(Sku sku) {
+ public ReservationOrderAliasRequest withSku(ResourceSku sku) {
this.sku = sku;
return this;
}
@@ -466,7 +466,7 @@ public static ReservationOrderAliasRequest fromJson(JsonReader jsonReader) throw
} else if ("type".equals(fieldName)) {
deserializedReservationOrderAliasRequest.type = reader.getString();
} else if ("sku".equals(fieldName)) {
- deserializedReservationOrderAliasRequest.sku = Sku.fromJson(reader);
+ deserializedReservationOrderAliasRequest.sku = ResourceSku.fromJson(reader);
} else if ("location".equals(fieldName)) {
deserializedReservationOrderAliasRequest.location = reader.getString();
} else if ("properties".equals(fieldName)) {
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasResponse.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasResponse.java
index 2631eee7f63f..93f3a69df6fc 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasResponse.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ReservationOrderAliasResponse.java
@@ -38,7 +38,7 @@ public interface ReservationOrderAliasResponse {
*
* @return the sku value.
*/
- Sku sku();
+ ResourceSku sku();
/**
* Gets the location property: The Azure Region where the reserved resource lives.
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ResourceModelWithAllowedPropertySet.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ResourceModelWithAllowedPropertySet.java
new file mode 100644
index 000000000000..180375ef82c0
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ResourceModelWithAllowedPropertySet.java
@@ -0,0 +1,370 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * The resource model definition containing the full set of allowed properties for a resource. Except properties bag,
+ * there cannot be a top level property outside of this set.
+ */
+@Fluent
+public class ResourceModelWithAllowedPropertySet extends Resource {
+ /*
+ * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed
+ * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is
+ * removed from the template since it is managed by another resource.
+ */
+ private String managedBy;
+
+ /*
+ * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g.
+ * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist
+ * this value.
+ */
+ private String kind;
+
+ /*
+ * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header
+ * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested
+ * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section
+ * 14.26), and If-Range (section 14.27) header fields.
+ */
+ private String etag;
+
+ /*
+ * Managed service identity (system assigned and/or user assigned identities)
+ */
+ private ManagedServiceIdentity identity;
+
+ /*
+ * The resource model definition representing SKU
+ */
+ private Sku sku;
+
+ /*
+ * Plan for the resource.
+ */
+ private Plan plan;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of ResourceModelWithAllowedPropertySet class.
+ */
+ public ResourceModelWithAllowedPropertySet() {
+ }
+
+ /**
+ * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates
+ * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not
+ * delete the resource if it is removed from the template since it is managed by another resource.
+ *
+ * @return the managedBy value.
+ */
+ public String managedBy() {
+ return this.managedBy;
+ }
+
+ /**
+ * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates
+ * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not
+ * delete the resource if it is removed from the template since it is managed by another resource.
+ *
+ * @param managedBy the managedBy value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ public ResourceModelWithAllowedPropertySet withManagedBy(String managedBy) {
+ this.managedBy = managedBy;
+ return this;
+ }
+
+ /**
+ * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of
+ * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must
+ * validate and persist this value.
+ *
+ * @return the kind value.
+ */
+ public String kind() {
+ return this.kind;
+ }
+
+ /**
+ * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of
+ * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must
+ * validate and persist this value.
+ *
+ * @param kind the kind value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ public ResourceModelWithAllowedPropertySet withKind(String kind) {
+ this.kind = kind;
+ return this;
+ }
+
+ /**
+ * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be
+ * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from
+ * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24),
+ * If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ *
+ * @return the etag value.
+ */
+ public String etag() {
+ return this.etag;
+ }
+
+ /**
+ * Set the etag property: The etag field is *not* required. If it is provided in the response body, it must also be
+ * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from
+ * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24),
+ * If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ *
+ * @param etag the etag value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ ResourceModelWithAllowedPropertySet withEtag(String etag) {
+ this.etag = etag;
+ return this;
+ }
+
+ /**
+ * Get the identity property: Managed service identity (system assigned and/or user assigned identities).
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: Managed service identity (system assigned and/or user assigned identities).
+ *
+ * @param identity the identity value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ public ResourceModelWithAllowedPropertySet withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the sku property: The resource model definition representing SKU.
+ *
+ * @return the sku value.
+ */
+ public Sku sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the sku property: The resource model definition representing SKU.
+ *
+ * @param sku the sku value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ public ResourceModelWithAllowedPropertySet withSku(Sku sku) {
+ this.sku = sku;
+ return this;
+ }
+
+ /**
+ * Get the plan property: Plan for the resource.
+ *
+ * @return the plan value.
+ */
+ public Plan plan() {
+ return this.plan;
+ }
+
+ /**
+ * Set the plan property: Plan for the resource.
+ *
+ * @param plan the plan value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ public ResourceModelWithAllowedPropertySet withPlan(Plan plan) {
+ this.plan = plan;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @param systemData the systemData value to set.
+ * @return the ResourceModelWithAllowedPropertySet object itself.
+ */
+ ResourceModelWithAllowedPropertySet withSystemData(SystemData systemData) {
+ this.systemData = systemData;
+ return this;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ResourceModelWithAllowedPropertySet withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ResourceModelWithAllowedPropertySet withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (sku() != null) {
+ sku().validate();
+ }
+ if (plan() != null) {
+ plan().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("managedBy", this.managedBy);
+ jsonWriter.writeStringField("kind", this.kind);
+ jsonWriter.writeJsonField("identity", this.identity);
+ jsonWriter.writeJsonField("sku", this.sku);
+ jsonWriter.writeJsonField("plan", this.plan);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ResourceModelWithAllowedPropertySet from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ResourceModelWithAllowedPropertySet if the JsonReader was pointing to an instance of it,
+ * or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ResourceModelWithAllowedPropertySet.
+ */
+ public static ResourceModelWithAllowedPropertySet fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceModelWithAllowedPropertySet deserializedResourceModelWithAllowedPropertySet
+ = new ResourceModelWithAllowedPropertySet();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedResourceModelWithAllowedPropertySet.withTags(tags);
+ } else if ("managedBy".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.managedBy = reader.getString();
+ } else if ("kind".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.kind = reader.getString();
+ } else if ("etag".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.etag = reader.getString();
+ } else if ("identity".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.identity = ManagedServiceIdentity.fromJson(reader);
+ } else if ("sku".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.sku = Sku.fromJson(reader);
+ } else if ("plan".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.plan = Plan.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedResourceModelWithAllowedPropertySet.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedResourceModelWithAllowedPropertySet;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ResourceSku.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ResourceSku.java
new file mode 100644
index 000000000000..1ac710503225
--- /dev/null
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/ResourceSku.java
@@ -0,0 +1,93 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.billingbenefits.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The SKU to be applied for this resource.
+ */
+@Fluent
+public final class ResourceSku implements JsonSerializable {
+ /*
+ * Name of the SKU to be applied
+ */
+ private String name;
+
+ /**
+ * Creates an instance of ResourceSku class.
+ */
+ public ResourceSku() {
+ }
+
+ /**
+ * Get the name property: Name of the SKU to be applied.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Name of the SKU to be applied.
+ *
+ * @param name the name value to set.
+ * @return the ResourceSku object itself.
+ */
+ public ResourceSku withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ResourceSku from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ResourceSku if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ResourceSku.
+ */
+ public static ResourceSku fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceSku deserializedResourceSku = new ResourceSku();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedResourceSku.name = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedResourceSku;
+ });
+ }
+}
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanModel.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanModel.java
index 7614ffa21c89..8aef72a9b991 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanModel.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanModel.java
@@ -38,7 +38,7 @@ public interface SavingsPlanModel {
*
* @return the sku value.
*/
- Sku sku();
+ ResourceSku sku();
/**
* Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderAliasModel.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderAliasModel.java
index b71ddb6edfb2..f3c685010545 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderAliasModel.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderAliasModel.java
@@ -37,7 +37,7 @@ public interface SavingsPlanOrderAliasModel {
*
* @return the sku value.
*/
- Sku sku();
+ ResourceSku sku();
/**
* Gets the kind property: Resource provider kind.
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderModel.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderModel.java
index e50a43868f0c..655e7c9932a9 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderModel.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlanOrderModel.java
@@ -39,7 +39,7 @@ public interface SavingsPlanOrderModel {
*
* @return the sku value.
*/
- Sku sku();
+ ResourceSku sku();
/**
* Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlans.java b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlans.java
index a629556d822d..51045ec23449 100644
--- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlans.java
+++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/src/main/java/com/azure/resourcemanager/billingbenefits/models/SavingsPlans.java
@@ -100,7 +100,6 @@ Response getWithResponse(String savingsPlanOrderId, String sav
* @param savingsPlanOrderId Order ID of the savings plan.
* @param savingsPlanId ID of the savings plan.
* @param body Request body for patching a savings plan order alias.
- * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
@@ -108,8 +107,7 @@ Response getWithResponse(String savingsPlanOrderId, String sav
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return savings plan.
*/
- Response updateWithResponse(String savingsPlanOrderId, String savingsPlanId,
- SavingsPlanUpdateRequest body, Context context);
+ SavingsPlanModel update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body);
/**
* Update savings plan.
@@ -117,6 +115,7 @@ Response