diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 29bc3feba840..c540c452eac6 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -308,7 +308,7 @@ com.azure.resourcemanager:azure-resourcemanager-postgresql;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0;1.1.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.5;1.0.0-beta.6 com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0;1.1.0 com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.7.0;1.8.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-kusto;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-loganalytics;2.2.0;2.3.0-beta.1 diff --git a/sdk/cosmos/azure-cosmos-tests/pom.xml b/sdk/cosmos/azure-cosmos-tests/pom.xml index cba84004a5a4..3df383bff3bc 100644 --- a/sdk/cosmos/azure-cosmos-tests/pom.xml +++ b/sdk/cosmos/azure-cosmos-tests/pom.xml @@ -261,7 +261,7 @@ Licensed under the MIT License. org.codehaus.mojo exec-maven-plugin - 3.5.1 + 3.6.3 com.azure.cosmos.CosmosTestAccountJanitor test diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/CHANGELOG.md b/sdk/costmanagement/azure-resourcemanager-costmanagement/CHANGELOG.md index d7225af28706..75120f1f7f70 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/CHANGELOG.md +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/CHANGELOG.md @@ -1,14 +1,622 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0 (2026-08-12) -### Features Added +- Azure Resource Manager CostManagement client library for Java. This package contains Microsoft Azure SDK for CostManagement Management SDK. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package api-version 2026-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.BenefitRecommendationsListResult` was removed + +#### `models.OperationListResult` was removed + +#### `models.ViewListResult` was removed + +#### `models.BenefitUtilizationSummariesListResult` was removed + +#### `models.ScheduledActionListResult` was removed + +#### `models.DimensionsListResult` was removed + +#### `models.ScheduledActionProxyResource` was removed + +#### `models.AlertPropertiesDetails` was modified + +* `validate()` was removed + +#### `models.ForecastFilter` was modified + +* `validate()` was removed + +#### `models.ReportConfigSorting` was modified + +* `validate()` was removed + +#### `models.QueryDatasetConfiguration` was modified + +* `validate()` was removed + +#### `models.BenefitRecommendationProperties` was modified + +* `models.BenefitRecommendationProperties withLookBackPeriod(models.LookBackPeriod)` -> `models.BenefitRecommendationProperties withLookBackPeriod(models.LookBackPeriod)` +* `models.BenefitRecommendationProperties withRecommendationDetails(models.AllSavingsBenefitDetails)` -> `models.BenefitRecommendationProperties withRecommendationDetails(models.AllSavingsBenefitDetails)` +* `models.BenefitRecommendationProperties withTerm(models.Term)` -> `models.BenefitRecommendationProperties withTerm(models.Term)` +* `validate()` was removed +* `models.BenefitRecommendationProperties withUsage(models.RecommendationUsageDetails)` -> `models.BenefitRecommendationProperties withUsage(models.RecommendationUsageDetails)` +* `models.BenefitRecommendationProperties withCommitmentGranularity(models.Grain)` -> `models.BenefitRecommendationProperties withCommitmentGranularity(models.Grain)` + +#### `models.ExportDeliveryInfo` was modified + +* `validate()` was removed + +#### `models.Status` was modified + +* `Status()` was changed to private access +* `withStatus(models.ReportOperationStatusType)` was removed +* `validate()` was removed + +#### `models.BlobInfo` was modified + +* `BlobInfo()` was changed to private access +* `withBlobLink(java.lang.String)` was removed +* `validate()` was removed +* `withByteCount(java.lang.Long)` was removed + +#### `models.ReportConfigTimePeriod` was modified + +* `validate()` was removed + +#### `models.QueryDataset` was modified + +* `validate()` was removed + +#### `models.ForecastAggregation` was modified + +* `validate()` was removed + +#### `models.BenefitResource` was modified + +* `models.BenefitResource withKind(models.BenefitKind)` -> `models.BenefitResource withKind(models.BenefitKind)` +* `validate()` was removed + +#### `models.GenerateDetailedCostReportTimePeriod` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.CostManagementProxyResource` was modified + +* `validate()` was removed +* `models.CostManagementProxyResource withEtag(java.lang.String)` -> `models.CostManagementProxyResource withEtag(java.lang.String)` + +#### `models.QueryGrouping` was modified + +* `validate()` was removed + +#### `models.ReportConfigAggregation` was modified + +* `validate()` was removed + +#### `models.ReportConfigDataset` was modified + +* `validate()` was removed + +#### `models.ReportConfigDatasetConfiguration` was modified + +* `validate()` was removed + +#### `models.CostDetailsTimePeriod` was modified + +* `validate()` was removed + +#### `models.GenerateDetailedCostReportDefinition` was modified + +* `validate()` was removed + +#### `models.RecommendationUsageDetails` was modified + +* `RecommendationUsageDetails()` was changed to private access +* `withUsageGrain(models.Grain)` was removed +* `validate()` was removed + +#### `models.QueryDefinition` was modified + +* `validate()` was removed + +#### `models.SavingsPlanUtilizationSummary` was modified + +* `SavingsPlanUtilizationSummary()` was changed to private access +* `validate()` was removed +* `withBenefitType(models.BenefitKind)` was removed + +#### `models.Exports` was modified + +* `executeWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ForecastColumn` was modified + +* `ForecastColumn()` was changed to private access +* `withName(java.lang.String)` was removed +* `validate()` was removed +* `withType(java.lang.String)` was removed + +#### `models.ReportConfigFilter` was modified + +* `validate()` was removed + +#### `models.BenefitUtilizationSummaryProperties` was modified + +* `models.BenefitUtilizationSummaryProperties withBenefitType(models.BenefitKind)` -> `models.BenefitUtilizationSummaryProperties withBenefitType(models.BenefitKind)` +* `validate()` was removed + +#### `models.QueryComparisonExpression` was modified + +* `validate()` was removed + +#### `models.QueryColumn` was modified + +* `QueryColumn()` was changed to private access +* `validate()` was removed +* `withName(java.lang.String)` was removed +* `withType(java.lang.String)` was removed + +#### `models.CostManagementResource` was modified + +* `withLocation(java.lang.String)` was removed +* `withTags(java.util.Map)` was removed +* `models.CostManagementResource withLocation(java.lang.String)` -> `models.CostManagementResource withLocation(java.lang.String)` +* `validate()` was removed +* `models.CostManagementResource withTags(java.util.Map)` -> `models.CostManagementResource withTags(java.util.Map)` + +#### `CostManagementManager` was modified + +* `fluent.CostManagementClient serviceClient()` -> `fluent.CostManagementManagementClient serviceClient()` + +#### `models.ForecastTimePeriod` was modified + +* `validate()` was removed + +#### `models.SingleScopeBenefitRecommendationProperties` was modified + +* `SingleScopeBenefitRecommendationProperties()` was changed to private access +* `withLookBackPeriod(models.LookBackPeriod)` was removed +* `withRecommendationDetails(models.AllSavingsBenefitDetails)` was removed +* `withTerm(models.Term)` was removed +* `withUsage(models.RecommendationUsageDetails)` was removed +* `validate()` was removed +* `withCommitmentGranularity(models.Grain)` was removed + +#### `models.ExportSchedule` was modified + +* `validate()` was removed + +#### `models.PivotProperties` was modified + +* `validate()` was removed + +#### `models.CheckNameAvailabilityRequest` was modified + +* `validate()` was removed + +#### `models.DismissAlertPayload` was modified + +* `validate()` was removed + +#### `models.KpiProperties` was modified + +* `validate()` was removed + +#### `models.GenerateCostDetailsReportRequestDefinition` was modified + +* `validate()` was removed + +#### `models.Export` was modified + +* `executeWithResponse(com.azure.core.util.Context)` was removed + +#### `models.ExportTimePeriod` was modified + +* `validate()` was removed + +#### `models.ForecastDefinition` was modified + +* `validate()` was removed + +#### `models.ForecastComparisonExpression` was modified + +* `validate()` was removed + +#### `models.ExportDatasetConfiguration` was modified + +* `validate()` was removed + +#### `models.ForecastDataset` was modified + +* `validate()` was removed + +#### `models.ExportRecurrencePeriod` was modified + +* `validate()` was removed + +#### `models.Operation` was modified + +* `validate()` was removed +* `models.Operation withDisplay(models.OperationDisplay)` -> `models.Operation withDisplay(models.OperationDisplay)` + +#### `models.PriceSheets` was modified + +* `download(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `models.DownloadUrl downloadByBillingProfile(java.lang.String,java.lang.String)` -> `models.PricesheetDownloadProperties downloadByBillingProfile(java.lang.String,java.lang.String)` +* `download(java.lang.String,java.lang.String,java.lang.String)` was removed +* `models.DownloadUrl downloadByBillingProfile(java.lang.String,java.lang.String,com.azure.core.util.Context)` -> `models.PricesheetDownloadProperties downloadByBillingProfile(java.lang.String,java.lang.String,com.azure.core.util.Context)` + +#### `models.ExportDeliveryDestination` was modified + +* `validate()` was removed + +#### `models.QueryFilter` was modified + +* `validate()` was removed + +#### `models.ReportConfigComparisonExpression` was modified + +* `validate()` was removed + +#### `models.QueryAggregation` was modified + +* `validate()` was removed + +#### `models.ExportDataset` was modified + +* `validate()` was removed + +#### `models.ExportDefinition` was modified + +* `validate()` was removed + +#### `models.AllSavingsList` was modified + +* `AllSavingsList()` was changed to private access +* `validate()` was removed + +#### `models.QueryTimePeriod` was modified + +* `validate()` was removed + +#### `models.ForecastDatasetConfiguration` was modified + +* `validate()` was removed + +#### `models.AllSavingsBenefitDetails` was modified + +* `AllSavingsBenefitDetails()` was changed to private access +* `validate()` was removed + +#### `models.IncludedQuantityUtilizationSummary` was modified + +* `IncludedQuantityUtilizationSummary()` was changed to private access +* `withBenefitType(models.BenefitKind)` was removed +* `validate()` was removed + +#### `models.SharedScopeBenefitRecommendationProperties` was modified + +* `SharedScopeBenefitRecommendationProperties()` was changed to private access +* `withTerm(models.Term)` was removed +* `validate()` was removed +* `withLookBackPeriod(models.LookBackPeriod)` was removed +* `withCommitmentGranularity(models.Grain)` was removed +* `withUsage(models.RecommendationUsageDetails)` was removed +* `withRecommendationDetails(models.AllSavingsBenefitDetails)` was removed + +#### `models.ReportConfigGrouping` was modified + +* `validate()` was removed + +#### `models.ScheduleProperties` was modified + +* `validate()` was removed + +#### `models.NotificationProperties` was modified + +* `validate()` was removed + +#### `models.FileDestination` was modified + +* `validate()` was removed + +#### `models.AlertPropertiesDefinition` was modified + +* `validate()` was removed + +### Features Added + +* `models.Budget$Update` was added + +* `models.CostAllocationRuleDetails` was added + +* `models.BudgetFilter` was added + +* `models.AsyncOperationStatusProperties` was added + +* `models.FilterItemNames` was added + +* `models.MarkupRules` was added + +* `models.CostAllocationRuleCheckNameAvailabilityResponse` was added + +* `models.ExportSuspensionContext` was added + +* `models.ExportRunRequest` was added + +* `models.CostAllocationRuleDefinition` was added + +* `models.CompressionModeType` was added + +* `models.CostAllocationRuleCheckNameAvailabilityRequest` was added + +* `models.CostAllocationResource` was added + +* `models.CostAllocationProportion` was added + +* `models.BudgetComparisonExpression` was added + +* `models.FilterItems` was added + +* `models.SourceCostAllocationResource` was added + +* `models.SystemAssignedServiceIdentity` was added + +* `models.CostAllocationPolicyType` was added + +* `models.BudgetOperatorType` was added + +* `models.TimeGrainType` was added + +* `models.CultureCode` was added + +* `models.BudgetTimePeriod` was added + +* `models.ManagementGroupScopeBenefitRecommendationProperties` was added + +* `models.MarkupRule` was added + +* `models.BenefitUtilizationSummariesOperationStatus` was added + +* `models.CurrentSpend` was added + +* `models.SettingsKind` was added + +* `models.TagInheritanceProperties` was added + +* `models.Notification` was added + +* `models.CustomerMetadata` was added + +* `models.BudgetFilterProperties` was added + +* `models.BenefitUtilizationSummaryReportSchema` was added + +* `models.Budgets` was added + +* `models.MCAPriceSheetProperties` was added + +* `models.Budget$UpdateStages` was added + +* `models.PricesheetDownloadProperties` was added + +* `models.BudgetNotificationOperatorType` was added + +* `models.CostAllocationRuleProperties` was added + +* `models.DestinationType` was added + +* `models.TagInheritanceSetting` was added + +* `models.MarkupRuleProperties` was added + +* `models.Reason` was added + +* `models.Setting` was added + +* `models.SystemAssignedServiceIdentityType` was added + +* `models.ForecastSpend` was added + +* `models.Budget$DefinitionStages` was added + +* `models.CategoryType` was added + +* `models.CostAllocationResourceType` was added + +* `models.BenefitUtilizationSummariesRequest` was added + +* `models.GenerateBenefitUtilizationSummariesReports` was added + +* `models.DataOverwriteBehaviorType` was added + +* `models.CostAllocationRules` was added + +* `models.RuleStatus` was added + +* `models.Settings` was added + +* `models.SettingsListResult` was added + +* `models.Frequency` was added + +* `models.TargetCostAllocationResource` was added + +* `models.SettingType` was added + +* `models.Budget$Definition` was added + +* `models.ThresholdType` was added + +* `models.Budget` was added + +#### `models.View$Update` was modified + +* `withModifiedOn(java.time.OffsetDateTime)` was added + +#### `models.View` was modified + +* `systemData()` was added + +#### `models.GenerateDetailedCostReportOperationResult` was modified + +* `systemData()` was added + +#### `models.BenefitResource` was modified + +* `systemData()` was added + +#### `models.View$Definition` was modified + +* `withModifiedOn(java.time.OffsetDateTime)` was added + +#### `models.CommonExportProperties` was modified + +* `systemSuspensionContext()` was added +* `dataOverwriteBehavior()` was added +* `exportDescription()` was added +* `compressionMode()` was added + +#### `models.SavingsPlanUtilizationSummary` was modified + +* `systemData()` was added + +#### `models.Exports` was modified + +* `executeWithResponse(java.lang.String,java.lang.String,models.ExportRunRequest,com.azure.core.util.Context)` was added + +#### `models.FormatType` was modified + +* `PARQUET` was added + +#### `models.Export$Definition` was modified + +* `withDataOverwriteBehavior(models.DataOverwriteBehaviorType)` was added +* `withCompressionMode(models.CompressionModeType)` was added +* `withRegion(java.lang.String)` was added +* `withIdentity(models.SystemAssignedServiceIdentity)` was added +* `withExportDescription(java.lang.String)` was added +* `withRegion(com.azure.core.management.Region)` was added + +#### `models.CostManagementResource` was modified + +* `tags()` was added +* `location()` was added + +#### `CostManagementManager` was modified + +* `costAllocationRules()` was added +* `generateBenefitUtilizationSummariesReports()` was added +* `settings()` was added +* `budgets()` was added +* `markupRules()` was added + +#### `models.Export` was modified + +* `location()` was added +* `compressionMode()` was added +* `systemData()` was added +* `exportDescription()` was added +* `region()` was added +* `regionName()` was added +* `executeWithResponse(models.ExportRunRequest,com.azure.core.util.Context)` was added +* `identity()` was added +* `dataOverwriteBehavior()` was added +* `systemSuspensionContext()` was added + +#### `models.ExportType` was modified + +* `FOCUS_COST` was added +* `PRICE_SHEET` was added +* `RESERVATION_RECOMMENDATIONS` was added +* `RESERVATION_TRANSACTIONS` was added +* `RESERVATION_DETAILS` was added + +#### `models.ExportRun` was modified + +* `manifestFile()` was added +* `startDate()` was added +* `endDate()` was added + +#### `models.ExportRunProperties` was modified + +* `startDate()` was added +* `manifestFile()` was added +* `endDate()` was added + +#### `models.ExportDatasetConfiguration` was modified + +* `dataVersion()` was added +* `withDataVersion(java.lang.String)` was added +* `filters()` was added +* `withFilters(java.util.List)` was added + +#### `models.BenefitUtilizationSummary` was modified + +* `systemData()` was added + +#### `models.TimeframeType` was modified + +* `THE_CURRENT_MONTH` was added + +#### `models.PriceSheets` was modified + +* `downloadByInvoice(java.lang.String,java.lang.String,java.lang.String)` was added +* `downloadByBillingAccount(java.lang.String,java.lang.String)` was added +* `downloadByInvoice(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `downloadByBillingAccount(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ExportDeliveryDestination` was modified + +* `withType(models.DestinationType)` was added +* `type()` was added + +#### `models.BenefitRecommendationModel` was modified + +* `systemData()` was added + +#### `models.Export$Update` was modified + +* `withIdentity(models.SystemAssignedServiceIdentity)` was added +* `withCompressionMode(models.CompressionModeType)` was added +* `withExportDescription(java.lang.String)` was added +* `withDataOverwriteBehavior(models.DataOverwriteBehaviorType)` was added + +#### `models.GranularityType` was modified + +* `MONTHLY` was added + +#### `models.ScheduledAction$Definition` was modified + +* `withEtag(java.lang.String)` was added + +#### `models.GenerateDetailedCostReportOperationStatuses` was modified + +* `systemData()` was added + +#### `models.Alert` was modified + +* `systemData()` was added + +#### `models.Scope` was modified + +* `MANAGEMENT_GROUP` was added + +#### `models.IncludedQuantityUtilizationSummary` was modified + +* `systemData()` was added + +#### `models.ScheduledAction$Update` was modified -### Other Changes +* `withEtag(java.lang.String)` was added ## 1.0.0 (2024-12-24) diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/README.md b/sdk/costmanagement/azure-resourcemanager-costmanagement/README.md index 1f893603120d..428f8c8cf32e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/README.md +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/README.md @@ -2,7 +2,7 @@ Azure Resource Manager CostManagement client library for Java. -This package contains Microsoft Azure SDK for CostManagement Management SDK. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for CostManagement Management SDK. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package api-version 2026-06-01. 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-costmanagement - 1.1.0-beta.1 + 1.1.0 ``` [//]: # ({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 @@ CostManagementManager manager = CostManagementManager .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/costmanagement/azure-resourcemanager-costmanagement/SAMPLE.md b/sdk/costmanagement/azure-resourcemanager-costmanagement/SAMPLE.md index b18be2bbe44b..793347a2f4ce 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/SAMPLE.md +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/SAMPLE.md @@ -19,6 +19,21 @@ - [ListBySavingsPlanId](#benefitutilizationsummaries_listbysavingsplanid) - [ListBySavingsPlanOrder](#benefitutilizationsummaries_listbysavingsplanorder) +## Budgets + +- [CreateOrUpdate](#budgets_createorupdate) +- [Delete](#budgets_delete) +- [Get](#budgets_get) +- [List](#budgets_list) + +## CostAllocationRules + +- [CheckNameAvailability](#costallocationrules_checknameavailability) +- [CreateOrUpdate](#costallocationrules_createorupdate) +- [Delete](#costallocationrules_delete) +- [Get](#costallocationrules_get) +- [List](#costallocationrules_list) + ## Dimensions - [ByExternalCloudProviderType](#dimensions_byexternalcloudprovidertype) @@ -38,6 +53,15 @@ - [ExternalCloudProviderUsage](#forecast_externalcloudproviderusage) - [Usage](#forecast_usage) +## GenerateBenefitUtilizationSummariesReport + +- [GenerateByBillingAccount](#generatebenefitutilizationsummariesreport_generatebybillingaccount) +- [GenerateByBillingProfile](#generatebenefitutilizationsummariesreport_generatebybillingprofile) +- [GenerateByReservationId](#generatebenefitutilizationsummariesreport_generatebyreservationid) +- [GenerateByReservationOrderId](#generatebenefitutilizationsummariesreport_generatebyreservationorderid) +- [GenerateBySavingsPlanId](#generatebenefitutilizationsummariesreport_generatebysavingsplanid) +- [GenerateBySavingsPlanOrderId](#generatebenefitutilizationsummariesreport_generatebysavingsplanorderid) + ## GenerateCostDetailsReport - [CreateOperation](#generatecostdetailsreport_createoperation) @@ -60,14 +84,22 @@ - [ByBillingAccountId](#generatereservationdetailsreport_bybillingaccountid) - [ByBillingProfileId](#generatereservationdetailsreport_bybillingprofileid) +## MarkupRules + +- [CreateOrUpdate](#markuprules_createorupdate) +- [Delete](#markuprules_delete) +- [Get](#markuprules_get) +- [List](#markuprules_list) + ## Operations - [List](#operations_list) ## PriceSheet -- [Download](#pricesheet_download) +- [DownloadByBillingAccount](#pricesheet_downloadbybillingaccount) - [DownloadByBillingProfile](#pricesheet_downloadbybillingprofile) +- [DownloadByInvoice](#pricesheet_downloadbyinvoice) ## Query @@ -89,6 +121,13 @@ - [Run](#scheduledactions_run) - [RunByScope](#scheduledactions_runbyscope) +## Settings + +- [CreateOrUpdateByScope](#settings_createorupdatebyscope) +- [DeleteByScope](#settings_deletebyscope) +- [GetByScope](#settings_getbyscope) +- [List](#settings_list) + ## Views - [CreateOrUpdate](#views_createorupdate) @@ -110,9 +149,7 @@ import com.azure.resourcemanager.costmanagement.models.DismissAlertPayload; */ public final class AlertsDismissSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DismissResourceGroupAlerts.json + * x-ms-original-file: 2026-06-01/DismissResourceGroupAlerts.json */ /** * Sample code: PatchResourceGroupAlerts. @@ -129,9 +166,7 @@ public final class AlertsDismissSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DismissSubscriptionAlerts.json + * x-ms-original-file: 2026-06-01/DismissSubscriptionAlerts.json */ /** * Sample code: PatchSubscriptionAlerts. @@ -155,9 +190,7 @@ public final class AlertsDismissSamples { */ public final class AlertsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SingleSubscriptionAlert.json + * x-ms-original-file: 2026-06-01/SingleSubscriptionAlert.json */ /** * Sample code: SingleSubscriptionAlerts. @@ -172,9 +205,7 @@ public final class AlertsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SingleResourceGroupAlert.json + * x-ms-original-file: 2026-06-01/SingleResourceGroupAlert.json */ /** * Sample code: SingleResourceGroupAlerts. @@ -198,9 +229,7 @@ public final class AlertsGetSamples { */ public final class AlertsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionAlerts.json + * x-ms-original-file: 2026-06-01/SubscriptionAlerts.json */ /** * Sample code: SubscriptionAlerts. @@ -213,9 +242,7 @@ public final class AlertsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingProfileAlerts.json + * x-ms-original-file: 2026-06-01/BillingProfileAlerts.json */ /** * Sample code: BillingProfileAlerts. @@ -224,14 +251,12 @@ public final class AlertsListSamples { */ public static void billingProfileAlerts(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.alerts() - .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", + .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupAlerts.json + * x-ms-original-file: 2026-06-01/ResourceGroupAlerts.json */ /** * Sample code: ResourceGroupAlerts. @@ -246,9 +271,7 @@ public final class AlertsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentAlerts.json + * x-ms-original-file: 2026-06-01/DepartmentAlerts.json */ /** * Sample code: DepartmentAlerts. @@ -262,9 +285,7 @@ public final class AlertsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * InvoiceSectionAlerts.json + * x-ms-original-file: 2026-06-01/InvoiceSectionAlerts.json */ /** * Sample code: InvoiceSectionAlerts. @@ -279,9 +300,7 @@ public final class AlertsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountAlerts.json + * x-ms-original-file: 2026-06-01/BillingAccountAlerts.json */ /** * Sample code: BillingAccountAlerts. @@ -290,14 +309,12 @@ public final class AlertsListSamples { */ public static void billingAccountAlerts(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.alerts() - .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345:6789", + .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345-6789", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountAlerts.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountAlerts.json */ /** * Sample code: EnrollmentAccountAlerts. @@ -322,9 +339,7 @@ import com.azure.resourcemanager.costmanagement.models.ExternalCloudProviderType */ public final class AlertsListExternalSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountAlerts.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountAlerts.json */ /** * Sample code: ExternalBillingAccountAlerts. @@ -339,9 +354,7 @@ public final class AlertsListExternalSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionAlerts.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionAlerts.json */ /** * Sample code: ExternalSubscriptionAlerts. @@ -365,9 +378,23 @@ public final class AlertsListExternalSamples { */ public final class BenefitRecommendationsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitRecommendationsByBillingAccount.json + * x-ms-original-file: 2026-06-01/BenefitRecommendationsByBillingAccountForManagementGroup.json + */ + /** + * Sample code: BenefitRecommendationsManagementGroupList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void benefitRecommendationsManagementGroupList( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.benefitRecommendations() + .list("providers/Microsoft.Billing/billingAccounts/123456", + "properties/scope eq 'ManagementGroup' AND properties/managementGroupId eq '/providers/Microsoft.Management/managementGroups/00000000-0000-0000-0000-000000000001' AND properties/lookBackPeriod eq 'Last7Days' AND properties/term eq 'P1Y'", + null, "properties/usage,properties/allRecommendationDetails", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/BenefitRecommendationsByBillingAccount.json */ /** * Sample code: BenefitRecommendationsBillingAccountList. @@ -393,9 +420,7 @@ public final class BenefitRecommendationsListSamples { */ public final class BenefitUtilizationSummariesListByBillingAccountIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json */ /** * Sample code: SavingsPlanUtilizationSummaries-BillingAccount. @@ -421,9 +446,7 @@ public final class BenefitUtilizationSummariesListByBillingAccountIdSamples { */ public final class BenefitUtilizationSummariesListByBillingProfileIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json */ /** * Sample code: SavingsPlanUtilizationSummaries-BillingProfile. @@ -450,9 +473,7 @@ public final class BenefitUtilizationSummariesListByBillingProfileIdSamples { */ public final class BenefitUtilizationSummariesListBySavingsPlanIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json */ /** * Sample code: SavingsPlanUtilizationSummariesMonthlyWithSavingsPlanId. @@ -477,9 +498,7 @@ public final class BenefitUtilizationSummariesListBySavingsPlanIdSamples { */ public final class BenefitUtilizationSummariesListBySavingsPlanOrderSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json */ /** * Sample code: SavingsPlanUtilizationSummariesDaily. @@ -495,402 +514,1187 @@ public final class BenefitUtilizationSummariesListBySavingsPlanOrderSamples { } ``` -### Dimensions_ByExternalCloudProviderType +### Budgets_CreateOrUpdate ```java -import com.azure.resourcemanager.costmanagement.models.ExternalCloudProviderType; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for Dimensions ByExternalCloudProviderType. + * Samples for Budgets CreateOrUpdate. */ -public final class DimensionsByExternalCloudProviderTypeSamples { +public final class BudgetsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionsDimensions.json + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule-ReservationIdFilter.json */ /** - * Sample code: ExternalSubscriptionDimensionList. + * Sample code: CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter. * * @param manager Entry point to CostManagementManager. */ - public static void - externalSubscriptionDimensionList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .byExternalCloudProviderType(ExternalCloudProviderType.EXTERNAL_SUBSCRIPTIONS, "100", null, null, null, - null, com.azure.core.util.Context.NONE); + public static void createOrUpdateReservationUtilizationBillingAccountEAAlertRuleReservationIdFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST7DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservationId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountsDimensions.json + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json */ /** - * Sample code: ExternalBillingAccountDimensionList. + * Sample code: CreateOrUpdate-Cost-Subscription-Budget. * * @param manager Entry point to CostManagementManager. */ public static void - externalBillingAccountDimensionList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .byExternalCloudProviderType(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "100", null, null, null, - null, com.azure.core.util.Context.NONE); + createOrUpdateCostSubscriptionBudget(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestBudget") + .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.COST) + .withAmount(100.65D) + .withTimeGrain(TimeGrainType.MONTHLY) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2024-10-31T00:00:00Z"))) + .withFilter(new BudgetFilter().withAnd(Arrays.asList( + new BudgetFilterProperties().withDimensions(new BudgetComparisonExpression().withName("ResourceId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("category") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("Dev", "Prod"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("department") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("engineering", "sales")))))) + .withNotifications(mapOf("Actual_GreaterThan_80_Percent", new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.GREATER_THAN) + .withThreshold(80.0) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withContactRoles(Arrays.asList("Contributor", "Reader")) + .withContactGroups(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.EN_US))) + .create(); } -} -``` - -### Dimensions_List -```java -/** - * Samples for Dimensions List. - */ -public final class DimensionsListSamples { /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerDimensionsList.json + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule-ReservedResourceTypeFilter.json */ /** - * Sample code: CustomerDimensionsList-MCA. + * Sample code: CreateOrUpdate-ReservationUtilization-CustomerCSP-AlertRule-ReservedResourceTypeFilter. * * @param manager Entry point to CostManagementManager. */ - public static void - customerDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", null, null, null, null, - com.azure.core.util.Context.NONE); + public static void createOrUpdateReservationUtilizationCustomerCSPAlertRuleReservedResourceTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter( + new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservedResourceType") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("VirtualMachines", "SqlDatabases", "CosmosDb")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentDimensionsList.json + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule.json */ /** - * Sample code: DepartmentDimensionsList-Legacy. + * Sample code: CreateOrUpdate-ReservationUtilization-CustomerCSP-AlertRule.json. * * @param manager Entry point to CostManagementManager. */ - public static void - departmentDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", null, null, null, null, - com.azure.core.util.Context.NONE); + public static void createOrUpdateReservationUtilizationCustomerCSPAlertRuleJson( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter()) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionDimensionsListWithFilter.json + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule-ReservationIdFilter.json */ /** - * Sample code: InvoiceSectionDimensionsListWithFilter-MCA. + * Sample code: CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule-ReservationIdFilter. * * @param manager Entry point to CostManagementManager. */ - public static void invoiceSectionDimensionsListWithFilterMCA( + public static void createOrUpdateReservationUtilizationBillingProfileMCAAlertRuleReservationIdFilter( com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", - "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservationId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule.json */ /** - * Sample code: CustomerDimensionsListWithFilter-MCA. + * Sample code: CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule.json. * * @param manager Entry point to CostManagementManager. */ - public static void - customerDimensionsListWithFilterMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", - "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + public static void createOrUpdateReservationUtilizationBillingProfileMCAAlertRuleJson( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter()) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule.json */ /** - * Sample code: ManagementGroupDimensionsListWithFilter-Legacy. + * Sample code: CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule. * * @param manager Entry point to CostManagementManager. */ - public static void managementGroupDimensionsListWithFilterLegacy( + public static void createOrUpdateReservationUtilizationBillingAccountEAAlertRule( com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Management/managementGroups/MyMgId", "properties/category eq 'resourceId'", - "properties/data", null, 5, com.azure.core.util.Context.NONE); + manager.budgets() + .define("TestAlertRule") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST7DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter()) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountDimensionsList.json + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule-ReservedResourceTypeFilter + * .json */ /** - * Sample code: BillingAccountDimensionsList-Legacy. + * Sample code: CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter. * * @param manager Entry point to CostManagementManager. */ - public static void - billingAccountDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100", null, null, null, null, - com.azure.core.util.Context.NONE); + public static void createOrUpdateReservationUtilizationBillingAccountEAAlertRuleReservedResourceTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST7DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter( + new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservedResourceType") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("VirtualMachines", "SqlDatabases", "CosmosDb")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupDimensionsListExpandAndTop.json + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule-ReservedResourceTypeFilter. + * json */ /** - * Sample code: ManagementGroupDimensionsListExpandAndTop-Legacy. + * Sample code: CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule-ReservedResourceTypeFilter. * * @param manager Entry point to CostManagementManager. */ - public static void managementGroupDimensionsListExpandAndTopLegacy( + public static void createOrUpdateReservationUtilizationBillingProfileMCAAlertRuleReservedResourceTypeFilter( com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Management/managementGroups/MyMgId", null, "properties/data", null, 5, - com.azure.core.util.Context.NONE); + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter( + new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservedResourceType") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("VirtualMachines", "SqlDatabases", "CosmosDb")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); } /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileDimensionsList.json + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule-ReservationIdFilter.json */ /** - * Sample code: BillingProfileDimensionsList-MCA. + * Sample code: CreateOrUpdate-ReservationUtilization-CustomerCSP-AlertRule-ReservationIdFilter. * * @param manager Entry point to CostManagementManager. */ - public static void - billingProfileDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", null, null, null, - null, com.azure.core.util.Context.NONE); + public static void createOrUpdateReservationUtilizationCustomerCSPAlertRuleReservationIdFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservationId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .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; } +} +``` + +### Budgets_Delete +```java +/** + * Samples for Budgets Delete. + */ +public final class BudgetsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/Budgets/Delete/DeleteBudget.json */ /** - * Sample code: DepartmentDimensionsListExpandAndTop-Legacy. + * Sample code: DeleteBudget. * * @param manager Entry point to CostManagementManager. */ - public static void departmentDimensionsListExpandAndTopLegacy( - com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", null, "properties/data", null, 5, + public static void deleteBudget(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .deleteByResourceGroupWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", com.azure.core.util.Context.NONE); } +} +``` + +### Budgets_Get +```java +/** + * Samples for Budgets Get. + */ +public final class BudgetsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountDimensionsList.json + * x-ms-original-file: 2026-06-01/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json */ /** - * Sample code: EnrollmentAccountDimensionsList-Legacy. + * Sample code: Get-ReservationUtilization-AlertRule. * * @param manager Entry point to CostManagementManager. */ public static void - enrollmentAccountDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", null, null, null, null, - com.azure.core.util.Context.NONE); + getReservationUtilizationAlertRule(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .getWithResponse( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN", + "TestAlertRule", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/Budgets/Get/Cost/Get-Cost-Budget.json */ /** - * Sample code: BillingAccountDimensionsListExpandAndTop-MCA. + * Sample code: Get-Cost-Budget. * * @param manager Entry point to CostManagementManager. */ - public static void billingAccountDimensionsListExpandAndTopMCA( - com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789", null, "properties/data", null, 5, + public static void getCostBudget(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", com.azure.core.util.Context.NONE); } +} +``` + +### Budgets_List +```java +/** + * Samples for Budgets List. + */ +public final class BudgetsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingProfileBudgetsList.json */ /** - * Sample code: BillingAccountDimensionsListWithFilter-Legacy. + * Sample code: BillingProfileBudgetsList-MCA. * * @param manager Entry point to CostManagementManager. */ - public static void billingAccountDimensionsListWithFilterLegacy( + public static void + billingProfileBudgetsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/CustomerBudgetsList-CategoryTypeFilter.json + */ + /** + * Sample code: CustomerBudgetsList-MCA-CSP-CategoryTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void customerBudgetsListMCACSPCategoryTypeFilter( com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100", "properties/category eq 'resourceId'", - "properties/data", null, 5, com.azure.core.util.Context.NONE); + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupDimensionsList.json + * x-ms-original-file: 2026-06-01/Budgets/List/EA/BillingAccountBudgetsList-EA.json */ /** - * Sample code: ResourceGroupDimensionsList-Legacy. + * Sample code: BillingAccountBudgetsList-EA. * * @param manager Entry point to CostManagementManager. */ public static void - resourceGroupDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando", null, - "properties/data", null, 5, com.azure.core.util.Context.NONE); + billingAccountBudgetsListEA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionDimensionsList.json + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/CustomerBudgetsList.json */ /** - * Sample code: SubscriptionDimensionsList-Legacy. + * Sample code: CustomerBudgetsList-MCA-CSP. * * @param manager Entry point to CostManagementManager. */ public static void - subscriptionDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, "properties/data", null, 5, - com.azure.core.util.Context.NONE); + customerBudgetsListMCACSP(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444", + null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json */ /** - * Sample code: BillingAccountDimensionsListExpandAndTop-Legacy. + * Sample code: BillingAccountBudgetsList-EA-CategoryTypeFilter. * * @param manager Entry point to CostManagementManager. */ - public static void billingAccountDimensionsListExpandAndTopLegacy( + public static void billingAccountBudgetsListEACategoryTypeFilter( com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100", null, "properties/data", null, 5, - com.azure.core.util.Context.NONE); + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountDimensionsList.json + * x-ms-original-file: 2026-06-01/Budgets/List/RBAC/ManagementGroupBudgetsList.json */ /** - * Sample code: BillingAccountDimensionsList-MCA. + * Sample code: ManagementGroupBudgetsList. * * @param manager Entry point to CostManagementManager. */ public static void - billingAccountDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789", null, null, null, null, - com.azure.core.util.Context.NONE); + managementGroupBudgetsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("Microsoft.Management/managementGroups/MYDEVTESTMG", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/Budgets/List/EA/DepartmentBudgetsList.json */ /** - * Sample code: EnrollmentAccountDimensionsListExpandAndTop-Legacy. + * Sample code: DepartmentBudgetsList-EA. * * @param manager Entry point to CostManagementManager. */ - public static void enrollmentAccountDimensionsListExpandAndTopLegacy( - com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", null, "properties/data", - null, 5, com.azure.core.util.Context.NONE); + public static void departmentBudgetsListEA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456/departments/789101", null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/Budgets/List/EA/EnrollmentAccountBudgetsList.json */ /** - * Sample code: CustomerDimensionsListExpandAndTop-MCA. + * Sample code: EnrollmentAccountBudgetsList-EA. * * @param manager Entry point to CostManagementManager. */ public static void - customerDimensionsListExpandAndTopMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", null, "properties/data", - null, 5, com.azure.core.util.Context.NONE); + enrollmentAccountBudgetsListEA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/473845", null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json */ /** - * Sample code: DepartmentDimensionsListWithFilter-Legacy. + * Sample code: BillingProfileBudgetsList-MCA-CategoryTypeFilter. * * @param manager Entry point to CostManagementManager. */ - public static void departmentDimensionsListWithFilterLegacy( + public static void billingProfileBudgetsListMCACategoryTypeFilter( com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", - "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionDimensionsList.json + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json */ /** - * Sample code: InvoiceSectionDimensionsList-MCA. + * Sample code: BillingAccountBudgetsList-MCA. * * @param manager Entry point to CostManagementManager. */ public static void - invoiceSectionDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", - null, null, null, null, com.azure.core.util.Context.NONE); + billingAccountBudgetsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json + */ + /** + * Sample code: BillingAccountBudgetsList-MCA-CategoryTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingAccountBudgetsListMCACategoryTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/InvoiceSectionBudgetsList.json + */ + /** + * Sample code: InvoiceSectionBudgetsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + invoiceSectionBudgetsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/invoiceSections/AAAA-BBBB-CCC-DDD", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/RBAC/ResourceGroupBudgetsList.json + */ + /** + * Sample code: ResourceGroupBudgetsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + resourceGroupBudgetsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/RBAC/SubscriptionBudgetsList.json + */ + /** + * Sample code: SubscriptionBudgetsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void subscriptionBudgetsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, com.azure.core.util.Context.NONE); + } +} +``` + +### CostAllocationRules_CheckNameAvailability + +```java +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; + +/** + * Samples for CostAllocationRules CheckNameAvailability. + */ +public final class CostAllocationRulesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleCheckNameAvailability.json + */ + /** + * Sample code: CostAllocationRuleCheckNameAvailability. + * + * @param manager Entry point to CostManagementManager. + */ + public static void costAllocationRuleCheckNameAvailability( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .checkNameAvailabilityWithResponse("100", + new CostAllocationRuleCheckNameAvailabilityRequest().withName("testRule") + .withType("Microsoft.CostManagement/costAllocationRules"), + com.azure.core.util.Context.NONE); + } +} +``` + +### CostAllocationRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.util.Arrays; + +/** + * Samples for CostAllocationRules CreateOrUpdate. + */ +public final class CostAllocationRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleCreateTag.json + */ + /** + * Sample code: CostAllocationRulesCreateTag. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + costAllocationRulesCreateTag(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .createOrUpdateWithResponse("100", "testRule", + new CostAllocationRuleDefinitionInner().withProperties(new CostAllocationRuleProperties() + .withDescription("This is a testRule") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources(Arrays + .asList(new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("category") + .withValues(Arrays.asList("devops")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ResourceGroupName") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("destinationRG").withPercentage(33.33), + new CostAllocationProportion().withName("destinationRG2").withPercentage(33.33), + new CostAllocationProportion().withName("destinationRG3").withPercentage(33.34))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.ACTIVE)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleCreate.json + */ + /** + * Sample code: CostAllocationRulesCreateResourceGroup. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + costAllocationRulesCreateResourceGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .createOrUpdateWithResponse("100", "testRule", + new CostAllocationRuleDefinitionInner().withProperties(new CostAllocationRuleProperties() + .withDescription("This is a testRule") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources(Arrays.asList( + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ResourceGroupName") + .withValues(Arrays.asList("sampleRG", "secondRG")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ResourceGroupName") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("destinationRG").withPercentage(45.0), + new CostAllocationProportion().withName("destinationRG2").withPercentage(54.0))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.ACTIVE)), + com.azure.core.util.Context.NONE); + } +} +``` + +### CostAllocationRules_Delete + +```java +/** + * Samples for CostAllocationRules Delete. + */ +public final class CostAllocationRulesDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleDelete.json + */ + /** + * Sample code: DeleteCostAllocationRule. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + deleteCostAllocationRule(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .deleteByResourceGroupWithResponse("100", "testRule", com.azure.core.util.Context.NONE); + } +} +``` + +### CostAllocationRules_Get + +```java +/** + * Samples for CostAllocationRules Get. + */ +public final class CostAllocationRulesGetSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleGet.json + */ + /** + * Sample code: CostAllocationRules. + * + * @param manager Entry point to CostManagementManager. + */ + public static void costAllocationRules(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules().getWithResponse("100", "testRule", com.azure.core.util.Context.NONE); + } +} +``` + +### CostAllocationRules_List + +```java +/** + * Samples for CostAllocationRules List. + */ +public final class CostAllocationRulesListSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRulesList.json + */ + /** + * Sample code: CostAllocationRulesList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void costAllocationRulesList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules().list("100", com.azure.core.util.Context.NONE); + } +} +``` + +### Dimensions_ByExternalCloudProviderType + +```java +import com.azure.resourcemanager.costmanagement.models.ExternalCloudProviderType; + +/** + * Samples for Dimensions ByExternalCloudProviderType. + */ +public final class DimensionsByExternalCloudProviderTypeSamples { + /* + * x-ms-original-file: 2026-06-01/ExternalSubscriptionsDimensions.json + */ + /** + * Sample code: ExternalSubscriptionDimensionList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + externalSubscriptionDimensionList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .byExternalCloudProviderType(ExternalCloudProviderType.EXTERNAL_SUBSCRIPTIONS, "100", null, null, null, + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/ExternalBillingAccountsDimensions.json + */ + /** + * Sample code: ExternalBillingAccountDimensionList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + externalBillingAccountDimensionList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .byExternalCloudProviderType(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "100", null, null, null, + null, com.azure.core.util.Context.NONE); + } +} +``` + +### Dimensions_List + +```java +/** + * Samples for Dimensions List. + */ +public final class DimensionsListSamples { + /* + * x-ms-original-file: 2026-06-01/MCACustomerDimensionsList.json + */ + /** + * Sample code: CustomerDimensionsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + customerDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", null, null, null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/DepartmentDimensionsList.json + */ + /** + * Sample code: DepartmentDimensionsList-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + departmentDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", null, null, null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionDimensionsListWithFilter.json + */ + /** + * Sample code: InvoiceSectionDimensionsListWithFilter-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void invoiceSectionDimensionsListWithFilterMCA( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", + "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCACustomerDimensionsListWithFilter.json + */ + /** + * Sample code: CustomerDimensionsListWithFilter-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + customerDimensionsListWithFilterMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", + "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/ManagementGroupDimensionsListWithFilter.json + */ + /** + * Sample code: ManagementGroupDimensionsListWithFilter-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void managementGroupDimensionsListWithFilterLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Management/managementGroups/MyMgId", "properties/category eq 'resourceId'", + "properties/data", null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/BillingAccountDimensionsList.json + */ + /** + * Sample code: BillingAccountDimensionsList-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingAccountDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100", null, null, null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/ManagementGroupDimensionsListExpandAndTop.json + */ + /** + * Sample code: ManagementGroupDimensionsListExpandAndTop-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void managementGroupDimensionsListExpandAndTopLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Management/managementGroups/MyMgId", null, "properties/data", null, 5, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCABillingProfileDimensionsList.json + */ + /** + * Sample code: BillingProfileDimensionsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingProfileDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", null, null, null, + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/DepartmentDimensionsListExpandAndTop.json + */ + /** + * Sample code: DepartmentDimensionsListExpandAndTop-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void departmentDimensionsListExpandAndTopLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", null, "properties/data", null, 5, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/EnrollmentAccountDimensionsList.json + */ + /** + * Sample code: EnrollmentAccountDimensionsList-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + enrollmentAccountDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", null, null, null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCABillingAccountDimensionsListExpandAndTop.json + */ + /** + * Sample code: BillingAccountDimensionsListExpandAndTop-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingAccountDimensionsListExpandAndTopMCA( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789", null, "properties/data", null, 5, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/BillingAccountDimensionsListWithFilter.json + */ + /** + * Sample code: BillingAccountDimensionsListWithFilter-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingAccountDimensionsListWithFilterLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100", "properties/category eq 'resourceId'", + "properties/data", null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/ResourceGroupDimensionsList.json + */ + /** + * Sample code: ResourceGroupDimensionsList-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + resourceGroupDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando", null, + "properties/data", null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/SubscriptionDimensionsList.json + */ + /** + * Sample code: SubscriptionDimensionsList-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + subscriptionDimensionsListLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, "properties/data", null, 5, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/BillingAccountDimensionsListExpandAndTop.json + */ + /** + * Sample code: BillingAccountDimensionsListExpandAndTop-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingAccountDimensionsListExpandAndTopLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100", null, "properties/data", null, 5, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCABillingAccountDimensionsList.json + */ + /** + * Sample code: BillingAccountDimensionsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingAccountDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789", null, null, null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/EnrollmentAccountDimensionsListExpandAndTop.json + */ + /** + * Sample code: EnrollmentAccountDimensionsListExpandAndTop-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void enrollmentAccountDimensionsListExpandAndTopLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", null, "properties/data", + null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/DepartmentDimensionsListWithFilter.json + */ + /** + * Sample code: DepartmentDimensionsListWithFilter-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void departmentDimensionsListWithFilterLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", + "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCACustomerDimensionsListExpandAndTop.json + */ + /** + * Sample code: CustomerDimensionsListExpandAndTop-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + customerDimensionsListExpandAndTopMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", null, "properties/data", + null, 5, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionDimensionsList.json + */ + /** + * Sample code: InvoiceSectionDimensionsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + invoiceSectionDimensionsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.dimensions() + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", + null, null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionDimensionsListExpandAndTop.json */ /** * Sample code: InvoiceSectionDimensionsListExpandAndTop-MCA. @@ -905,9 +1709,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupDimensionsList.json + * x-ms-original-file: 2026-06-01/ManagementGroupDimensionsList.json */ /** * Sample code: ManagementGroupDimensionsList-Legacy. @@ -922,9 +1724,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/MCABillingProfileDimensionsListExpandAndTop.json */ /** * Sample code: BillingProfileDimensionsListExpandAndTop-MCA. @@ -939,9 +1739,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCABillingProfileDimensionsListWithFilter.json */ /** * Sample code: BillingProfileDimensionsListWithFilter-MCA. @@ -956,9 +1754,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountDimensionsListWithFilter.json */ /** * Sample code: EnrollmentAccountDimensionsListWithFilter-Legacy. @@ -973,9 +1769,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCABillingAccountDimensionsListWithFilter.json */ /** * Sample code: BillingAccountDimensionsListWithFilter-MCA. @@ -994,6 +1788,9 @@ public final class DimensionsListSamples { ### Exports_CreateOrUpdate ```java +import com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; +import com.azure.resourcemanager.costmanagement.models.DestinationType; import com.azure.resourcemanager.costmanagement.models.ExportDataset; import com.azure.resourcemanager.costmanagement.models.ExportDatasetConfiguration; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; @@ -1001,188 +1798,458 @@ import com.azure.resourcemanager.costmanagement.models.ExportDeliveryDestination import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; import com.azure.resourcemanager.costmanagement.models.ExportRecurrencePeriod; import com.azure.resourcemanager.costmanagement.models.ExportSchedule; +import com.azure.resourcemanager.costmanagement.models.ExportTimePeriod; import com.azure.resourcemanager.costmanagement.models.ExportType; +import com.azure.resourcemanager.costmanagement.models.FilterItemNames; +import com.azure.resourcemanager.costmanagement.models.FilterItems; import com.azure.resourcemanager.costmanagement.models.FormatType; import com.azure.resourcemanager.costmanagement.models.GranularityType; import com.azure.resourcemanager.costmanagement.models.RecurrenceType; import com.azure.resourcemanager.costmanagement.models.StatusType; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentity; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentityType; import com.azure.resourcemanager.costmanagement.models.TimeframeType; import java.time.OffsetDateTime; import java.util.Arrays; -/** - * Samples for Exports CreateOrUpdate. - */ -public final class ExportsCreateOrUpdateSamples { +/** + * Samples for Exports CreateOrUpdate. + */ +public final class ExportsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByManagementGroup.json + */ + /** + * Sample code: ExportCreateOrUpdateByManagementGroup. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + exportCreateOrUpdateByManagementGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Management/managementGroups/TestMG") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountReservationDetails.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountReservationDetails. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountReservationDetails( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.RESERVATION_DETAILS) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-03-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccount.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccount. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + exportCreateOrUpdateByBillingAccount(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByDepartment.json + */ + /** + * Sample code: ExportCreateOrUpdateByDepartment. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + exportCreateOrUpdateByDepartment(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/12/departments/1234") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) + .withFormat(FormatType.PARQUET) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.SNAPPY) + .withExportDescription("This is a test export.") + .create(); + } + /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByResourceGroup.json */ /** - * Sample code: ExportCreateOrUpdateByManagementGroup. + * Sample code: ExportCreateOrUpdateByResourceGroup. * * @param manager Entry point to CostManagementManager. */ public static void - exportCreateOrUpdateByManagementGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + exportCreateOrUpdateByResourceGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .define("TestExport") - .withExistingScope("providers/Microsoft.Management/managementGroups/TestMG") + .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountReservationTransactions.json */ /** - * Sample code: ExportCreateOrUpdateByBillingAccount. + * Sample code: ExportCreateOrUpdateExportCreateOrUpdateByBillingAccountReservationTransactionsByBillingAccount. * * @param manager Entry point to CostManagementManager. */ - public static void - exportCreateOrUpdateByBillingAccount(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + public static void exportCreateOrUpdateExportCreateOrUpdateByBillingAccountReservationTransactionsByBillingAccount( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .define("TestExport") .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( - new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) - .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withDefinition(new ExportDefinition().withType(ExportType.RESERVATION_TRANSACTIONS) .withTimeframe(TimeframeType.MONTH_TO_DATE) - .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withDataSet(new ExportDataset() + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByDepartment.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountReservationRecommendation.json */ /** - * Sample code: ExportCreateOrUpdateByDepartment. + * Sample code: ExportCreateOrUpdateByBillingAccountReservationRecommendation. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountReservationRecommendation( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition( + new ExportDefinition().withType(ExportType.RESERVATION_RECOMMENDATIONS) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset() + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01") + .withFilters(Arrays.asList( + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("Single"), + new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("VirtualMachines"), + new FilterItems().withName(FilterItemNames.LOOK_BACK_PERIOD).withValue("Last7Days")))))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateBySubscription.json + */ + /** + * Sample code: ExportCreateOrUpdateBySubscription. * * @param manager Entry point to CostManagementManager. */ public static void - exportCreateOrUpdateByDepartment(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + exportCreateOrUpdateBySubscription(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .define("TestExport") - .withExistingScope("providers/Microsoft.Billing/billingAccounts/12/departments/1234") + .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountCustom.json */ /** - * Sample code: ExportCreateOrUpdateByResourceGroup. + * Sample code: ExportCreateOrUpdateByBillingAccountCustom. * * @param manager Entry point to CostManagementManager. */ - public static void - exportCreateOrUpdateByResourceGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + public static void exportCreateOrUpdateByBillingAccountCustom( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .define("TestExport") - .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.INACTIVE)) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withTimeframe(TimeframeType.CUSTOM) + .withTimePeriod(new ExportTimePeriod().withFrom(OffsetDateTime.parse("2025-04-03T00:00:00.000Z")) + .withTo(OffsetDateTime.parse("2025-04-03T00:00:00.000Z"))) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountMonthly.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountMonthly. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountMonthly( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.MONTHLY) .withRecurrencePeriod( - new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-05T00:00:00Z")) + .withTo(OffsetDateTime.parse("2030-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) - .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withTimeframe(TimeframeType.THE_LAST_MONTH) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateBySubscription.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountPricesheet.json */ /** - * Sample code: ExportCreateOrUpdateBySubscription. + * Sample code: ExportCreateOrUpdateByBillingAccountPricesheet. * * @param manager Entry point to CostManagementManager. */ - public static void - exportCreateOrUpdateBySubscription(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + public static void exportCreateOrUpdateByBillingAccountPricesheet( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .define("TestExport") - .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( - new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) - .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) - .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDefinition(new ExportDefinition().withType(ExportType.PRICE_SHEET) + .withTimeframe(TimeframeType.THE_CURRENT_MONTH) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByEnrollmentAccount.json */ /** * Sample code: ExportCreateOrUpdateByEnrollmentAccount. @@ -1194,21 +2261,29 @@ public final class ExportsCreateOrUpdateSamples { manager.exports() .define("TestExport") .withExistingScope("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } } @@ -1222,9 +2297,7 @@ public final class ExportsCreateOrUpdateSamples { */ public final class ExportsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportDeleteByBillingAccount.json */ /** * Sample code: ExportDeleteByBillingAccount. @@ -1239,9 +2312,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportDeleteByManagementGroup.json */ /** * Sample code: ExportDeleteByManagementGroup. @@ -1256,9 +2327,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportDeleteByResourceGroup.json */ /** * Sample code: ExportDeleteByResourceGroup. @@ -1274,9 +2343,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByDepartment.json + * x-ms-original-file: 2026-06-01/ExportDeleteByDepartment.json */ /** * Sample code: ExportDeleteByDepartment. @@ -1291,9 +2358,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteBySubscription.json + * x-ms-original-file: 2026-06-01/ExportDeleteBySubscription.json */ /** * Sample code: ExportDeleteBySubscription. @@ -1308,9 +2373,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportDeleteByEnrollmentAccount.json */ /** * Sample code: ExportDeleteByEnrollmentAccount. @@ -1329,14 +2392,13 @@ public final class ExportsDeleteSamples { ### Exports_Execute ```java + /** * Samples for Exports Execute. */ public final class ExportsExecuteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportRunByManagementGroup.json */ /** * Sample code: ExportRunByManagementGroup. @@ -1346,14 +2408,12 @@ public final class ExportsExecuteSamples { public static void exportRunByManagementGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("providers/Microsoft.Management/managementGroups/TestMG", "TestExport", + .executeWithResponse("providers/Microsoft.Management/managementGroups/TestMG", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportRunByBillingAccount.json */ /** * Sample code: ExportRunByBillingAccount. @@ -1363,14 +2423,12 @@ public final class ExportsExecuteSamples { public static void exportRunByBillingAccount(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("providers/Microsoft.Billing/billingAccounts/123456", "TestExport", + .executeWithResponse("providers/Microsoft.Billing/billingAccounts/123456", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunBySubscription.json + * x-ms-original-file: 2026-06-01/ExportRunBySubscription.json */ /** * Sample code: ExportRunBySubscription. @@ -1379,14 +2437,27 @@ public final class ExportsExecuteSamples { */ public static void exportRunBySubscription(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", + .executeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByDepartment.json + * x-ms-original-file: 2026-06-01/ExportRunByBillingAccountWithOptionalRequestBody.json + */ + /** + * Sample code: ExportRunByBillingAccountWithOptionalRequestBody. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportRunByBillingAccountWithOptionalRequestBody( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .executeWithResponse("providers/Microsoft.Billing/billingAccounts/123456", "TestExport", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/ExportRunByDepartment.json */ /** * Sample code: ExportRunByDepartment. @@ -1395,14 +2466,12 @@ public final class ExportsExecuteSamples { */ public static void exportRunByDepartment(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", + .executeWithResponse("providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportRunByResourceGroup.json */ /** * Sample code: ExportRunByResourceGroup. @@ -1413,13 +2482,11 @@ public final class ExportsExecuteSamples { exportRunByResourceGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .executeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "TestExport", com.azure.core.util.Context.NONE); + "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportRunByEnrollmentAccount.json */ /** * Sample code: ExportRunByEnrollmentAccount. @@ -1430,7 +2497,7 @@ public final class ExportsExecuteSamples { exportRunByEnrollmentAccount(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .executeWithResponse("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", - com.azure.core.util.Context.NONE); + null, com.azure.core.util.Context.NONE); } } ``` @@ -1443,9 +2510,7 @@ public final class ExportsExecuteSamples { */ public final class ExportsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportGetByEnrollmentAccount.json */ /** * Sample code: ExportGetByEnrollmentAccount. @@ -1460,9 +2525,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportGetByManagementGroup.json */ /** * Sample code: ExportGetByManagementGroup. @@ -1477,9 +2540,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByDepartment.json + * x-ms-original-file: 2026-06-01/ExportGetByDepartment.json */ /** * Sample code: ExportGetByDepartment. @@ -1493,9 +2554,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetBySubscription.json + * x-ms-original-file: 2026-06-01/ExportGetBySubscription.json */ /** * Sample code: ExportGetBySubscription. @@ -1509,9 +2568,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportGetByBillingAccount.json */ /** * Sample code: ExportGetByBillingAccount. @@ -1526,9 +2583,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportGetByResourceGroup.json */ /** * Sample code: ExportGetByResourceGroup. @@ -1552,9 +2607,7 @@ public final class ExportsGetSamples { */ public final class ExportsGetExecutionHistorySamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByManagementGroup.json */ /** * Sample code: ExportRunHistoryGetByManagementGroup. @@ -1569,9 +2622,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetBySubscription.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetBySubscription.json */ /** * Sample code: ExportRunHistoryGetBySubscription. @@ -1586,9 +2637,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByResourceGroup.json */ /** * Sample code: ExportRunHistoryGetByResourceGroup. @@ -1604,9 +2653,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByEnrollmentAccount.json */ /** * Sample code: ExportRunHistoryGetByEnrollmentAccount. @@ -1621,9 +2668,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByBillingAccount.json */ /** * Sample code: ExportRunHistoryGetByBillingAccount. @@ -1638,9 +2683,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByDepartment.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByDepartment.json */ /** * Sample code: ExportRunHistoryGetByDepartment. @@ -1664,9 +2707,7 @@ public final class ExportsGetExecutionHistorySamples { */ public final class ExportsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportsGetByResourceGroup.json */ /** * Sample code: ExportsGetByResourceGroup. @@ -1681,9 +2722,7 @@ public final class ExportsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByDepartment.json + * x-ms-original-file: 2026-06-01/ExportsGetByDepartment.json */ /** * Sample code: ExportsGetByDepartment. @@ -1697,9 +2736,7 @@ public final class ExportsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportsGetByBillingAccount.json */ /** * Sample code: ExportsGetByBillingAccount. @@ -1714,9 +2751,7 @@ public final class ExportsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportsGetByEnrollmentAccount.json */ /** * Sample code: ExportsGetByEnrollmentAccount. @@ -1731,9 +2766,7 @@ public final class ExportsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportsGetByManagementGroup.json */ /** * Sample code: ExportsGetByManagementGroup. @@ -1748,9 +2781,7 @@ public final class ExportsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetBySubscription.json + * x-ms-original-file: 2026-06-01/ExportsGetBySubscription.json */ /** * Sample code: ExportsGetBySubscription. @@ -1792,9 +2823,7 @@ import java.util.Map; */ public final class ForecastExternalCloudProviderUsageSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionForecast.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionForecast.json */ /** * Sample code: ExternalSubscriptionForecast. @@ -1829,9 +2858,7 @@ public final class ForecastExternalCloudProviderUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountForecast.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountForecast.json */ /** * Sample code: ExternalBillingAccountForecast. @@ -1904,9 +2931,7 @@ import java.util.Map; */ public final class ForecastUsageSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupForecast.json + * x-ms-original-file: 2026-06-01/ResourceGroupForecast.json */ /** * Sample code: ResourceGroupForecast. @@ -1943,9 +2968,7 @@ public final class ForecastUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountForecast.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountForecast.json */ /** * Sample code: EnrollmentAccountForecast. @@ -1982,9 +3005,7 @@ public final class ForecastUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionForecast.json + * x-ms-original-file: 2026-06-01/SubscriptionForecast.json */ /** * Sample code: SubscriptionForecast. @@ -2020,9 +3041,7 @@ public final class ForecastUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingProfileForecast.json + * x-ms-original-file: 2026-06-01/BillingProfileForecast.json */ /** * Sample code: BillingProfileForecast. @@ -2058,9 +3077,7 @@ public final class ForecastUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentForecast.json + * x-ms-original-file: 2026-06-01/DepartmentForecast.json */ /** * Sample code: DepartmentForecast. @@ -2096,9 +3113,7 @@ public final class ForecastUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountForecast.json + * x-ms-original-file: 2026-06-01/BillingAccountForecast.json */ /** * Sample code: BillingAccountForecast. @@ -2134,9 +3149,7 @@ public final class ForecastUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * InvoiceSectionForecast.json + * x-ms-original-file: 2026-06-01/InvoiceSectionForecast.json */ /** * Sample code: InvoiceSectionForecast. @@ -2186,6 +3199,202 @@ public final class ForecastUsageSamples { } ``` +### GenerateBenefitUtilizationSummariesReport_GenerateByBillingAccount + +```java +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByBillingAccount. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByBillingAccountSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByBillingAccount.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByBillingAccount. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByBillingAccount( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByBillingAccount("8099099", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + } +} +``` + +### GenerateBenefitUtilizationSummariesReport_GenerateByBillingProfile + +```java +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByBillingProfile. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByBillingProfileSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByBillingProfile.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByBillingProfile. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByBillingProfile( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByBillingProfile("00000000-0000-0000-0000-000000000000", "CZSFR-SDFXC-DSDF", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + } +} +``` + +### GenerateBenefitUtilizationSummariesReport_GenerateByReservationId + +```java +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByReservationId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByReservationIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByReservation.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByReservation. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByReservation( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByReservationId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### GenerateBenefitUtilizationSummariesReport_GenerateByReservationOrderId + +```java +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByReservationOrderId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByReservationOrderIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByReservationOrder.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByReservationOrder. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByReservationOrder( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByReservationOrderId("00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### GenerateBenefitUtilizationSummariesReport_GenerateBySavingsPlanId + +```java +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateBySavingsPlanId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlan.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportBySavingsPlan. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportBySavingsPlan( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateBySavingsPlanId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### GenerateBenefitUtilizationSummariesReport_GenerateBySavingsPlanOrderId + +```java +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateBySavingsPlanOrderId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanOrderIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlanOrder.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportBySavingsPlanOrder. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportBySavingsPlanOrder( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateBySavingsPlanOrderId("00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} +``` + ### GenerateCostDetailsReport_CreateOperation ```java @@ -2198,9 +3407,7 @@ import com.azure.resourcemanager.costmanagement.models.GenerateCostDetailsReport */ public final class GenerateCostDetailsReportCreateOperationSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportBySubscriptionAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportBySubscriptionAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportBySubscriptionAndTimePeriod. @@ -2217,9 +3424,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod. @@ -2236,9 +3441,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByBillingProfileAndInvoiceId.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByBillingProfileAndInvoiceId.json */ /** * Sample code: GenerateCostDetailsReportByBillingProfileAndInvoiceId. @@ -2256,8 +3459,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json + * 2026-06-01/GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json */ /** * Sample code: GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod. @@ -2274,9 +3476,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json */ /** * Sample code: GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId. @@ -2293,9 +3493,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByCustomerAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByCustomerAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportByCustomerAndTimePeriod. @@ -2312,9 +3510,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByDepartmentsAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByDepartmentsAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportByDepartmentsAndTimePeriod. @@ -2340,9 +3536,7 @@ public final class GenerateCostDetailsReportCreateOperationSamples { */ public final class GenerateCostDetailsReportGetOperationResultsSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * CostDetailsOperationResultsBySubscriptionScope.json + * x-ms-original-file: 2026-06-01/CostDetailsOperationResultsBySubscriptionScope.json */ /** * Sample code: Get details of the operation result. @@ -2370,9 +3564,7 @@ import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostRepor */ public final class GenerateDetailedCostReportCreateOperationSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByBillingProfileAndInvoiceId.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByBillingProfileAndInvoiceId.json */ /** * Sample code: GenerateDetailedCostReportByBillingProfileAndInvoiceId. @@ -2389,9 +3581,7 @@ public final class GenerateDetailedCostReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json */ /** * Sample code: GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod. @@ -2408,9 +3598,7 @@ public final class GenerateDetailedCostReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json */ /** * Sample code: GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId. @@ -2428,9 +3616,7 @@ public final class GenerateDetailedCostReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportBySubscriptionAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportBySubscriptionAndTimePeriod.json */ /** * Sample code: GenerateDetailedCostReportBySubscriptionAndTimePeriod. @@ -2448,9 +3634,7 @@ public final class GenerateDetailedCostReportCreateOperationSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByCustomerAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByCustomerAndTimePeriod.json */ /** * Sample code: GenerateDetailedCostReportByCustomerAndTimePeriod. @@ -2477,9 +3661,7 @@ public final class GenerateDetailedCostReportCreateOperationSamples { */ public final class GenerateDetailedCostReportOperationResultsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportOperationResultsBySubscriptionScope.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json */ /** * Sample code: Get details of the operation result. @@ -2503,9 +3685,7 @@ public final class GenerateDetailedCostReportOperationResultsGetSamples { */ public final class GenerateDetailedCostReportOperationStatusGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportOperationStatusBySubscriptionScope.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json */ /** * Sample code: Get details of the operation status. @@ -2529,9 +3709,7 @@ public final class GenerateDetailedCostReportOperationStatusGetSamples { */ public final class GenerateReservationDetailsReportByBillingAccountIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateReservationDetailsReportByBillingAccount.json + * x-ms-original-file: 2026-06-01/GenerateReservationDetailsReportByBillingAccount.json */ /** * Sample code: ReservationDetails. @@ -2553,9 +3731,7 @@ public final class GenerateReservationDetailsReportByBillingAccountIdSamples { */ public final class GenerateReservationDetailsReportByBillingProfileIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateReservationDetailsReportByBillingProfile.json + * x-ms-original-file: 2026-06-01/GenerateReservationDetailsReportByBillingProfile.json */ /** * Sample code: ReservationDetails. @@ -2570,6 +3746,114 @@ public final class GenerateReservationDetailsReportByBillingProfileIdSamples { } ``` +### MarkupRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.models.CustomerMetadata; +import com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties; +import java.time.OffsetDateTime; + +/** + * Samples for MarkupRules CreateOrUpdate. + */ +public final class MarkupRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesCreateOrUpdate.json + */ + /** + * Sample code: MarkupRulesCreateOrUpdate. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + markupRulesCreateOrUpdate(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .createOrUpdateWithResponse("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", "markup-2022", + new MarkupRuleInner() + .withProperties(new MarkupRuleProperties().withDescription("Markup rule for year 2022") + .withPercentage(5.0) + .withStartDate(OffsetDateTime.parse("2022-01-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-12-31T00:00:00Z")) + .withCustomerDetails(new CustomerMetadata() + .withBillingAccountId( + "cff9aa6d-941c-43f2-b6cb-1d2bb34a02b4:780237f3-1aa6-4159-943b-498e0d647dd9") + .withBillingProfileId("08eeecee-efb2-40d5-817c-0a254d2e042c"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### MarkupRules_Delete + +```java +/** + * Samples for MarkupRules Delete. + */ +public final class MarkupRulesDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesDelete.json + */ + /** + * Sample code: MarkupRulesDelete. + * + * @param manager Entry point to CostManagementManager. + */ + public static void markupRulesDelete(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .deleteWithResponse("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", "markup-2022", com.azure.core.util.Context.NONE); + } +} +``` + +### MarkupRules_Get + +```java +/** + * Samples for MarkupRules Get. + */ +public final class MarkupRulesGetSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesGet.json + */ + /** + * Sample code: MarkupRulesGet. + * + * @param manager Entry point to CostManagementManager. + */ + public static void markupRulesGet(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .getWithResponse("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", "markup-2022", com.azure.core.util.Context.NONE); + } +} +``` + +### MarkupRules_List + +```java +/** + * Samples for MarkupRules List. + */ +public final class MarkupRulesListSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesList.json + */ + /** + * Sample code: MarkupRulesList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void markupRulesList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .list("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -2578,9 +3862,7 @@ public final class GenerateReservationDetailsReportByBillingProfileIdSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList. - * json + * x-ms-original-file: 2026-06-01/OperationList.json */ /** * Sample code: OperationList. @@ -2593,27 +3875,24 @@ public final class OperationsListSamples { } ``` -### PriceSheet_Download +### PriceSheet_DownloadByBillingAccount ```java /** - * Samples for PriceSheet Download. + * Samples for PriceSheet DownloadByBillingAccount. */ -public final class PriceSheetDownloadSamples { +public final class PriceSheetDownloadByBillingAccountSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PricesheetDownload.json + * x-ms-original-file: 2026-06-01/EAPriceSheetForBillingPeriod.json */ /** - * Sample code: PricesheetDownload. + * Sample code: EAPriceSheetForBillingPeriod. * * @param manager Entry point to CostManagementManager. */ - public static void pricesheetDownload(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.priceSheets() - .download("7c05a543-80ff-571e-9f98-1063b3b53cf2:99ad03ad-2d1b-4889-a452-090ad407d25f_2019-05-31", - "2USN-TPCD-BG7-TGB", "T000940677", com.azure.core.util.Context.NONE); + public static void + eAPriceSheetForBillingPeriod(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.priceSheets().downloadByBillingAccount("0000000", "202311", com.azure.core.util.Context.NONE); } } ``` @@ -2626,9 +3905,7 @@ public final class PriceSheetDownloadSamples { */ public final class PriceSheetDownloadByBillingProfileSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PricesheetDownloadByBillingProfile.json + * x-ms-original-file: 2026-06-01/PricesheetDownloadByBillingProfile.json */ /** * Sample code: PricesheetDownloadByBillingProfile. @@ -2645,6 +3922,29 @@ public final class PriceSheetDownloadByBillingProfileSamples { } ``` +### PriceSheet_DownloadByInvoice + +```java +/** + * Samples for PriceSheet DownloadByInvoice. + */ +public final class PriceSheetDownloadByInvoiceSamples { + /* + * x-ms-original-file: 2026-06-01/PricesheetDownload.json + */ + /** + * Sample code: PricesheetDownload. + * + * @param manager Entry point to CostManagementManager. + */ + public static void pricesheetDownload(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.priceSheets() + .downloadByInvoice("7c05a543-80ff-571e-9f98-1063b3b53cf2:99ad03ad-2d1b-4889-a452-090ad407d25f_2019-05-31", + "2USN-TPCD-BG7-TGB", "T000940677", com.azure.core.util.Context.NONE); + } +} +``` + ### Query_Usage ```java @@ -2669,9 +3969,7 @@ import java.util.Map; */ public final class QueryUsageSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionQueryGrouping.json + * x-ms-original-file: 2026-06-01/SubscriptionQueryGrouping.json */ /** * Sample code: SubscriptionQueryGrouping-Legacy. @@ -2693,9 +3991,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountQueryGrouping.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountQueryGrouping.json */ /** * Sample code: EnrollmentAccountQueryGrouping-Legacy. @@ -2717,9 +4013,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentQuery.json + * x-ms-original-file: 2026-06-01/DepartmentQuery.json */ /** * Sample code: DepartmentQuery-Legacy. @@ -2749,9 +4043,29 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountQuery.json + * x-ms-original-file: 2026-06-01/BillingAccountQueryGrouping.json + */ + /** + * Sample code: BillingAccountQueryGrouping-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingAccountQueryGroupingLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.queries() + .usageWithResponse("providers/Microsoft.Billing/billingAccounts/70664866", + new QueryDefinition().withType(ExportType.USAGE) + .withTimeframe(TimeframeType.THE_LAST_MONTH) + .withDataset(new QueryDataset().withGranularity(GranularityType.fromString("None")) + .withAggregation(mapOf("totalCost", + new QueryAggregation().withName("PreTaxCost").withFunction(FunctionType.SUM))) + .withGrouping(Arrays.asList( + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("ResourceGroup")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCABillingAccountQuery.json */ /** * Sample code: BillingAccountQuery-MCA. @@ -2781,33 +4095,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountQueryGrouping.json - */ - /** - * Sample code: BillingAccountQueryGrouping-Legacy. - * - * @param manager Entry point to CostManagementManager. - */ - public static void - billingAccountQueryGroupingLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.queries() - .usageWithResponse("providers/Microsoft.Billing/billingAccounts/70664866", - new QueryDefinition().withType(ExportType.USAGE) - .withTimeframe(TimeframeType.THE_LAST_MONTH) - .withDataset(new QueryDataset().withGranularity(GranularityType.fromString("None")) - .withAggregation(mapOf("totalCost", - new QueryAggregation().withName("PreTaxCost").withFunction(FunctionType.SUM))) - .withGrouping(Arrays.asList( - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("ResourceGroup")))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionQuery.json + * x-ms-original-file: 2026-06-01/SubscriptionQuery.json */ /** * Sample code: SubscriptionQuery-Legacy. @@ -2837,9 +4125,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCABillingAccountQueryGrouping.json */ /** * Sample code: BillingAccountQueryGrouping-MCA. @@ -2861,9 +4147,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionQueryGrouping.json */ /** * Sample code: InvoiceSectionQueryGrouping-MCA. @@ -2886,9 +4170,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountQuery.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountQuery.json */ /** * Sample code: EnrollmentAccountQuery-Legacy. @@ -2919,9 +4201,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupQueryGrouping.json + * x-ms-original-file: 2026-06-01/ResourceGroupQueryGrouping.json */ /** * Sample code: ResourceGroupQueryGrouping-Legacy. @@ -2944,9 +4224,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountQuery.json + * x-ms-original-file: 2026-06-01/BillingAccountQuery.json */ /** * Sample code: BillingAccountQuery-Legacy. @@ -2977,9 +4255,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCABillingProfileQueryGrouping.json */ /** * Sample code: BillingProfileQueryGrouping-MCA. @@ -3001,9 +4277,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupQuery.json + * x-ms-original-file: 2026-06-01/ResourceGroupQuery.json */ /** * Sample code: ResourceGroupQuery-Legacy. @@ -3035,9 +4309,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionQuery.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionQuery.json */ /** * Sample code: InvoiceSectionQuery-MCA. @@ -3068,9 +4340,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerQuery.json + * x-ms-original-file: 2026-06-01/MCACustomerQuery.json */ /** * Sample code: CustomerQuery-MCA. @@ -3100,9 +4370,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupQuery.json + * x-ms-original-file: 2026-06-01/ManagementGroupQuery.json */ /** * Sample code: ManagementGroupQuery-Legacy. @@ -3133,9 +4401,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentQueryGrouping.json + * x-ms-original-file: 2026-06-01/DepartmentQueryGrouping.json */ /** * Sample code: DepartmentQueryGrouping-Legacy. @@ -3157,9 +4423,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileQuery.json + * x-ms-original-file: 2026-06-01/MCABillingProfileQuery.json */ /** * Sample code: BillingProfileQuery-MCA. @@ -3189,9 +4453,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupQueryGrouping.json + * x-ms-original-file: 2026-06-01/ManagementGroupQueryGrouping.json */ /** * Sample code: ManagementGroupQueryGrouping-Legacy. @@ -3213,9 +4475,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCACustomerQueryGrouping.json */ /** * Sample code: CustomerQueryGrouping-MCA. @@ -3269,9 +4529,7 @@ import java.util.Arrays; */ public final class QueryUsageByExternalCloudProviderTypeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionsQuery.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionsQuery.json */ /** * Sample code: ExternalSubscriptionsQuery. @@ -3302,9 +4560,7 @@ public final class QueryUsageByExternalCloudProviderTypeSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountsQuery.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountsQuery.json */ /** * Sample code: ExternalBillingAccountQueryList. @@ -3346,9 +4602,7 @@ import com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityRequ */ public final class ScheduledActionsCheckNameAvailabilitySamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/checkNameAvailability-private-scheduledAction.json + * x-ms-original-file: 2026-06-01/scheduledActions/checkNameAvailability-private-scheduledAction.json */ /** * Sample code: ScheduledActionCheckNameAvailability. @@ -3374,9 +4628,7 @@ import com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityRequ */ public final class ScheduledActionsCheckNameAvailabilityByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/checkNameAvailability-shared-scheduledAction.json + * x-ms-original-file: 2026-06-01/scheduledActions/checkNameAvailability-shared-scheduledAction.json */ /** * Sample code: ScheduledActionCheckNameAvailabilityByScope. @@ -3413,9 +4665,7 @@ import java.util.Arrays; */ public final class ScheduledActionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-createOrUpdate-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-createOrUpdate-private.json */ /** * Sample code: CreateOrUpdatePrivateScheduledAction. @@ -3463,9 +4713,7 @@ import java.util.Arrays; */ public final class ScheduledActionsCreateOrUpdateByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-createOrUpdate-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-createOrUpdate-shared.json */ /** * Sample code: CreateOrUpdateScheduledActionByScope. @@ -3495,9 +4743,7 @@ public final class ScheduledActionsCreateOrUpdateByScopeSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json */ /** * Sample code: CreateOrUpdateInsightAlertScheduledActionByScope. @@ -3532,9 +4778,7 @@ public final class ScheduledActionsCreateOrUpdateByScopeSamples { */ public final class ScheduledActionsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-delete-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-delete-private.json */ /** * Sample code: PrivateScheduledActionDelete. @@ -3556,9 +4800,7 @@ public final class ScheduledActionsDeleteSamples { */ public final class ScheduledActionsDeleteByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-delete-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-delete-shared.json */ /** * Sample code: ScheduledActionDeleteByScope. @@ -3582,9 +4824,7 @@ public final class ScheduledActionsDeleteByScopeSamples { */ public final class ScheduledActionsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-get-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-get-private.json */ /** * Sample code: PrivateScheduledAction. @@ -3605,9 +4845,7 @@ public final class ScheduledActionsGetSamples { */ public final class ScheduledActionsGetByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-get-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-get-shared.json */ /** * Sample code: ScheduledActionByScope. @@ -3630,9 +4868,7 @@ public final class ScheduledActionsGetByScopeSamples { */ public final class ScheduledActionsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-listWithFilter-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-listWithFilter-private.json */ /** * Sample code: PrivateScheduledActionsListFilterByViewId. @@ -3647,9 +4883,7 @@ public final class ScheduledActionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-list-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-list-private.json */ /** * Sample code: PrivateScheduledActionsList. @@ -3671,9 +4905,7 @@ public final class ScheduledActionsListSamples { */ public final class ScheduledActionsListByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-listWithFilter-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-listWithFilter-shared.json */ /** * Sample code: ScheduledActionsListByScopeFilterByViewId. @@ -3689,9 +4921,7 @@ public final class ScheduledActionsListByScopeSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-list-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-list-shared.json */ /** * Sample code: ScheduledActionsListByScope. @@ -3714,9 +4944,7 @@ public final class ScheduledActionsListByScopeSamples { */ public final class ScheduledActionsRunSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-sendNow-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-sendNow-private.json */ /** * Sample code: ScheduledActionSendNow. @@ -3737,9 +4965,7 @@ public final class ScheduledActionsRunSamples { */ public final class ScheduledActionsRunByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-sendNow-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-sendNow-shared.json */ /** * Sample code: ScheduledActionRunByScope. @@ -3755,6 +4981,108 @@ public final class ScheduledActionsRunByScopeSamples { } ``` +### Settings_CreateOrUpdateByScope + +```java +import com.azure.resourcemanager.costmanagement.models.SettingType; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceProperties; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceSetting; + +/** + * Samples for Settings CreateOrUpdateByScope. + */ +public final class SettingsCreateOrUpdateByScopeSamples { + /* + * x-ms-original-file: 2026-06-01/settings-createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdateSettingByScope. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + createOrUpdateSettingByScope(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .createOrUpdateByScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", + SettingType.TAGINHERITANCE, new TagInheritanceSetting().withProperties( + new TagInheritanceProperties().withPreferContainerTags(false)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Settings_DeleteByScope + +```java +import com.azure.resourcemanager.costmanagement.models.SettingType; + +/** + * Samples for Settings DeleteByScope. + */ +public final class SettingsDeleteByScopeSamples { + /* + * x-ms-original-file: 2026-06-01/setting-delete.json + */ + /** + * Sample code: SettingDeleteByScope. + * + * @param manager Entry point to CostManagementManager. + */ + public static void settingDeleteByScope(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .deleteByScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", SettingType.TAGINHERITANCE, + com.azure.core.util.Context.NONE); + } +} +``` + +### Settings_GetByScope + +```java +import com.azure.resourcemanager.costmanagement.models.SettingType; + +/** + * Samples for Settings GetByScope. + */ +public final class SettingsGetByScopeSamples { + /* + * x-ms-original-file: 2026-06-01/setting-get.json + */ + /** + * Sample code: SettingByScope. + * + * @param manager Entry point to CostManagementManager. + */ + public static void settingByScope(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .getByScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", SettingType.TAGINHERITANCE, + com.azure.core.util.Context.NONE); + } +} +``` + +### Settings_List + +```java +/** + * Samples for Settings List. + */ +public final class SettingsListSamples { + /* + * x-ms-original-file: 2026-06-01/settingsList.json + */ + /** + * Sample code: SettingsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void settingsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .listWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + ### Views_CreateOrUpdate ```java @@ -3783,9 +5111,7 @@ import java.util.Map; */ public final class ViewsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PrivateViewCreateOrUpdate.json + * x-ms-original-file: 2026-06-01/PrivateViewCreateOrUpdate.json */ /** * Sample code: CreateOrUpdatePrivateView. @@ -3861,9 +5187,7 @@ import java.util.Map; */ public final class ViewsCreateOrUpdateByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewCreateOrUpdateByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewCreateOrUpdateByResourceGroup.json */ /** * Sample code: ResourceGroupCreateOrUpdateView. @@ -3921,9 +5245,7 @@ public final class ViewsCreateOrUpdateByScopeSamples { */ public final class ViewsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PrivateViewDelete.json + * x-ms-original-file: 2026-06-01/PrivateViewDelete.json */ /** * Sample code: DeletePrivateView. @@ -3944,9 +5266,7 @@ public final class ViewsDeleteSamples { */ public final class ViewsDeleteByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewDeleteByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewDeleteByResourceGroup.json */ /** * Sample code: ResourceGroupDeleteView. @@ -3969,9 +5289,7 @@ public final class ViewsDeleteByScopeSamples { */ public final class ViewsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateView. - * json + * x-ms-original-file: 2026-06-01/PrivateView.json */ /** * Sample code: PrivateView. @@ -3992,9 +5310,7 @@ public final class ViewsGetSamples { */ public final class ViewsGetByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewByResourceGroup.json */ /** * Sample code: ResourceGroupView. @@ -4017,9 +5333,7 @@ public final class ViewsGetByScopeSamples { */ public final class ViewsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PrivateViewList.json + * x-ms-original-file: 2026-06-01/PrivateViewList.json */ /** * Sample code: PrivateViewList. @@ -4040,9 +5354,7 @@ public final class ViewsListSamples { */ public final class ViewsListByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewListByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewListByResourceGroup.json */ /** * Sample code: ResourceGroupViewList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml b/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml index ad50bbab4acb..b9a676e66ba9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-costmanagement - 1.1.0-beta.1 + 1.1.0 jar Microsoft Azure SDK for CostManagement Management - This package contains Microsoft Azure SDK for CostManagement Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package tag package-2022-10. + This package contains Microsoft Azure SDK for CostManagement Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package api-version 2026-06-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/CostManagementManager.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/CostManagementManager.java index 5b63cadcb012..7f67bc8a6b35 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/CostManagementManager.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/CostManagementManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement; @@ -22,45 +22,57 @@ import com.azure.core.http.policy.UserAgentPolicy; 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.costmanagement.fluent.CostManagementClient; +import com.azure.resourcemanager.costmanagement.fluent.CostManagementManagementClient; import com.azure.resourcemanager.costmanagement.implementation.AlertsImpl; import com.azure.resourcemanager.costmanagement.implementation.BenefitRecommendationsImpl; import com.azure.resourcemanager.costmanagement.implementation.BenefitUtilizationSummariesImpl; -import com.azure.resourcemanager.costmanagement.implementation.CostManagementClientBuilder; +import com.azure.resourcemanager.costmanagement.implementation.BudgetsImpl; +import com.azure.resourcemanager.costmanagement.implementation.CostAllocationRulesImpl; +import com.azure.resourcemanager.costmanagement.implementation.CostManagementManagementClientBuilder; import com.azure.resourcemanager.costmanagement.implementation.DimensionsImpl; import com.azure.resourcemanager.costmanagement.implementation.ExportsImpl; import com.azure.resourcemanager.costmanagement.implementation.ForecastsImpl; +import com.azure.resourcemanager.costmanagement.implementation.GenerateBenefitUtilizationSummariesReportsImpl; import com.azure.resourcemanager.costmanagement.implementation.GenerateCostDetailsReportsImpl; import com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportOperationResultsImpl; import com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportOperationStatusImpl; import com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportsImpl; import com.azure.resourcemanager.costmanagement.implementation.GenerateReservationDetailsReportsImpl; +import com.azure.resourcemanager.costmanagement.implementation.MarkupRulesImpl; import com.azure.resourcemanager.costmanagement.implementation.OperationsImpl; import com.azure.resourcemanager.costmanagement.implementation.PriceSheetsImpl; import com.azure.resourcemanager.costmanagement.implementation.QueriesImpl; import com.azure.resourcemanager.costmanagement.implementation.ScheduledActionsImpl; +import com.azure.resourcemanager.costmanagement.implementation.SettingsImpl; import com.azure.resourcemanager.costmanagement.implementation.ViewsImpl; import com.azure.resourcemanager.costmanagement.models.Alerts; import com.azure.resourcemanager.costmanagement.models.BenefitRecommendations; import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaries; +import com.azure.resourcemanager.costmanagement.models.Budgets; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRules; import com.azure.resourcemanager.costmanagement.models.Dimensions; import com.azure.resourcemanager.costmanagement.models.Exports; import com.azure.resourcemanager.costmanagement.models.Forecasts; +import com.azure.resourcemanager.costmanagement.models.GenerateBenefitUtilizationSummariesReports; import com.azure.resourcemanager.costmanagement.models.GenerateCostDetailsReports; import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportOperationResults; import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportOperationStatus; import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReports; import com.azure.resourcemanager.costmanagement.models.GenerateReservationDetailsReports; +import com.azure.resourcemanager.costmanagement.models.MarkupRules; import com.azure.resourcemanager.costmanagement.models.Operations; import com.azure.resourcemanager.costmanagement.models.PriceSheets; import com.azure.resourcemanager.costmanagement.models.Queries; import com.azure.resourcemanager.costmanagement.models.ScheduledActions; +import com.azure.resourcemanager.costmanagement.models.Settings; import com.azure.resourcemanager.costmanagement.models.Views; import java.time.Duration; 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; @@ -69,44 +81,54 @@ * CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. */ public final class CostManagementManager { + private GenerateDetailedCostReportOperationStatus generateDetailedCostReportOperationStatus; + private Operations operations; + private Budgets budgets; + + private Exports exports; + + private GenerateDetailedCostReportOperationResults generateDetailedCostReportOperationResults; + private Views views; private Alerts alerts; - private Forecasts forecasts; + private ScheduledActions scheduledActions; - private Dimensions dimensions; + private Settings settings; - private Queries queries; + private MarkupRules markupRules; - private GenerateReservationDetailsReports generateReservationDetailsReports; + private GenerateCostDetailsReports generateCostDetailsReports; - private Exports exports; + private CostAllocationRules costAllocationRules; - private GenerateCostDetailsReports generateCostDetailsReports; + private BenefitRecommendations benefitRecommendations; - private GenerateDetailedCostReports generateDetailedCostReports; + private BenefitUtilizationSummaries benefitUtilizationSummaries; - private GenerateDetailedCostReportOperationResults generateDetailedCostReportOperationResults; + private GenerateBenefitUtilizationSummariesReports generateBenefitUtilizationSummariesReports; - private GenerateDetailedCostReportOperationStatus generateDetailedCostReportOperationStatus; + private GenerateDetailedCostReports generateDetailedCostReports; - private PriceSheets priceSheets; + private Forecasts forecasts; - private ScheduledActions scheduledActions; + private Dimensions dimensions; - private BenefitRecommendations benefitRecommendations; + private Queries queries; - private BenefitUtilizationSummaries benefitUtilizationSummaries; + private GenerateReservationDetailsReports generateReservationDetailsReports; - private final CostManagementClient clientObject; + private PriceSheets priceSheets; + + private final CostManagementManagementClient clientObject; private CostManagementManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new CostManagementClientBuilder().pipeline(httpPipeline) + this.clientObject = new CostManagementManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .defaultPollInterval(defaultPollInterval) .buildClient(); @@ -152,6 +174,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-costmanagement.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -259,12 +284,14 @@ public CostManagementManager authenticate(TokenCredential credential, AzureProfi 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.costmanagement") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -310,6 +337,19 @@ public CostManagementManager authenticate(TokenCredential credential, AzureProfi } } + /** + * Gets the resource collection API of GenerateDetailedCostReportOperationStatus. + * + * @return Resource collection API of GenerateDetailedCostReportOperationStatus. + */ + public GenerateDetailedCostReportOperationStatus generateDetailedCostReportOperationStatus() { + if (this.generateDetailedCostReportOperationStatus == null) { + this.generateDetailedCostReportOperationStatus = new GenerateDetailedCostReportOperationStatusImpl( + clientObject.getGenerateDetailedCostReportOperationStatus(), this); + } + return generateDetailedCostReportOperationStatus; + } + /** * Gets the resource collection API of Operations. * @@ -322,6 +362,43 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of Budgets. It manages Budget. + * + * @return Resource collection API of Budgets. + */ + public Budgets budgets() { + if (this.budgets == null) { + this.budgets = new BudgetsImpl(clientObject.getBudgets(), this); + } + return budgets; + } + + /** + * Gets the resource collection API of Exports. It manages Export. + * + * @return Resource collection API of Exports. + */ + public Exports exports() { + if (this.exports == null) { + this.exports = new ExportsImpl(clientObject.getExports(), this); + } + return exports; + } + + /** + * Gets the resource collection API of GenerateDetailedCostReportOperationResults. + * + * @return Resource collection API of GenerateDetailedCostReportOperationResults. + */ + public GenerateDetailedCostReportOperationResults generateDetailedCostReportOperationResults() { + if (this.generateDetailedCostReportOperationResults == null) { + this.generateDetailedCostReportOperationResults = new GenerateDetailedCostReportOperationResultsImpl( + clientObject.getGenerateDetailedCostReportOperationResults(), this); + } + return generateDetailedCostReportOperationResults; + } + /** * Gets the resource collection API of Views. It manages View. * @@ -347,77 +424,103 @@ public Alerts alerts() { } /** - * Gets the resource collection API of Forecasts. + * Gets the resource collection API of ScheduledActions. It manages ScheduledAction. * - * @return Resource collection API of Forecasts. + * @return Resource collection API of ScheduledActions. */ - public Forecasts forecasts() { - if (this.forecasts == null) { - this.forecasts = new ForecastsImpl(clientObject.getForecasts(), this); + public ScheduledActions scheduledActions() { + if (this.scheduledActions == null) { + this.scheduledActions = new ScheduledActionsImpl(clientObject.getScheduledActions(), this); } - return forecasts; + return scheduledActions; } /** - * Gets the resource collection API of Dimensions. + * Gets the resource collection API of Settings. * - * @return Resource collection API of Dimensions. + * @return Resource collection API of Settings. */ - public Dimensions dimensions() { - if (this.dimensions == null) { - this.dimensions = new DimensionsImpl(clientObject.getDimensions(), this); + public Settings settings() { + if (this.settings == null) { + this.settings = new SettingsImpl(clientObject.getSettings(), this); } - return dimensions; + return settings; } /** - * Gets the resource collection API of Queries. + * Gets the resource collection API of MarkupRules. * - * @return Resource collection API of Queries. + * @return Resource collection API of MarkupRules. */ - public Queries queries() { - if (this.queries == null) { - this.queries = new QueriesImpl(clientObject.getQueries(), this); + public MarkupRules markupRules() { + if (this.markupRules == null) { + this.markupRules = new MarkupRulesImpl(clientObject.getMarkupRules(), this); } - return queries; + return markupRules; } /** - * Gets the resource collection API of GenerateReservationDetailsReports. + * Gets the resource collection API of GenerateCostDetailsReports. * - * @return Resource collection API of GenerateReservationDetailsReports. + * @return Resource collection API of GenerateCostDetailsReports. */ - public GenerateReservationDetailsReports generateReservationDetailsReports() { - if (this.generateReservationDetailsReports == null) { - this.generateReservationDetailsReports - = new GenerateReservationDetailsReportsImpl(clientObject.getGenerateReservationDetailsReports(), this); + public GenerateCostDetailsReports generateCostDetailsReports() { + if (this.generateCostDetailsReports == null) { + this.generateCostDetailsReports + = new GenerateCostDetailsReportsImpl(clientObject.getGenerateCostDetailsReports(), this); } - return generateReservationDetailsReports; + return generateCostDetailsReports; } /** - * Gets the resource collection API of Exports. It manages Export. + * Gets the resource collection API of CostAllocationRules. * - * @return Resource collection API of Exports. + * @return Resource collection API of CostAllocationRules. */ - public Exports exports() { - if (this.exports == null) { - this.exports = new ExportsImpl(clientObject.getExports(), this); + public CostAllocationRules costAllocationRules() { + if (this.costAllocationRules == null) { + this.costAllocationRules = new CostAllocationRulesImpl(clientObject.getCostAllocationRules(), this); } - return exports; + return costAllocationRules; } /** - * Gets the resource collection API of GenerateCostDetailsReports. + * Gets the resource collection API of BenefitRecommendations. * - * @return Resource collection API of GenerateCostDetailsReports. + * @return Resource collection API of BenefitRecommendations. */ - public GenerateCostDetailsReports generateCostDetailsReports() { - if (this.generateCostDetailsReports == null) { - this.generateCostDetailsReports - = new GenerateCostDetailsReportsImpl(clientObject.getGenerateCostDetailsReports(), this); + public BenefitRecommendations benefitRecommendations() { + if (this.benefitRecommendations == null) { + this.benefitRecommendations + = new BenefitRecommendationsImpl(clientObject.getBenefitRecommendations(), this); } - return generateCostDetailsReports; + return benefitRecommendations; + } + + /** + * Gets the resource collection API of BenefitUtilizationSummaries. + * + * @return Resource collection API of BenefitUtilizationSummaries. + */ + public BenefitUtilizationSummaries benefitUtilizationSummaries() { + if (this.benefitUtilizationSummaries == null) { + this.benefitUtilizationSummaries + = new BenefitUtilizationSummariesImpl(clientObject.getBenefitUtilizationSummaries(), this); + } + return benefitUtilizationSummaries; + } + + /** + * Gets the resource collection API of GenerateBenefitUtilizationSummariesReports. + * + * @return Resource collection API of GenerateBenefitUtilizationSummariesReports. + */ + public GenerateBenefitUtilizationSummariesReports generateBenefitUtilizationSummariesReports() { + if (this.generateBenefitUtilizationSummariesReports == null) { + this.generateBenefitUtilizationSummariesReports = new GenerateBenefitUtilizationSummariesReportsImpl( + clientObject.getGenerateBenefitUtilizationSummariesReports(), this); + } + return generateBenefitUtilizationSummariesReports; } /** @@ -434,88 +537,73 @@ public GenerateDetailedCostReports generateDetailedCostReports() { } /** - * Gets the resource collection API of GenerateDetailedCostReportOperationResults. - * - * @return Resource collection API of GenerateDetailedCostReportOperationResults. - */ - public GenerateDetailedCostReportOperationResults generateDetailedCostReportOperationResults() { - if (this.generateDetailedCostReportOperationResults == null) { - this.generateDetailedCostReportOperationResults = new GenerateDetailedCostReportOperationResultsImpl( - clientObject.getGenerateDetailedCostReportOperationResults(), this); - } - return generateDetailedCostReportOperationResults; - } - - /** - * Gets the resource collection API of GenerateDetailedCostReportOperationStatus. + * Gets the resource collection API of Forecasts. * - * @return Resource collection API of GenerateDetailedCostReportOperationStatus. + * @return Resource collection API of Forecasts. */ - public GenerateDetailedCostReportOperationStatus generateDetailedCostReportOperationStatus() { - if (this.generateDetailedCostReportOperationStatus == null) { - this.generateDetailedCostReportOperationStatus = new GenerateDetailedCostReportOperationStatusImpl( - clientObject.getGenerateDetailedCostReportOperationStatus(), this); + public Forecasts forecasts() { + if (this.forecasts == null) { + this.forecasts = new ForecastsImpl(clientObject.getForecasts(), this); } - return generateDetailedCostReportOperationStatus; + return forecasts; } /** - * Gets the resource collection API of PriceSheets. + * Gets the resource collection API of Dimensions. * - * @return Resource collection API of PriceSheets. + * @return Resource collection API of Dimensions. */ - public PriceSheets priceSheets() { - if (this.priceSheets == null) { - this.priceSheets = new PriceSheetsImpl(clientObject.getPriceSheets(), this); + public Dimensions dimensions() { + if (this.dimensions == null) { + this.dimensions = new DimensionsImpl(clientObject.getDimensions(), this); } - return priceSheets; + return dimensions; } /** - * Gets the resource collection API of ScheduledActions. It manages ScheduledAction. + * Gets the resource collection API of Queries. * - * @return Resource collection API of ScheduledActions. + * @return Resource collection API of Queries. */ - public ScheduledActions scheduledActions() { - if (this.scheduledActions == null) { - this.scheduledActions = new ScheduledActionsImpl(clientObject.getScheduledActions(), this); + public Queries queries() { + if (this.queries == null) { + this.queries = new QueriesImpl(clientObject.getQueries(), this); } - return scheduledActions; + return queries; } /** - * Gets the resource collection API of BenefitRecommendations. + * Gets the resource collection API of GenerateReservationDetailsReports. * - * @return Resource collection API of BenefitRecommendations. + * @return Resource collection API of GenerateReservationDetailsReports. */ - public BenefitRecommendations benefitRecommendations() { - if (this.benefitRecommendations == null) { - this.benefitRecommendations - = new BenefitRecommendationsImpl(clientObject.getBenefitRecommendations(), this); + public GenerateReservationDetailsReports generateReservationDetailsReports() { + if (this.generateReservationDetailsReports == null) { + this.generateReservationDetailsReports + = new GenerateReservationDetailsReportsImpl(clientObject.getGenerateReservationDetailsReports(), this); } - return benefitRecommendations; + return generateReservationDetailsReports; } /** - * Gets the resource collection API of BenefitUtilizationSummaries. + * Gets the resource collection API of PriceSheets. * - * @return Resource collection API of BenefitUtilizationSummaries. + * @return Resource collection API of PriceSheets. */ - public BenefitUtilizationSummaries benefitUtilizationSummaries() { - if (this.benefitUtilizationSummaries == null) { - this.benefitUtilizationSummaries - = new BenefitUtilizationSummariesImpl(clientObject.getBenefitUtilizationSummaries(), this); + public PriceSheets priceSheets() { + if (this.priceSheets == null) { + this.priceSheets = new PriceSheetsImpl(clientObject.getPriceSheets(), this); } - return benefitUtilizationSummaries; + return priceSheets; } /** - * Gets wrapped service client CostManagementClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client CostManagementManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. * - * @return Wrapped service client CostManagementClient. + * @return Wrapped service client CostManagementManagementClient. */ - public CostManagementClient serviceClient() { + public CostManagementManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/AlertsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/AlertsClient.java index cf498e0bea22..c7c9db6a461d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/AlertsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/AlertsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -18,99 +18,64 @@ */ public interface AlertsClient { /** - * Lists the alerts for scope defined. + * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param alertId Alert ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts along with {@link Response}. + * @return the alert for the scope by alert ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scope, Context context); + Response getWithResponse(String scope, String alertId, Context context); /** - * Lists the alerts for scope defined. + * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param alertId Alert ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts. + * @return the alert for the scope by alert ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertsResultInner list(String scope); + AlertInner get(String scope, String alertId); /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param parameters Parameters supplied to the Dismiss Alert operation. * @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 alert for the scope by alert ID along with {@link Response}. + * @return an individual alert along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String alertId, Context context); + Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, + Context context); /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param parameters Parameters supplied to the Dismiss Alert 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 alert for the scope by alert ID. + * @return an individual alert. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner get(String scope, String alertId); + AlertInner dismiss(String scope, String alertId, DismissAlertPayload parameters); /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -123,20 +88,17 @@ public interface AlertsClient { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert operation. * @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 an individual alert along with {@link Response}. + * @return result of alerts along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, - Context context); + Response listWithResponse(String scope, Context context); /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -149,15 +111,13 @@ Response dismissWithResponse(String scope, String alertId, DismissAl * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert 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 an individual alert. + * @return result of alerts. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner dismiss(String scope, String alertId, DismissAlertPayload parameters); + AlertsResultInner list(String scope); /** * Lists the Alerts for external cloud provider type defined. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitRecommendationsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitRecommendationsClient.java index b30e386dbaeb..e5be7e755d34 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitRecommendationsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitRecommendationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitUtilizationSummariesClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitUtilizationSummariesClient.java index f9ef173c1240..c7f03c8d03e1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitUtilizationSummariesClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitUtilizationSummariesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -19,7 +19,7 @@ public interface BenefitUtilizationSummariesClient { * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -32,7 +32,7 @@ public interface BenefitUtilizationSummariesClient { * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @param context The context to associate with this operation. @@ -48,8 +48,8 @@ PagedIterable listByBillingAccountId(String bill /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -62,8 +62,8 @@ PagedIterable listByBillingProfileId(String bill /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @param context The context to associate with this operation. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BudgetsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BudgetsClient.java new file mode 100644 index 000000000000..35a15e30a4df --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/BudgetsClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; + +/** + * An instance of this class provides access to all the operations defined in BudgetsClient. + */ +public interface BudgetsClient { + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 budget for the scope by budget name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String budgetName, Context context); + + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the budget for the scope by budget name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BudgetInner get(String scope, String budgetName); + + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of + * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put + * operation. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a budget resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String scope, String budgetName, BudgetInner parameters, + Context context); + + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of + * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put + * operation. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a budget resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner parameters); + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String scope, String budgetName, Context context); + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 scope, String budgetName); + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope); + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String filter, Context context); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostAllocationRulesClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostAllocationRulesClient.java new file mode 100644 index 000000000000..d6943e8d7251 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostAllocationRulesClient.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; + +/** + * An instance of this class provides access to all the operations defined in CostAllocationRulesClient. + */ +public interface CostAllocationRulesClient { + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cost allocation rule by rule name and billing account or enterprise enrollment along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String billingAccountId, String ruleName, + Context context); + + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cost allocation rule by rule name and billing account or enterprise enrollment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CostAllocationRuleDefinitionInner get(String billingAccountId, String ruleName); + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule, Context context); + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CostAllocationRuleDefinitionInner createOrUpdate(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule); + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String billingAccountId, String ruleName, Context context); + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 billingAccountId, String ruleName); + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String billingAccountId); + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String billingAccountId, Context context); + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest, Context context); + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CostAllocationRuleCheckNameAvailabilityResponseInner checkNameAvailability(String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementManagementClient.java similarity index 76% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementClient.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementManagementClient.java index 240133de73e4..274bb78ce963 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -8,18 +8,18 @@ import java.time.Duration; /** - * The interface for CostManagementClient class. + * The interface for CostManagementManagementClient class. */ -public interface CostManagementClient { +public interface CostManagementManagementClient { /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -39,6 +39,13 @@ public interface CostManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the GenerateDetailedCostReportOperationStatusClient object to access its operations. + * + * @return the GenerateDetailedCostReportOperationStatusClient object. + */ + GenerateDetailedCostReportOperationStatusClient getGenerateDetailedCostReportOperationStatus(); + /** * Gets the OperationsClient object to access its operations. * @@ -46,6 +53,27 @@ public interface CostManagementClient { */ OperationsClient getOperations(); + /** + * Gets the BudgetsClient object to access its operations. + * + * @return the BudgetsClient object. + */ + BudgetsClient getBudgets(); + + /** + * Gets the ExportsClient object to access its operations. + * + * @return the ExportsClient object. + */ + ExportsClient getExports(); + + /** + * Gets the GenerateDetailedCostReportOperationResultsClient object to access its operations. + * + * @return the GenerateDetailedCostReportOperationResultsClient object. + */ + GenerateDetailedCostReportOperationResultsClient getGenerateDetailedCostReportOperationResults(); + /** * Gets the ViewsClient object to access its operations. * @@ -61,93 +89,100 @@ public interface CostManagementClient { AlertsClient getAlerts(); /** - * Gets the ForecastsClient object to access its operations. + * Gets the ScheduledActionsClient object to access its operations. * - * @return the ForecastsClient object. + * @return the ScheduledActionsClient object. */ - ForecastsClient getForecasts(); + ScheduledActionsClient getScheduledActions(); /** - * Gets the DimensionsClient object to access its operations. + * Gets the SettingsClient object to access its operations. * - * @return the DimensionsClient object. + * @return the SettingsClient object. */ - DimensionsClient getDimensions(); + SettingsClient getSettings(); /** - * Gets the QueriesClient object to access its operations. + * Gets the MarkupRulesClient object to access its operations. * - * @return the QueriesClient object. + * @return the MarkupRulesClient object. */ - QueriesClient getQueries(); + MarkupRulesClient getMarkupRules(); /** - * Gets the GenerateReservationDetailsReportsClient object to access its operations. + * Gets the GenerateCostDetailsReportsClient object to access its operations. * - * @return the GenerateReservationDetailsReportsClient object. + * @return the GenerateCostDetailsReportsClient object. */ - GenerateReservationDetailsReportsClient getGenerateReservationDetailsReports(); + GenerateCostDetailsReportsClient getGenerateCostDetailsReports(); /** - * Gets the ExportsClient object to access its operations. + * Gets the CostAllocationRulesClient object to access its operations. * - * @return the ExportsClient object. + * @return the CostAllocationRulesClient object. */ - ExportsClient getExports(); + CostAllocationRulesClient getCostAllocationRules(); /** - * Gets the GenerateCostDetailsReportsClient object to access its operations. + * Gets the BenefitRecommendationsClient object to access its operations. * - * @return the GenerateCostDetailsReportsClient object. + * @return the BenefitRecommendationsClient object. */ - GenerateCostDetailsReportsClient getGenerateCostDetailsReports(); + BenefitRecommendationsClient getBenefitRecommendations(); /** - * Gets the GenerateDetailedCostReportsClient object to access its operations. + * Gets the BenefitUtilizationSummariesClient object to access its operations. * - * @return the GenerateDetailedCostReportsClient object. + * @return the BenefitUtilizationSummariesClient object. */ - GenerateDetailedCostReportsClient getGenerateDetailedCostReports(); + BenefitUtilizationSummariesClient getBenefitUtilizationSummaries(); /** - * Gets the GenerateDetailedCostReportOperationResultsClient object to access its operations. + * Gets the GenerateBenefitUtilizationSummariesReportsClient object to access its operations. * - * @return the GenerateDetailedCostReportOperationResultsClient object. + * @return the GenerateBenefitUtilizationSummariesReportsClient object. */ - GenerateDetailedCostReportOperationResultsClient getGenerateDetailedCostReportOperationResults(); + GenerateBenefitUtilizationSummariesReportsClient getGenerateBenefitUtilizationSummariesReports(); /** - * Gets the GenerateDetailedCostReportOperationStatusClient object to access its operations. + * Gets the GenerateDetailedCostReportsClient object to access its operations. * - * @return the GenerateDetailedCostReportOperationStatusClient object. + * @return the GenerateDetailedCostReportsClient object. */ - GenerateDetailedCostReportOperationStatusClient getGenerateDetailedCostReportOperationStatus(); + GenerateDetailedCostReportsClient getGenerateDetailedCostReports(); /** - * Gets the PriceSheetsClient object to access its operations. + * Gets the ForecastsClient object to access its operations. * - * @return the PriceSheetsClient object. + * @return the ForecastsClient object. */ - PriceSheetsClient getPriceSheets(); + ForecastsClient getForecasts(); /** - * Gets the ScheduledActionsClient object to access its operations. + * Gets the DimensionsClient object to access its operations. * - * @return the ScheduledActionsClient object. + * @return the DimensionsClient object. */ - ScheduledActionsClient getScheduledActions(); + DimensionsClient getDimensions(); /** - * Gets the BenefitRecommendationsClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the BenefitRecommendationsClient object. + * @return the QueriesClient object. */ - BenefitRecommendationsClient getBenefitRecommendations(); + QueriesClient getQueries(); /** - * Gets the BenefitUtilizationSummariesClient object to access its operations. + * Gets the GenerateReservationDetailsReportsClient object to access its operations. * - * @return the BenefitUtilizationSummariesClient object. + * @return the GenerateReservationDetailsReportsClient object. */ - BenefitUtilizationSummariesClient getBenefitUtilizationSummaries(); + GenerateReservationDetailsReportsClient getGenerateReservationDetailsReports(); + + /** + * Gets the PriceSheetsClient object to access its operations. + * + * @return the PriceSheetsClient object. + */ + PriceSheetsClient getPriceSheets(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/DimensionsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/DimensionsClient.java index d07a787c942c..b61df5e4aba2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/DimensionsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/DimensionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ExportsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ExportsClient.java index 30615e164962..29dc98c70e1e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ExportsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ExportsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -11,72 +11,16 @@ import com.azure.resourcemanager.costmanagement.fluent.models.ExportExecutionListResultInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportListResultInner; +import com.azure.resourcemanager.costmanagement.models.ExportRunRequest; /** * An instance of this class provides access to all the operations defined in ExportsClient. */ public interface ExportsClient { - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last run of each export. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scope, String expand, Context context); - - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExportListResultInner list(String scope); - /** * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and * will return information for the last 10 runs of the export. @@ -92,17 +36,7 @@ public interface ExportsClient { /** * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -116,17 +50,7 @@ public interface ExportsClient { * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param parameters Parameters supplied to the CreateOrUpdate Export operation. * @param context The context to associate with this operation. @@ -143,17 +67,7 @@ Response createOrUpdateWithResponse(String scope, String exportName * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param parameters Parameters supplied to the CreateOrUpdate Export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -167,17 +81,7 @@ Response createOrUpdateWithResponse(String scope, String exportName /** * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -191,7 +95,19 @@ Response createOrUpdateWithResponse(String scope, String exportName /** * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param exportName Export Name. + * @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 scope, String exportName); + + /** + * The operation to list all exports at the given scope. + * + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -202,18 +118,21 @@ Response createOrUpdateWithResponse(String scope, String exportName * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. + * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and + * will return information for the last run of each export. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing exports along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String exportName); + Response listWithResponse(String scope, String expand, Context context); /** - * The operation to run an export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -224,7 +143,20 @@ Response createOrUpdateWithResponse(String scope, String exportName * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing exports. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportListResultInner list(String scope); + + /** + * The operation to run an export. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. + * @param parameters Parameters supplied to the Execute Export operation. * @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. @@ -232,22 +164,12 @@ Response createOrUpdateWithResponse(String scope, String exportName * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response executeWithResponse(String scope, String exportName, Context context); + Response executeWithResponse(String scope, String exportName, ExportRunRequest parameters, Context context); /** * The operation to run an export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -259,17 +181,7 @@ Response createOrUpdateWithResponse(String scope, String exportName /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -284,17 +196,7 @@ Response getExecutionHistoryWithResponse(String /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ForecastsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ForecastsClient.java index a08cc0fd8bc7..7459b094fb87 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ForecastsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ForecastsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -74,7 +74,7 @@ Response usageWithResponse(String scope, ForecastDefinition * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support * 'ne', 'or', or 'not'. @@ -96,7 +96,7 @@ Response externalCloudProviderUsageWithResponse( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateBenefitUtilizationSummariesReportsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateBenefitUtilizationSummariesReportsClient.java new file mode 100644 index 000000000000..6dd80b842990 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateBenefitUtilizationSummariesReportsClient.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; + +/** + * An instance of this class provides access to all the operations defined in + * GenerateBenefitUtilizationSummariesReportsClient. + */ +public interface GenerateBenefitUtilizationSummariesReportsClient { + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingProfile(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingProfile(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationId(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationId(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByReservationId(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateByReservationId(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanId(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanId(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateCostDetailsReportsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateCostDetailsReportsClient.java index 0a80ac1e7f4c..a5bec209985e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateCostDetailsReportsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateCostDetailsReportsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -16,6 +16,70 @@ * An instance of this class provides access to all the operations defined in GenerateCostDetailsReportsClient. */ public interface GenerateCostDetailsReportsClient { + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CostDetailsOperationResultsInner> + beginGetOperationResults(String scope, String operationId); + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CostDetailsOperationResultsInner> + beginGetOperationResults(String scope, String operationId, Context context); + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CostDetailsOperationResultsInner getOperationResults(String scope, String operationId); + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CostDetailsOperationResultsInner getOperationResults(String scope, String operationId, Context context); + /** * This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details * report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a @@ -26,10 +90,11 @@ public interface GenerateCostDetailsReportsClient { * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -50,10 +115,11 @@ public interface GenerateCostDetailsReportsClient { * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -75,10 +141,11 @@ public interface GenerateCostDetailsReportsClient { * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -99,10 +166,11 @@ CostDetailsOperationResultsInner createOperation(String scope, * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,68 +181,4 @@ CostDetailsOperationResultsInner createOperation(String scope, @ServiceMethod(returns = ReturnType.SINGLE) CostDetailsOperationResultsInner createOperation(String scope, GenerateCostDetailsReportRequestDefinition parameters, Context context); - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CostDetailsOperationResultsInner> - beginGetOperationResults(String scope, String operationId); - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CostDetailsOperationResultsInner> - beginGetOperationResults(String scope, String operationId, Context context); - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CostDetailsOperationResultsInner getOperationResults(String scope, String operationId); - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CostDetailsOperationResultsInner getOperationResults(String scope, String operationId, Context context); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationResultsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationResultsClient.java index fd8370c269e3..a5b19ba3c9e9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationResultsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationResultsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -21,8 +21,7 @@ public interface GenerateDetailedCostReportOperationResultsClient { * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -37,8 +36,7 @@ public interface GenerateDetailedCostReportOperationResultsClient { * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -54,8 +52,7 @@ public interface GenerateDetailedCostReportOperationResultsClient { * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -69,8 +66,7 @@ public interface GenerateDetailedCostReportOperationResultsClient { * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationStatusClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationStatusClient.java index dcdfa199a304..eaec1a89f9b0 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationStatusClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationStatusClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -20,8 +20,7 @@ public interface GenerateDetailedCostReportOperationStatusClient { * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -37,8 +36,7 @@ Response getWithResponse(Strin * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportsClient.java index 2e63a6acbe4a..eecb3508149b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateReservationDetailsReportsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateReservationDetailsReportsClient.java index 5211a4d76b15..202f6446e474 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateReservationDetailsReportsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateReservationDetailsReportsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -18,9 +18,9 @@ public interface GenerateReservationDetailsReportsClient { /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -35,9 +35,9 @@ SyncPoller, OperationStatusInner> beginByBillin /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -53,9 +53,9 @@ SyncPoller, OperationStatusInner> beginByBillin /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -69,9 +69,9 @@ SyncPoller, OperationStatusInner> beginByBillin /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -87,10 +87,10 @@ SyncPoller, OperationStatusInner> beginByBillin * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -106,10 +106,10 @@ SyncPoller, OperationStatusInner> beginByBillin * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -126,10 +126,10 @@ SyncPoller, OperationStatusInner> beginByBillin * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -145,10 +145,10 @@ OperationStatusInner byBillingProfileId(String billingAccountId, String billingP * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/MarkupRulesClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/MarkupRulesClient.java new file mode 100644 index 000000000000..f07faba6eaf6 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/MarkupRulesClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; + +/** + * An instance of this class provides access to all the operations defined in MarkupRulesClient. + */ +public interface MarkupRulesClient { + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a markup rule by name for a billing account and billing profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context); + + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a markup rule by name for a billing account and billing profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarkupRuleInner get(String billingAccountId, String billingProfileId, String ruleName); + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String billingAccountId, String billingProfileId, + String ruleName, MarkupRuleInner resource, Context context); + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarkupRuleInner createOrUpdate(String billingAccountId, String billingProfileId, String ruleName, + MarkupRuleInner resource); + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context); + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 billingAccountId, String billingProfileId, String ruleName); + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String billingAccountId, String billingProfileId); + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String billingAccountId, String billingProfileId, Context context); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/OperationsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/OperationsClient.java index cd272ca8e8e9..d0f14c320ade 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/OperationsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -15,7 +15,7 @@ */ public interface OperationsClient { /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @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. @@ -25,7 +25,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/PriceSheetsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/PriceSheetsClient.java index ad5d5ff67928..198a4a5daac4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/PriceSheetsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/PriceSheetsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -10,6 +10,8 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.costmanagement.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.costmanagement.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner; /** * An instance of this class provides access to all the operations defined in PriceSheetsClient. @@ -19,8 +21,8 @@ public interface PriceSheetsClient { * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -28,15 +30,15 @@ public interface PriceSheetsClient { * @return the {@link SyncPoller} for polling of a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownload(String billingAccountName, + SyncPoller, DownloadUrlInner> beginDownloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName); /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -45,15 +47,15 @@ SyncPoller, DownloadUrlInner> beginDownload(String * @return the {@link SyncPoller} for polling of a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownload(String billingAccountName, + SyncPoller, DownloadUrlInner> beginDownloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName, Context context); /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,14 +63,14 @@ SyncPoller, DownloadUrlInner> beginDownload(String * @return a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner download(String billingAccountName, String billingProfileName, String invoiceName); + DownloadUrlInner downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName); /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -77,17 +79,21 @@ SyncPoller, DownloadUrlInner> beginDownload(String * @return a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner download(String billingAccountName, String billingProfileName, String invoiceName, + DownloadUrlInner downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName, Context context); /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -95,17 +101,21 @@ DownloadUrlInner download(String billingAccountName, String billingProfileName, * profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadByBillingProfile(String billingAccountName, - String billingProfileName); + SyncPoller, PricesheetDownloadPropertiesInner> + beginDownloadByBillingProfile(String billingAccountName, String billingProfileName); /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -114,33 +124,41 @@ SyncPoller, DownloadUrlInner> beginDownloadByBillin * profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadByBillingProfile(String billingAccountName, - String billingProfileName, Context context); + SyncPoller, PricesheetDownloadPropertiesInner> + beginDownloadByBillingProfile(String billingAccountName, String billingProfileName, Context context); /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download the current month's pricesheet for a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadByBillingProfile(String billingAccountName, String billingProfileName); + PricesheetDownloadPropertiesInner downloadByBillingProfile(String billingAccountName, String billingProfileName); /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -148,5 +166,154 @@ SyncPoller, DownloadUrlInner> beginDownloadByBillin * @return a URL to download the current month's pricesheet for a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadByBillingProfile(String billingAccountName, String billingProfileName, Context context); + PricesheetDownloadPropertiesInner downloadByBillingProfile(String billingAccountName, String billingProfileName, + Context context); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> + beginDownloadByBillingAccount(String billingAccountId, String billingPeriodName); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> + beginDownloadByBillingAccount(String billingAccountId, String billingPeriodName, Context context); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner downloadByBillingAccount(String billingAccountId, String billingPeriodName); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner downloadByBillingAccount(String billingAccountId, String billingPeriodName, Context context); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/QueriesClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/QueriesClient.java index 7fae81778f44..c8ff38fb917b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/QueriesClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/QueriesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -72,7 +72,7 @@ public interface QueriesClient { * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. @@ -91,7 +91,7 @@ Response usageByExternalCloudProviderTypeWithResponse( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ScheduledActionsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ScheduledActionsClient.java index cb0f255dc64c..7d7f8c4fc401 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ScheduledActionsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ScheduledActionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -18,79 +18,29 @@ */ public interface ScheduledActionsClient { /** - * List all private scheduled actions. - * - * @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 scheduled actions list result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all private scheduled actions. + * Get the private scheduled action by name. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * List all shared scheduled actions within the given scope. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return the private scheduled action by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByScope(String scope); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String name, Context context); /** - * List all shared scheduled actions within the given scope. + * Get the private scheduled action by name. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @param context The context to associate with this operation. + * @param name Scheduled action name. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return the private scheduled action by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByScope(String scope, String filter, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduledActionInner get(String name); /** * Create or update a private scheduled action. @@ -123,129 +73,80 @@ Response createOrUpdateWithResponse(String name, Scheduled ScheduledActionInner createOrUpdate(String name, ScheduledActionInner scheduledAction); /** - * Get the private scheduled action by name. + * Delete a private scheduled action. * * @param name Scheduled action name. * @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 private scheduled action by name along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String name, Context context); + Response deleteWithResponse(String name, Context context); /** - * Get the private scheduled action by name. + * Delete a private scheduled action. * * @param name Scheduled action name. * @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 private scheduled action by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduledActionInner get(String name); + void delete(String name); /** - * Delete a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. - * @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 Response}. + * @return scheduled actions list result as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String name, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Delete a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); /** - * Create or update a shared scheduled action within the given scope. + * Processes a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. - * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can - * be specified to achieve optimistic concurrency. * @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 scheduled action definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateByScopeWithResponse(String scope, String name, - ScheduledActionInner scheduledAction, String ifMatch, Context context); + Response runWithResponse(String name, Context context); /** - * Create or update a shared scheduled action within the given scope. + * Processes a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. * @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 scheduled action definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduledActionInner createOrUpdateByScope(String scope, String name, ScheduledActionInner scheduledAction); + void run(String name); /** * Get the shared scheduled action from the given scope by name. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -259,20 +160,7 @@ Response createOrUpdateByScopeWithResponse(String scope, S /** * Get the shared scheduled action from the given scope by name. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -283,60 +171,41 @@ Response createOrUpdateByScopeWithResponse(String scope, S ScheduledActionInner getByScope(String scope, String name); /** - * Delete a scheduled action within the given scope. + * Create or update a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. + * @param scheduledAction Scheduled action to be created or updated. + * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can + * be specified to achieve optimistic concurrency. * @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 Response}. + * @return scheduled action definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByScopeWithResponse(String scope, String name, Context context); + Response createOrUpdateByScopeWithResponse(String scope, String name, + ScheduledActionInner scheduledAction, String ifMatch, Context context); /** - * Delete a scheduled action within the given scope. + * Create or update a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. + * @param scheduledAction Scheduled action to be created or updated. * @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 scheduled action definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteByScope(String scope, String name); + ScheduledActionInner createOrUpdateByScope(String scope, String name, ScheduledActionInner scheduledAction); /** - * Processes a private scheduled action. + * Delete a scheduled action within the given scope. * + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -345,36 +214,50 @@ Response createOrUpdateByScopeWithResponse(String scope, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response runWithResponse(String name, Context context); + Response deleteByScopeWithResponse(String scope, String name, Context context); /** - * Processes a private scheduled action. + * Delete a scheduled action within the given scope. * + * @param scope undefined. * @param name Scheduled action name. * @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 run(String name); + void deleteByScope(String scope, String name); + + /** + * List all shared scheduled actions within the given scope. + * + * @param scope undefined. + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScope(String scope); + + /** + * List all shared scheduled actions within the given scope. + * + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScope(String scope, String filter, Context context); /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -388,20 +271,7 @@ Response createOrUpdateByScopeWithResponse(String scope, S /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -413,7 +283,7 @@ Response createOrUpdateByScopeWithResponse(String scope, S /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. @@ -427,7 +297,7 @@ Response createOrUpdateByScopeWithResponse(String scope, S /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/SettingsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/SettingsClient.java new file mode 100644 index 000000000000..53cffc712601 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/SettingsClient.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner; +import com.azure.resourcemanager.costmanagement.models.SettingType; + +/** + * An instance of this class provides access to all the operations defined in SettingsClient. + */ +public interface SettingsClient { + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByScopeWithResponse(String scope, SettingType type, Context context); + + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SettingInner getByScope(String scope, SettingType type); + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateByScopeWithResponse(String scope, SettingType type, SettingInner setting, + Context context); + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SettingInner createOrUpdateByScope(String scope, SettingType type, SettingInner setting); + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByScopeWithResponse(String scope, SettingType type, Context context); + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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 deleteByScope(String scope, SettingType type); + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String scope, Context context); + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SettingsListResultInner list(String scope); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ViewsClient.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ViewsClient.java index 76d78a7a26be..b15887614421 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ViewsClient.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/ViewsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent; @@ -15,77 +15,6 @@ * An instance of this class provides access to all the operations defined in ViewsClient. */ public interface ViewsClient { - /** - * Lists all views by tenant and object. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all views by tenant and object. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByScope(String scope); - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByScope(String scope, Context context); - /** * Gets the view by view name. * @@ -164,22 +93,32 @@ public interface ViewsClient { @ServiceMethod(returns = ReturnType.SINGLE) void delete(String viewName); + /** + * Lists all views by tenant and object. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all views by tenant and object. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -193,19 +132,7 @@ public interface ViewsClient { /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -219,19 +146,7 @@ public interface ViewsClient { * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param parameters Parameters supplied to the CreateOrUpdate View operation. * @param context The context to associate with this operation. @@ -248,19 +163,7 @@ Response createOrUpdateByScopeWithResponse(String scope, String viewN * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param parameters Parameters supplied to the CreateOrUpdate View operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -274,19 +177,7 @@ Response createOrUpdateByScopeWithResponse(String scope, String viewN /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -300,19 +191,7 @@ Response createOrUpdateByScopeWithResponse(String scope, String viewN /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -320,4 +199,29 @@ Response createOrUpdateByScopeWithResponse(String scope, String viewN */ @ServiceMethod(returns = ReturnType.SINGLE) void deleteByScope(String scope, String viewName); + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScope(String scope); + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScope(String scope, Context context); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertInner.java index 01210d20c6b4..c34063c8b38c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertInner.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -12,19 +14,29 @@ import com.azure.resourcemanager.costmanagement.models.AlertPropertiesDetails; import com.azure.resourcemanager.costmanagement.models.AlertSource; import com.azure.resourcemanager.costmanagement.models.AlertStatus; -import com.azure.resourcemanager.costmanagement.models.CostManagementProxyResource; import java.io.IOException; /** * An individual alert. */ -@Fluent -public final class AlertInner extends CostManagementProxyResource { +@Immutable +public final class AlertInner extends ProxyResource { /* * Alert properties. */ private AlertProperties innerProperties; + /* + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user + * is updating the latest version or not. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,7 +55,7 @@ public final class AlertInner extends CostManagementProxyResource { /** * Creates an instance of AlertInner class. */ - public AlertInner() { + private AlertInner() { } /** @@ -55,6 +67,25 @@ private AlertProperties innerProperties() { return this.innerProperties; } + /** + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -85,15 +116,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public AlertInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the definition property: defines the type of alert. * @@ -103,20 +125,6 @@ public AlertPropertiesDefinition definition() { return this.innerProperties() == null ? null : this.innerProperties().definition(); } - /** - * Set the definition property: defines the type of alert. - * - * @param definition the definition value to set. - * @return the AlertInner object itself. - */ - public AlertInner withDefinition(AlertPropertiesDefinition definition) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withDefinition(definition); - return this; - } - /** * Get the description property: Alert description. * @@ -126,20 +134,6 @@ public String description() { return this.innerProperties() == null ? null : this.innerProperties().description(); } - /** - * Set the description property: Alert description. - * - * @param description the description value to set. - * @return the AlertInner object itself. - */ - public AlertInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - /** * Get the source property: Source of alert. * @@ -149,20 +143,6 @@ public AlertSource source() { return this.innerProperties() == null ? null : this.innerProperties().source(); } - /** - * Set the source property: Source of alert. - * - * @param source the source value to set. - * @return the AlertInner object itself. - */ - public AlertInner withSource(AlertSource source) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withSource(source); - return this; - } - /** * Get the details property: Alert details. * @@ -172,20 +152,6 @@ public AlertPropertiesDetails details() { return this.innerProperties() == null ? null : this.innerProperties().details(); } - /** - * Set the details property: Alert details. - * - * @param details the details value to set. - * @return the AlertInner object itself. - */ - public AlertInner withDetails(AlertPropertiesDetails details) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withDetails(details); - return this; - } - /** * Get the costEntityId property: related budget. * @@ -195,20 +161,6 @@ public String costEntityId() { return this.innerProperties() == null ? null : this.innerProperties().costEntityId(); } - /** - * Set the costEntityId property: related budget. - * - * @param costEntityId the costEntityId value to set. - * @return the AlertInner object itself. - */ - public AlertInner withCostEntityId(String costEntityId) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withCostEntityId(costEntityId); - return this; - } - /** * Get the status property: alert status. * @@ -218,20 +170,6 @@ public AlertStatus status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } - /** - * Set the status property: alert status. - * - * @param status the status value to set. - * @return the AlertInner object itself. - */ - public AlertInner withStatus(AlertStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - /** * Get the creationTime property: dateTime in which alert was created. * @@ -241,20 +179,6 @@ public String creationTime() { return this.innerProperties() == null ? null : this.innerProperties().creationTime(); } - /** - * Set the creationTime property: dateTime in which alert was created. - * - * @param creationTime the creationTime value to set. - * @return the AlertInner object itself. - */ - public AlertInner withCreationTime(String creationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withCreationTime(creationTime); - return this; - } - /** * Get the closeTime property: dateTime in which alert was closed. * @@ -264,20 +188,6 @@ public String closeTime() { return this.innerProperties() == null ? null : this.innerProperties().closeTime(); } - /** - * Set the closeTime property: dateTime in which alert was closed. - * - * @param closeTime the closeTime value to set. - * @return the AlertInner object itself. - */ - public AlertInner withCloseTime(String closeTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withCloseTime(closeTime); - return this; - } - /** * Get the modificationTime property: dateTime in which alert was last modified. * @@ -287,20 +197,6 @@ public String modificationTime() { return this.innerProperties() == null ? null : this.innerProperties().modificationTime(); } - /** - * Set the modificationTime property: dateTime in which alert was last modified. - * - * @param modificationTime the modificationTime value to set. - * @return the AlertInner object itself. - */ - public AlertInner withModificationTime(String modificationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withModificationTime(modificationTime); - return this; - } - /** * Get the statusModificationUsername property: User who last modified the alert. * @@ -310,20 +206,6 @@ public String statusModificationUsername() { return this.innerProperties() == null ? null : this.innerProperties().statusModificationUsername(); } - /** - * Set the statusModificationUsername property: User who last modified the alert. - * - * @param statusModificationUsername the statusModificationUsername value to set. - * @return the AlertInner object itself. - */ - public AlertInner withStatusModificationUsername(String statusModificationUsername) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withStatusModificationUsername(statusModificationUsername); - return this; - } - /** * Get the statusModificationTime property: dateTime in which the alert status was last modified. * @@ -333,40 +215,14 @@ public String statusModificationTime() { return this.innerProperties() == null ? null : this.innerProperties().statusModificationTime(); } - /** - * Set the statusModificationTime property: dateTime in which the alert status was last modified. - * - * @param statusModificationTime the statusModificationTime value to set. - * @return the AlertInner object itself. - */ - public AlertInner withStatusModificationTime(String statusModificationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withStatusModificationTime(statusModificationTime); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("eTag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("eTag", this.etag); return jsonWriter.writeEndObject(); } @@ -392,10 +248,12 @@ public static AlertInner fromJson(JsonReader jsonReader) throws IOException { deserializedAlertInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedAlertInner.type = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedAlertInner.withEtag(reader.getString()); } else if ("properties".equals(fieldName)) { deserializedAlertInner.innerProperties = AlertProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedAlertInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedAlertInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertProperties.java index b5226b30d3ad..66d54d2ede28 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; @@ -301,20 +301,6 @@ public AlertProperties withStatusModificationTime(String statusModificationTime) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (definition() != null) { - definition().validate(); - } - if (details() != null) { - details().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertsResultInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertsResultInner.java index d98169b9ebf7..2bc58d557b30 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertsResultInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertsResultInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; @@ -30,7 +30,7 @@ public final class AlertsResultInner implements JsonSerializable e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitRecommendationModelInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitRecommendationModelInner.java index 59e62559a3c2..eafd34349021 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitRecommendationModelInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitRecommendationModelInner.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -16,13 +17,23 @@ /** * benefit plan recommendation details. */ -@Fluent +@Immutable public final class BenefitRecommendationModelInner extends BenefitResource { /* * The properties of the benefit recommendations. */ private BenefitRecommendationProperties properties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Reservation or SavingsPlan. + */ + private BenefitKind kind; + /* * The type of the resource. */ @@ -41,7 +52,7 @@ public final class BenefitRecommendationModelInner extends BenefitResource { /** * Creates an instance of BenefitRecommendationModelInner class. */ - public BenefitRecommendationModelInner() { + private BenefitRecommendationModelInner() { } /** @@ -54,14 +65,23 @@ public BenefitRecommendationProperties properties() { } /** - * Set the properties property: The properties of the benefit recommendations. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param properties the properties value to set. - * @return the BenefitRecommendationModelInner object itself. + * @return the systemData value. */ - public BenefitRecommendationModelInner withProperties(BenefitRecommendationProperties properties) { - this.properties = properties; - return this; + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the kind property: Reservation or SavingsPlan. + * + * @return the kind value. + */ + @Override + public BenefitKind kind() { + return this.kind; } /** @@ -94,27 +114,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public BenefitRecommendationModelInner withKind(BenefitKind kind) { - super.withKind(kind); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @@ -150,7 +149,9 @@ public static BenefitRecommendationModelInner fromJson(JsonReader jsonReader) th } else if ("type".equals(fieldName)) { deserializedBenefitRecommendationModelInner.type = reader.getString(); } else if ("kind".equals(fieldName)) { - deserializedBenefitRecommendationModelInner.withKind(BenefitKind.fromString(reader.getString())); + deserializedBenefitRecommendationModelInner.kind = BenefitKind.fromString(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedBenefitRecommendationModelInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedBenefitRecommendationModelInner.properties = BenefitRecommendationProperties.fromJson(reader); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummariesOperationStatusInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummariesOperationStatusInner.java new file mode 100644 index 000000000000..11e17388d59c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummariesOperationStatusInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.costmanagement.models.AsyncOperationStatusProperties; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.io.IOException; + +/** + * Status of a benefit utilization summaries report. Provides Async Benefit Utilization Summaries Request input, status, + * and report sas url. + */ +@Immutable +public final class BenefitUtilizationSummariesOperationStatusInner + implements JsonSerializable { + /* + * Input given to create the benefit utilization summaries report. + */ + private BenefitUtilizationSummariesRequest input; + + /* + * The status of the creation of the benefit utilization summaries report. + */ + private OperationStatusType status; + + /* + * Contains sas url to the async benefit utilization summaries report and a date that the url is valid until. These + * values will be empty if the report is in a Running or Failed state + */ + private AsyncOperationStatusProperties properties; + + /** + * Creates an instance of BenefitUtilizationSummariesOperationStatusInner class. + */ + private BenefitUtilizationSummariesOperationStatusInner() { + } + + /** + * Get the input property: Input given to create the benefit utilization summaries report. + * + * @return the input value. + */ + public BenefitUtilizationSummariesRequest input() { + return this.input; + } + + /** + * Get the status property: The status of the creation of the benefit utilization summaries report. + * + * @return the status value. + */ + public OperationStatusType status() { + return this.status; + } + + /** + * Get the properties property: Contains sas url to the async benefit utilization summaries report and a date that + * the url is valid until. These values will be empty if the report is in a Running or Failed state. + * + * @return the properties value. + */ + public AsyncOperationStatusProperties properties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BenefitUtilizationSummariesOperationStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BenefitUtilizationSummariesOperationStatusInner 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 BenefitUtilizationSummariesOperationStatusInner. + */ + public static BenefitUtilizationSummariesOperationStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BenefitUtilizationSummariesOperationStatusInner deserializedBenefitUtilizationSummariesOperationStatusInner + = new BenefitUtilizationSummariesOperationStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("input".equals(fieldName)) { + deserializedBenefitUtilizationSummariesOperationStatusInner.input + = BenefitUtilizationSummariesRequest.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedBenefitUtilizationSummariesOperationStatusInner.status + = OperationStatusType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedBenefitUtilizationSummariesOperationStatusInner.properties + = AsyncOperationStatusProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBenefitUtilizationSummariesOperationStatusInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummaryInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummaryInner.java index 7412d43bc091..2e931bdd21e3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummaryInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummaryInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -24,6 +25,11 @@ public class BenefitUtilizationSummaryInner extends ProxyResource { */ private BenefitKind kind = BenefitKind.fromString("BenefitUtilizationSummary"); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +48,7 @@ public class BenefitUtilizationSummaryInner extends ProxyResource { /** * Creates an instance of BenefitUtilizationSummaryInner class. */ - public BenefitUtilizationSummaryInner() { + protected BenefitUtilizationSummaryInner() { } /** @@ -54,6 +60,26 @@ public BenefitKind kind() { return this.kind; } + /** + * 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 BenefitUtilizationSummaryInner object itself. + */ + BenefitUtilizationSummaryInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -84,14 +110,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -154,6 +172,8 @@ static BenefitUtilizationSummaryInner fromJsonKnownDiscriminator(JsonReader json deserializedBenefitUtilizationSummaryInner.type = reader.getString(); } else if ("kind".equals(fieldName)) { deserializedBenefitUtilizationSummaryInner.kind = BenefitKind.fromString(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedBenefitUtilizationSummaryInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetInner.java new file mode 100644 index 000000000000..9f537ee9acb9 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetInner.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CurrentSpend; +import com.azure.resourcemanager.costmanagement.models.ForecastSpend; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.io.IOException; +import java.util.Map; + +/** + * A budget resource. + */ +@Fluent +public final class BudgetInner extends ProxyResource { + /* + * The properties of the budget. + */ + private BudgetProperties innerProperties; + + /* + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user + * is updating the latest version or not. + */ + private String eTag; + + /* + * 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 BudgetInner class. + */ + public BudgetInner() { + } + + /** + * Get the innerProperties property: The properties of the budget. + * + * @return the innerProperties value. + */ + private BudgetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the eTag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @param eTag the eTag value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withETag(String eTag) { + this.eTag = eTag; + 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; + } + + /** + * 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; + } + + /** + * Get the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * + * @return the category value. + */ + public CategoryType category() { + return this.innerProperties() == null ? null : this.innerProperties().category(); + } + + /** + * Set the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * + * @param category the category value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withCategory(CategoryType category) { + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withCategory(category); + return this; + } + + /** + * Get the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * + * @return the amount value. + */ + public Double amount() { + return this.innerProperties() == null ? null : this.innerProperties().amount(); + } + + /** + * Set the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * + * @param amount the amount value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withAmount(Double amount) { + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withAmount(amount); + return this; + } + + /** + * Get the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @return the timeGrain value. + */ + public TimeGrainType timeGrain() { + return this.innerProperties() == null ? null : this.innerProperties().timeGrain(); + } + + /** + * Set the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @param timeGrain the timeGrain value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withTimeGrain(TimeGrainType timeGrain) { + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withTimeGrain(timeGrain); + return this; + } + + /** + * Get the timePeriod property: The time period that defines the active period of the budget. The budget will + * evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @return the timePeriod value. + */ + public BudgetTimePeriod timePeriod() { + return this.innerProperties() == null ? null : this.innerProperties().timePeriod(); + } + + /** + * Set the timePeriod property: The time period that defines the active period of the budget. The budget will + * evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @param timePeriod the timePeriod value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withTimePeriod(BudgetTimePeriod timePeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withTimePeriod(timePeriod); + return this; + } + + /** + * Get the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @return the filter value. + */ + public BudgetFilter filter() { + return this.innerProperties() == null ? null : this.innerProperties().filter(); + } + + /** + * Set the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @param filter the filter value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withFilter(BudgetFilter filter) { + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withFilter(filter); + return this; + } + + /** + * Get the currentSpend property: The current amount of cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + * + * @return the currentSpend value. + */ + public CurrentSpend currentSpend() { + return this.innerProperties() == null ? null : this.innerProperties().currentSpend(); + } + + /** + * Get the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 + * notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not + * applicable. + * + * @return the notifications value. + */ + public Map notifications() { + return this.innerProperties() == null ? null : this.innerProperties().notifications(); + } + + /** + * Set the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 + * notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not + * applicable. + * + * @param notifications the notifications value to set. + * @return the BudgetInner object itself. + */ + public BudgetInner withNotifications(Map notifications) { + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withNotifications(notifications); + return this; + } + + /** + * Get the forecastSpend property: The forecasted cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + * + * @return the forecastSpend value. + */ + public ForecastSpend forecastSpend() { + return this.innerProperties() == null ? null : this.innerProperties().forecastSpend(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("eTag", this.eTag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetInner 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 BudgetInner. + */ + public static BudgetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetInner deserializedBudgetInner = new BudgetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBudgetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBudgetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBudgetInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBudgetInner.innerProperties = BudgetProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedBudgetInner.eTag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedBudgetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetProperties.java new file mode 100644 index 000000000000..c6b7e2f4d835 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetProperties.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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 com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CurrentSpend; +import com.azure.resourcemanager.costmanagement.models.ForecastSpend; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.io.IOException; +import java.util.Map; + +/** + * The properties of the budget. + */ +@Fluent +public final class BudgetProperties implements JsonSerializable { + /* + * The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + */ + private CategoryType category; + + /* + * The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + */ + private Double amount; + + /* + * The time covered by a budget. Tracking of the amount will be reset based on the time grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + */ + private TimeGrainType timeGrain; + + /* + * The time period that defines the active period of the budget. The budget will evaluate data on or after the + * startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + */ + private BudgetTimePeriod timePeriod; + + /* + * May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ + private BudgetFilter filter; + + /* + * The current amount of cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + */ + private CurrentSpend currentSpend; + + /* + * Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 + * notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not + * applicable. + */ + private Map notifications; + + /* + * The forecasted cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + */ + private ForecastSpend forecastSpend; + + /** + * Creates an instance of BudgetProperties class. + */ + public BudgetProperties() { + } + + /** + * Get the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * + * @return the category value. + */ + public CategoryType category() { + return this.category; + } + + /** + * Set the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * + * @param category the category value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withCategory(CategoryType category) { + this.category = category; + return this; + } + + /** + * Get the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * + * @return the amount value. + */ + public Double amount() { + return this.amount; + } + + /** + * Set the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * + * @param amount the amount value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withAmount(Double amount) { + this.amount = amount; + return this; + } + + /** + * Get the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @return the timeGrain value. + */ + public TimeGrainType timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @param timeGrain the timeGrain value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withTimeGrain(TimeGrainType timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the timePeriod property: The time period that defines the active period of the budget. The budget will + * evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @return the timePeriod value. + */ + public BudgetTimePeriod timePeriod() { + return this.timePeriod; + } + + /** + * Set the timePeriod property: The time period that defines the active period of the budget. The budget will + * evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @param timePeriod the timePeriod value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withTimePeriod(BudgetTimePeriod timePeriod) { + this.timePeriod = timePeriod; + return this; + } + + /** + * Get the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @return the filter value. + */ + public BudgetFilter filter() { + return this.filter; + } + + /** + * Set the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @param filter the filter value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withFilter(BudgetFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the currentSpend property: The current amount of cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + * + * @return the currentSpend value. + */ + public CurrentSpend currentSpend() { + return this.currentSpend; + } + + /** + * Get the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 + * notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not + * applicable. + * + * @return the notifications value. + */ + public Map notifications() { + return this.notifications; + } + + /** + * Set the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 + * notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not + * applicable. + * + * @param notifications the notifications value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withNotifications(Map notifications) { + this.notifications = notifications; + return this; + } + + /** + * Get the forecastSpend property: The forecasted cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + * + * @return the forecastSpend value. + */ + public ForecastSpend forecastSpend() { + return this.forecastSpend; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeStringField("timeGrain", this.timeGrain == null ? null : this.timeGrain.toString()); + jsonWriter.writeJsonField("timePeriod", this.timePeriod); + jsonWriter.writeNumberField("amount", this.amount); + jsonWriter.writeJsonField("filter", this.filter); + jsonWriter.writeMapField("notifications", this.notifications, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetProperties 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 BudgetProperties. + */ + public static BudgetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetProperties deserializedBudgetProperties = new BudgetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedBudgetProperties.category = CategoryType.fromString(reader.getString()); + } else if ("timeGrain".equals(fieldName)) { + deserializedBudgetProperties.timeGrain = TimeGrainType.fromString(reader.getString()); + } else if ("timePeriod".equals(fieldName)) { + deserializedBudgetProperties.timePeriod = BudgetTimePeriod.fromJson(reader); + } else if ("amount".equals(fieldName)) { + deserializedBudgetProperties.amount = reader.getNullable(JsonReader::getDouble); + } else if ("filter".equals(fieldName)) { + deserializedBudgetProperties.filter = BudgetFilter.fromJson(reader); + } else if ("currentSpend".equals(fieldName)) { + deserializedBudgetProperties.currentSpend = CurrentSpend.fromJson(reader); + } else if ("notifications".equals(fieldName)) { + Map notifications = reader.readMap(reader1 -> Notification.fromJson(reader1)); + deserializedBudgetProperties.notifications = notifications; + } else if ("forecastSpend".equals(fieldName)) { + deserializedBudgetProperties.forecastSpend = ForecastSpend.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CheckNameAvailabilityResponseInner.java index 3956183fc088..65d83f93ccb4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CheckNameAvailabilityResponseInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CheckNameAvailabilityResponseInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The check availability result. */ -@Fluent +@Immutable public final class CheckNameAvailabilityResponseInner implements JsonSerializable { /* * Indicates if the resource name is available. @@ -28,14 +28,14 @@ public final class CheckNameAvailabilityResponseInner implements JsonSerializabl private CheckNameAvailabilityReason reason; /* - * Detailed reason why the given name is available. + * Detailed reason why the given name is not available. */ private String message; /** * Creates an instance of CheckNameAvailabilityResponseInner class. */ - public CheckNameAvailabilityResponseInner() { + private CheckNameAvailabilityResponseInner() { } /** @@ -47,17 +47,6 @@ public Boolean nameAvailable() { return this.nameAvailable; } - /** - * Set the nameAvailable property: Indicates if the resource name is available. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - /** * Get the reason property: The reason why the given name is not available. * @@ -68,18 +57,7 @@ public CheckNameAvailabilityReason reason() { } /** - * Set the reason property: The reason why the given name is not available. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: Detailed reason why the given name is available. + * Get the message property: Detailed reason why the given name is not available. * * @return the message value. */ @@ -87,25 +65,6 @@ public String message() { return this.message; } - /** - * Set the message property: Detailed reason why the given name is available. - * - * @param message the message value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CommonExportPropertiesInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CommonExportPropertiesInner.java index 2d1784a5162e..4aeb62b7d12a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CommonExportPropertiesInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CommonExportPropertiesInner.java @@ -1,18 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.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 com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; +import com.azure.resourcemanager.costmanagement.models.ExportSuspensionContext; import com.azure.resourcemanager.costmanagement.models.FormatType; import java.io.IOException; import java.time.OffsetDateTime; @@ -23,7 +25,7 @@ @Fluent public class CommonExportPropertiesInner implements JsonSerializable { /* - * The format of the export being delivered. Currently only 'Csv' is supported. + * The format of the export being delivered. */ private FormatType format; @@ -44,15 +46,37 @@ public class CommonExportPropertiesInner implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("systemSuspensionContext".equals(fieldName)) { + deserializedCommonExportPropertiesInner.systemSuspensionContext + = ExportSuspensionContext.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleCheckNameAvailabilityResponseInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleCheckNameAvailabilityResponseInner.java new file mode 100644 index 000000000000..bfcc4a031ecc --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleCheckNameAvailabilityResponseInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.costmanagement.models.Reason; +import java.io.IOException; + +/** + * The cost allocation rule check name availability response. + */ +@Immutable +public final class CostAllocationRuleCheckNameAvailabilityResponseInner + implements JsonSerializable { + /* + * Whether this rule name is available + */ + private Boolean nameAvailable; + + /* + * The reason this name is not available + */ + private Reason reason; + + /* + * Error message if the name is not available + */ + private String message; + + /** + * Creates an instance of CostAllocationRuleCheckNameAvailabilityResponseInner class. + */ + private CostAllocationRuleCheckNameAvailabilityResponseInner() { + } + + /** + * Get the nameAvailable property: Whether this rule name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: The reason this name is not available. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Get the message property: Error message if the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationRuleCheckNameAvailabilityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationRuleCheckNameAvailabilityResponseInner 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 CostAllocationRuleCheckNameAvailabilityResponseInner. + */ + public static CostAllocationRuleCheckNameAvailabilityResponseInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationRuleCheckNameAvailabilityResponseInner deserializedCostAllocationRuleCheckNameAvailabilityResponseInner + = new CostAllocationRuleCheckNameAvailabilityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCostAllocationRuleCheckNameAvailabilityResponseInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCostAllocationRuleCheckNameAvailabilityResponseInner.reason + = Reason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCostAllocationRuleCheckNameAvailabilityResponseInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationRuleCheckNameAvailabilityResponseInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleDefinitionInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleDefinitionInner.java new file mode 100644 index 000000000000..37329b65ec7b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleDefinitionInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.costmanagement.models.CostAllocationRuleProperties; +import java.io.IOException; + +/** + * The cost allocation rule model definition. + */ +@Fluent +public final class CostAllocationRuleDefinitionInner extends ProxyResource { + /* + * Cost allocation rule properties + */ + private CostAllocationRuleProperties properties; + + /* + * 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 CostAllocationRuleDefinitionInner class. + */ + public CostAllocationRuleDefinitionInner() { + } + + /** + * Get the properties property: Cost allocation rule properties. + * + * @return the properties value. + */ + public CostAllocationRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Cost allocation rule properties. + * + * @param properties the properties value to set. + * @return the CostAllocationRuleDefinitionInner object itself. + */ + public CostAllocationRuleDefinitionInner withProperties(CostAllocationRuleProperties properties) { + this.properties = properties; + 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; + } + + /** + * 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationRuleDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationRuleDefinitionInner 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 CostAllocationRuleDefinitionInner. + */ + public static CostAllocationRuleDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationRuleDefinitionInner deserializedCostAllocationRuleDefinitionInner + = new CostAllocationRuleDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCostAllocationRuleDefinitionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCostAllocationRuleDefinitionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCostAllocationRuleDefinitionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCostAllocationRuleDefinitionInner.properties + = CostAllocationRuleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCostAllocationRuleDefinitionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationRuleDefinitionInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostDetailsOperationResultsInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostDetailsOperationResultsInner.java index efe02918dae3..f034300c505d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostDetailsOperationResultsInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostDetailsOperationResultsInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; @@ -23,7 +23,7 @@ /** * The result of the long running operation for cost details Api. */ -@Fluent +@Immutable public final class CostDetailsOperationResultsInner implements JsonSerializable { /* * The id of the long running operation. @@ -63,7 +63,7 @@ public final class CostDetailsOperationResultsInner implements JsonSerializable< /** * Creates an instance of CostDetailsOperationResultsInner class. */ - public CostDetailsOperationResultsInner() { + private CostDetailsOperationResultsInner() { } /** @@ -75,17 +75,6 @@ public String id() { return this.id; } - /** - * Set the id property: The id of the long running operation. - * - * @param id the id value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: The name of the long running operation. * @@ -95,17 +84,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of the long running operation. - * - * @param name the name value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withName(String name) { - this.name = name; - return this; - } - /** * Get the type property: The type of the long running operation. * @@ -115,17 +93,6 @@ public String type() { return this.type; } - /** - * Set the type property: The type of the long running operation. - * - * @param type the type value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withType(String type) { - this.type = type; - return this; - } - /** * Get the status property: The status of the cost details operation. * @@ -135,17 +102,6 @@ public CostDetailsStatusType status() { return this.status; } - /** - * Set the status property: The status of the cost details operation. - * - * @param status the status value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withStatus(CostDetailsStatusType status) { - this.status = status; - return this; - } - /** * Get the innerManifest property: The manifest of the report generated by the operation. * @@ -165,18 +121,6 @@ public OffsetDateTime validTill() { return this.validTill; } - /** - * Set the validTill property: The time at which report URL becomes invalid/expires in UTC e.g. - * 2020-12-08T05:55:59.4394737Z. - * - * @param validTill the validTill value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withValidTill(OffsetDateTime validTill) { - this.validTill = validTill; - return this; - } - /** * Get the error property: The details of the error. * @@ -186,17 +130,6 @@ public ManagementError error() { return this.error; } - /** - * Set the error property: The details of the error. - * - * @param error the error value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withError(ManagementError error) { - this.error = error; - return this; - } - /** * Get the manifestVersion property: The Manifest version. * @@ -206,20 +139,6 @@ public String manifestVersion() { return this.innerManifest() == null ? null : this.innerManifest().manifestVersion(); } - /** - * Set the manifestVersion property: The Manifest version. - * - * @param manifestVersion the manifestVersion value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withManifestVersion(String manifestVersion) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withManifestVersion(manifestVersion); - return this; - } - /** * Get the dataFormat property: The data format of the report. * @@ -229,20 +148,6 @@ public CostDetailsDataFormat dataFormat() { return this.innerManifest() == null ? null : this.innerManifest().dataFormat(); } - /** - * Set the dataFormat property: The data format of the report. - * - * @param dataFormat the dataFormat value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withDataFormat(CostDetailsDataFormat dataFormat) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withDataFormat(dataFormat); - return this; - } - /** * Get the byteCount property: The total number of bytes in all blobs. * @@ -252,20 +157,6 @@ public Long byteCount() { return this.innerManifest() == null ? null : this.innerManifest().byteCount(); } - /** - * Set the byteCount property: The total number of bytes in all blobs. - * - * @param byteCount the byteCount value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withByteCount(Long byteCount) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withByteCount(byteCount); - return this; - } - /** * Get the blobCount property: The total number of blobs. * @@ -275,20 +166,6 @@ public Integer blobCount() { return this.innerManifest() == null ? null : this.innerManifest().blobCount(); } - /** - * Set the blobCount property: The total number of blobs. - * - * @param blobCount the blobCount value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withBlobCount(Integer blobCount) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withBlobCount(blobCount); - return this; - } - /** * Get the compressData property: Is the data in compressed format. * @@ -298,20 +175,6 @@ public Boolean compressData() { return this.innerManifest() == null ? null : this.innerManifest().compressData(); } - /** - * Set the compressData property: Is the data in compressed format. - * - * @param compressData the compressData value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withCompressData(Boolean compressData) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withCompressData(compressData); - return this; - } - /** * Get the blobs property: List of blob information generated by this operation. * @@ -321,20 +184,6 @@ public List blobs() { return this.innerManifest() == null ? null : this.innerManifest().blobs(); } - /** - * Set the blobs property: List of blob information generated by this operation. - * - * @param blobs the blobs value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withBlobs(List blobs) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withBlobs(blobs); - return this; - } - /** * Get the requestScope property: The request scope of the request. * @@ -344,20 +193,6 @@ public String requestScope() { return this.innerManifest() == null ? null : this.innerManifest().requestScope(); } - /** - * Set the requestScope property: The request scope of the request. - * - * @param requestScope the requestScope value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withRequestScope(String requestScope) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withRequestScope(requestScope); - return this; - } - /** * Get the requestBody property: The request payload body provided in Cost Details call. * @@ -367,31 +202,6 @@ public GenerateCostDetailsReportRequestDefinition requestBody() { return this.innerManifest() == null ? null : this.innerManifest().requestBody(); } - /** - * Set the requestBody property: The request payload body provided in Cost Details call. - * - * @param requestBody the requestBody value to set. - * @return the CostDetailsOperationResultsInner object itself. - */ - public CostDetailsOperationResultsInner withRequestBody(GenerateCostDetailsReportRequestDefinition requestBody) { - if (this.innerManifest() == null) { - this.innerManifest = new ReportManifest(); - } - this.innerManifest().withRequestBody(requestBody); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerManifest() != null) { - innerManifest().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostManagementOperationInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostManagementOperationInner.java index c1659d02e1b2..4f2e96329e0f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostManagementOperationInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostManagementOperationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,7 +17,7 @@ /** * A Cost management REST API operation. */ -@Fluent +@Immutable public final class CostManagementOperationInner extends Operation { /* * Operation id: {provider}/{resource}/{operation}. @@ -25,7 +25,7 @@ public final class CostManagementOperationInner extends Operation { private String id; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; @@ -36,8 +36,13 @@ public final class CostManagementOperationInner extends Operation { private Origin origin; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -50,7 +55,7 @@ public final class CostManagementOperationInner extends Operation { /** * Creates an instance of CostManagementOperationInner class. */ - public CostManagementOperationInner() { + private CostManagementOperationInner() { } /** @@ -63,8 +68,8 @@ public String id() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ @@ -84,9 +89,19 @@ public Origin origin() { return this.origin; } + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + @Override + public OperationDisplay display() { + return this.display; + } + /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -106,27 +121,6 @@ public String name() { return this.name; } - /** - * {@inheritDoc} - */ - @Override - public CostManagementOperationInner withDisplay(OperationDisplay display) { - super.withDisplay(display); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ @@ -157,7 +151,7 @@ public static CostManagementOperationInner fromJson(JsonReader jsonReader) throw } else if ("isDataAction".equals(fieldName)) { deserializedCostManagementOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); } else if ("display".equals(fieldName)) { - deserializedCostManagementOperationInner.withDisplay(OperationDisplay.fromJson(reader)); + deserializedCostManagementOperationInner.display = OperationDisplay.fromJson(reader); } else if ("origin".equals(fieldName)) { deserializedCostManagementOperationInner.origin = Origin.fromString(reader.getString()); } else if ("actionType".equals(fieldName)) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionInner.java index af954131e97d..1399c19f9471 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,13 +17,18 @@ /** * List of Dimension. */ -@Fluent +@Immutable public final class DimensionInner extends CostManagementResource { /* * Dimension properties. */ private DimensionProperties innerProperties; + /* + * Resource tags. + */ + private Map tags; + /* * ETag of the resource. */ @@ -35,24 +40,29 @@ public final class DimensionInner extends CostManagementResource { private String sku; /* - * The type of the resource. + * Location of the resource. + */ + private String location; + + /* + * Resource type. */ private String type; /* - * The name of the resource. + * Resource name. */ private String name; /* - * Fully qualified resource Id for the resource. + * Resource Id. */ private String id; /** * Creates an instance of DimensionInner class. */ - public DimensionInner() { + private DimensionInner() { } /** @@ -64,6 +74,16 @@ private DimensionProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + @Override + public Map tags() { + return this.tags; + } + /** * Get the etag property: ETag of the resource. * @@ -85,7 +105,17 @@ public String sku() { } /** - * Get the type property: The type of the resource. + * Get the location property: Location of the resource. + * + * @return the location value. + */ + @Override + public String location() { + return this.location; + } + + /** + * Get the type property: Resource type. * * @return the type value. */ @@ -95,7 +125,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: Resource name. * * @return the name value. */ @@ -105,7 +135,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: Resource Id. * * @return the id value. */ @@ -114,24 +144,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public DimensionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DimensionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the description property: Dimension description. * @@ -168,20 +180,6 @@ public List data() { return this.innerProperties() == null ? null : this.innerProperties().data(); } - /** - * Set the data property: Dimension data. - * - * @param data the data value to set. - * @return the DimensionInner object itself. - */ - public DimensionInner withData(List data) { - if (this.innerProperties() == null) { - this.innerProperties = new DimensionProperties(); - } - this.innerProperties().withData(data); - return this; - } - /** * Get the total property: Total number of data for the dimension. * @@ -227,26 +225,12 @@ public String nextLink() { return this.innerProperties() == null ? null : this.innerProperties().nextLink(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().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.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -257,7 +241,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DimensionInner 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 DimensionInner. */ public static DimensionInner fromJson(JsonReader jsonReader) throws IOException { @@ -274,14 +257,14 @@ public static DimensionInner fromJson(JsonReader jsonReader) throws IOException } else if ("type".equals(fieldName)) { deserializedDimensionInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedDimensionInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDimensionInner.withTags(tags); + deserializedDimensionInner.location = reader.getString(); } else if ("sku".equals(fieldName)) { deserializedDimensionInner.sku = reader.getString(); } else if ("eTag".equals(fieldName)) { deserializedDimensionInner.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDimensionInner.tags = tags; } else if ("properties".equals(fieldName)) { deserializedDimensionInner.innerProperties = DimensionProperties.fromJson(reader); } else { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionProperties.java index d0436d3716b4..d4eb2b20479f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Dimension properties. */ -@Fluent +@Immutable public final class DimensionProperties implements JsonSerializable { /* * Dimension description. @@ -67,7 +67,7 @@ public final class DimensionProperties implements JsonSerializable data() { return this.data; } - /** - * Set the data property: Dimension data. - * - * @param data the data value to set. - * @return the DimensionProperties object itself. - */ - public DimensionProperties withData(List data) { - this.data = data; - return this; - } - /** * Get the total property: Total number of data for the dimension. * @@ -162,14 +151,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DownloadUrlInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DownloadUrlInner.java index 8dd1575cfae7..d0af392064b8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DownloadUrlInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DownloadUrlInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The URL to download the generated report. */ -@Fluent +@Immutable public final class DownloadUrlInner implements JsonSerializable { /* * The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. @@ -37,7 +37,7 @@ public final class DownloadUrlInner implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportInner.java index 248dfe42b7f6..3e4e2239fa28 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportInner.java @@ -1,18 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.costmanagement.models.CostManagementProxyResource; +import com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; import com.azure.resourcemanager.costmanagement.models.ExportSchedule; +import com.azure.resourcemanager.costmanagement.models.ExportSuspensionContext; import com.azure.resourcemanager.costmanagement.models.FormatType; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentity; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,12 +25,33 @@ * An export resource. */ @Fluent -public final class ExportInner extends CostManagementProxyResource { +public final class ExportInner extends ProxyResource { /* * The properties of the export. */ private ExportProperties innerProperties; + /* + * The managed identity associated with Export + */ + private SystemAssignedServiceIdentity identity; + + /* + * The location of the Export's managed identity. Only required when utilizing managed identity. + */ + private String location; + + /* + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user + * is updating the latest version or not. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -56,6 +82,79 @@ private ExportProperties innerProperties() { return this.innerProperties; } + /** + * Get the identity property: The managed identity associated with Export. + * + * @return the identity value. + */ + public SystemAssignedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity associated with Export. + * + * @param identity the identity value to set. + * @return the ExportInner object itself. + */ + public ExportInner withIdentity(SystemAssignedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The location of the Export's managed identity. Only required when utilizing managed + * identity. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the Export's managed identity. Only required when utilizing managed + * identity. + * + * @param location the location value to set. + * @return the ExportInner object itself. + */ + public ExportInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @param etag the etag value to set. + * @return the ExportInner object itself. + */ + public ExportInner withEtag(String etag) { + this.etag = etag; + 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; + } + /** * Get the type property: The type of the resource. * @@ -86,15 +185,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ExportInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the schedule property: Has schedule information for the export. * @@ -119,7 +209,7 @@ public ExportInner withSchedule(ExportSchedule schedule) { } /** - * Get the format property: The format of the export being delivered. Currently only 'Csv' is supported. + * Get the format property: The format of the export being delivered. * * @return the format value. */ @@ -128,7 +218,7 @@ public FormatType format() { } /** - * Set the format property: The format of the export being delivered. Currently only 'Csv' is supported. + * Set the format property: The format of the export being delivered. * * @param format the format value to set. * @return the ExportInner object itself. @@ -212,8 +302,7 @@ public ExportInner withRunHistory(ExportExecutionListResultInner runHistory) { /** * Get the partitionData property: If set to true, exported data will be partitioned by size and placed in a blob - * directory together with a manifest file. Note: this option is currently available only for Microsoft Customer - * Agreement commerce scopes. + * directory together with a manifest file. * * @return the partitionData value. */ @@ -223,8 +312,7 @@ public Boolean partitionData() { /** * Set the partitionData property: If set to true, exported data will be partitioned by size and placed in a blob - * directory together with a manifest file. Note: this option is currently available only for Microsoft Customer - * Agreement commerce scopes. + * directory together with a manifest file. * * @param partitionData the partitionData value to set. * @return the ExportInner object itself. @@ -237,6 +325,81 @@ public ExportInner withPartitionData(Boolean partitionData) { return this; } + /** + * Get the dataOverwriteBehavior property: Allow customers to select overwrite data(OverwritePreviousReport) for + * exports. This setting will enable overwrite data for the same month in customer storage account. By default set + * to CreateNewReport. + * + * @return the dataOverwriteBehavior value. + */ + public DataOverwriteBehaviorType dataOverwriteBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().dataOverwriteBehavior(); + } + + /** + * Set the dataOverwriteBehavior property: Allow customers to select overwrite data(OverwritePreviousReport) for + * exports. This setting will enable overwrite data for the same month in customer storage account. By default set + * to CreateNewReport. + * + * @param dataOverwriteBehavior the dataOverwriteBehavior value to set. + * @return the ExportInner object itself. + */ + public ExportInner withDataOverwriteBehavior(DataOverwriteBehaviorType dataOverwriteBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportProperties(); + } + this.innerProperties().withDataOverwriteBehavior(dataOverwriteBehavior); + return this; + } + + /** + * Get the compressionMode property: Allow customers to select compress data for exports. This setting will enable + * destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. + * + * @return the compressionMode value. + */ + public CompressionModeType compressionMode() { + return this.innerProperties() == null ? null : this.innerProperties().compressionMode(); + } + + /** + * Set the compressionMode property: Allow customers to select compress data for exports. This setting will enable + * destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. + * + * @param compressionMode the compressionMode value to set. + * @return the ExportInner object itself. + */ + public ExportInner withCompressionMode(CompressionModeType compressionMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportProperties(); + } + this.innerProperties().withCompressionMode(compressionMode); + return this; + } + + /** + * Get the exportDescription property: The export description set by customer at time of export creation/update. + * + * @return the exportDescription value. + */ + public String exportDescription() { + return this.innerProperties() == null ? null : this.innerProperties().exportDescription(); + } + + /** + * Set the exportDescription property: The export description set by customer at time of export creation/update. + * + * @param exportDescription the exportDescription value to set. + * @return the ExportInner object itself. + */ + public ExportInner withExportDescription(String exportDescription) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportProperties(); + } + this.innerProperties().withExportDescription(exportDescription); + return this; + } + /** * Get the nextRunTimeEstimate property: If the export has an active schedule, provides an estimate of the next run * time. @@ -248,15 +411,13 @@ public OffsetDateTime nextRunTimeEstimate() { } /** - * Validates the instance. + * Get the systemSuspensionContext property: The export suspension reason if export is in SystemSuspended state. + * This is not populated currently. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the systemSuspensionContext value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public ExportSuspensionContext systemSuspensionContext() { + return this.innerProperties() == null ? null : this.innerProperties().systemSuspensionContext(); } /** @@ -265,8 +426,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("eTag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("eTag", this.etag); return jsonWriter.writeEndObject(); } @@ -292,10 +455,16 @@ public static ExportInner fromJson(JsonReader jsonReader) throws IOException { deserializedExportInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedExportInner.type = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedExportInner.withEtag(reader.getString()); } else if ("properties".equals(fieldName)) { deserializedExportInner.innerProperties = ExportProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedExportInner.identity = SystemAssignedServiceIdentity.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedExportInner.location = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedExportInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedExportInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportListResultInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportListResultInner.java index 092dcd5bebc3..a3f8a36987b4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportListResultInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportListResultInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; @@ -25,7 +25,7 @@ public final class ExportListResultInner implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportProperties.java index 4748dc5cb10b..363a7d0126a2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportProperties.java @@ -1,18 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.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 com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; import com.azure.resourcemanager.costmanagement.models.ExportSchedule; +import com.azure.resourcemanager.costmanagement.models.ExportSuspensionContext; import com.azure.resourcemanager.costmanagement.models.FormatType; import java.io.IOException; import java.time.OffsetDateTime; @@ -27,6 +29,11 @@ public final class ExportProperties extends CommonExportPropertiesInner { */ private ExportSchedule schedule; + /* + * The export suspension reason if export is in SystemSuspended state. This is not populated currently. + */ + private ExportSuspensionContext systemSuspensionContext; + /* * If the export has an active schedule, provides an estimate of the next run time. */ @@ -58,6 +65,17 @@ public ExportProperties withSchedule(ExportSchedule schedule) { return this; } + /** + * Get the systemSuspensionContext property: The export suspension reason if export is in SystemSuspended state. + * This is not populated currently. + * + * @return the systemSuspensionContext value. + */ + @Override + public ExportSuspensionContext systemSuspensionContext() { + return this.systemSuspensionContext; + } + /** * Get the nextRunTimeEstimate property: If the export has an active schedule, provides an estimate of the next run * time. @@ -115,33 +133,31 @@ public ExportProperties withPartitionData(Boolean partitionData) { } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (schedule() != null) { - schedule().validate(); - } - if (deliveryInfo() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property deliveryInfo in model ExportProperties")); - } else { - deliveryInfo().validate(); - } - if (definition() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property definition in model ExportProperties")); - } else { - definition().validate(); - } - if (runHistory() != null) { - runHistory().validate(); - } + public ExportProperties withDataOverwriteBehavior(DataOverwriteBehaviorType dataOverwriteBehavior) { + super.withDataOverwriteBehavior(dataOverwriteBehavior); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(ExportProperties.class); + /** + * {@inheritDoc} + */ + @Override + public ExportProperties withCompressionMode(CompressionModeType compressionMode) { + super.withCompressionMode(compressionMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExportProperties withExportDescription(String exportDescription) { + super.withExportDescription(exportDescription); + return this; + } /** * {@inheritDoc} @@ -154,6 +170,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("format", format() == null ? null : format().toString()); jsonWriter.writeJsonField("runHistory", runHistory()); jsonWriter.writeBooleanField("partitionData", partitionData()); + jsonWriter.writeStringField("dataOverwriteBehavior", + dataOverwriteBehavior() == null ? null : dataOverwriteBehavior().toString()); + jsonWriter.writeStringField("compressionMode", compressionMode() == null ? null : compressionMode().toString()); + jsonWriter.writeStringField("exportDescription", exportDescription()); jsonWriter.writeJsonField("schedule", this.schedule); return jsonWriter.writeEndObject(); } @@ -184,9 +204,19 @@ public static ExportProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedExportProperties.withRunHistory(ExportExecutionListResultInner.fromJson(reader)); } else if ("partitionData".equals(fieldName)) { deserializedExportProperties.withPartitionData(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataOverwriteBehavior".equals(fieldName)) { + deserializedExportProperties + .withDataOverwriteBehavior(DataOverwriteBehaviorType.fromString(reader.getString())); + } else if ("compressionMode".equals(fieldName)) { + deserializedExportProperties + .withCompressionMode(CompressionModeType.fromString(reader.getString())); + } else if ("exportDescription".equals(fieldName)) { + deserializedExportProperties.withExportDescription(reader.getString()); } else if ("nextRunTimeEstimate".equals(fieldName)) { deserializedExportProperties.nextRunTimeEstimate = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("systemSuspensionContext".equals(fieldName)) { + deserializedExportProperties.systemSuspensionContext = ExportSuspensionContext.fromJson(reader); } else if ("schedule".equals(fieldName)) { deserializedExportProperties.schedule = ExportSchedule.fromJson(reader); } else { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunInner.java index c4fc5b5961aa..b8014c929316 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * An export run. */ -@Fluent +@Immutable public final class ExportRunInner extends CostManagementProxyResource { /* * The properties of the export run. @@ -26,24 +26,30 @@ public final class ExportRunInner extends CostManagementProxyResource { private ExportRunPropertiesInner innerProperties; /* - * The type of the resource. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user + * is updating the latest version or not. + */ + private String etag; + + /* + * Resource type. */ private String type; /* - * The name of the resource. + * Resource name. */ private String name; /* - * Fully qualified resource Id for the resource. + * Resource Id. */ private String id; /** * Creates an instance of ExportRunInner class. */ - public ExportRunInner() { + private ExportRunInner() { } /** @@ -56,7 +62,18 @@ private ExportRunPropertiesInner innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: Resource type. * * @return the type value. */ @@ -66,7 +83,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: Resource name. * * @return the name value. */ @@ -76,7 +93,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: Resource Id. * * @return the id value. */ @@ -85,15 +102,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ExportRunInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the executionType property: The type of the export run. * @@ -103,20 +111,6 @@ public ExecutionType executionType() { return this.innerProperties() == null ? null : this.innerProperties().executionType(); } - /** - * Set the executionType property: The type of the export run. - * - * @param executionType the executionType value to set. - * @return the ExportRunInner object itself. - */ - public ExportRunInner withExecutionType(ExecutionType executionType) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withExecutionType(executionType); - return this; - } - /** * Get the status property: The last known status of the export run. * @@ -126,20 +120,6 @@ public ExecutionStatus status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } - /** - * Set the status property: The last known status of the export run. - * - * @param status the status value to set. - * @return the ExportRunInner object itself. - */ - public ExportRunInner withStatus(ExecutionStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withStatus(status); - return this; - } - /** * Get the submittedBy property: The identifier for the entity that triggered the export. For on-demand runs it is * the user email. For scheduled runs it is 'System'. @@ -150,21 +130,6 @@ public String submittedBy() { return this.innerProperties() == null ? null : this.innerProperties().submittedBy(); } - /** - * Set the submittedBy property: The identifier for the entity that triggered the export. For on-demand runs it is - * the user email. For scheduled runs it is 'System'. - * - * @param submittedBy the submittedBy value to set. - * @return the ExportRunInner object itself. - */ - public ExportRunInner withSubmittedBy(String submittedBy) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withSubmittedBy(submittedBy); - return this; - } - /** * Get the submittedTime property: The time when export was queued to be run. * @@ -174,20 +139,6 @@ public OffsetDateTime submittedTime() { return this.innerProperties() == null ? null : this.innerProperties().submittedTime(); } - /** - * Set the submittedTime property: The time when export was queued to be run. - * - * @param submittedTime the submittedTime value to set. - * @return the ExportRunInner object itself. - */ - public ExportRunInner withSubmittedTime(OffsetDateTime submittedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withSubmittedTime(submittedTime); - return this; - } - /** * Get the processingStartTime property: The time when export was picked up to be run. * @@ -198,40 +149,30 @@ public OffsetDateTime processingStartTime() { } /** - * Set the processingStartTime property: The time when export was picked up to be run. + * Get the processingEndTime property: The time when the export run finished. * - * @param processingStartTime the processingStartTime value to set. - * @return the ExportRunInner object itself. + * @return the processingEndTime value. */ - public ExportRunInner withProcessingStartTime(OffsetDateTime processingStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withProcessingStartTime(processingStartTime); - return this; + public OffsetDateTime processingEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().processingEndTime(); } /** - * Get the processingEndTime property: The time when the export run finished. + * Get the startDate property: The start datetime for the export. * - * @return the processingEndTime value. + * @return the startDate value. */ - public OffsetDateTime processingEndTime() { - return this.innerProperties() == null ? null : this.innerProperties().processingEndTime(); + public OffsetDateTime startDate() { + return this.innerProperties() == null ? null : this.innerProperties().startDate(); } /** - * Set the processingEndTime property: The time when the export run finished. + * Get the endDate property: The end datetime for the export. * - * @param processingEndTime the processingEndTime value to set. - * @return the ExportRunInner object itself. + * @return the endDate value. */ - public ExportRunInner withProcessingEndTime(OffsetDateTime processingEndTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withProcessingEndTime(processingEndTime); - return this; + public OffsetDateTime endDate() { + return this.innerProperties() == null ? null : this.innerProperties().endDate(); } /** @@ -244,17 +185,12 @@ public String fileName() { } /** - * Set the fileName property: The name of the exported file. + * Get the manifestFile property: The manifest file location(URI location) for the exported files. * - * @param fileName the fileName value to set. - * @return the ExportRunInner object itself. + * @return the manifestFile value. */ - public ExportRunInner withFileName(String fileName) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withFileName(fileName); - return this; + public String manifestFile() { + return this.innerProperties() == null ? null : this.innerProperties().manifestFile(); } /** @@ -266,20 +202,6 @@ public CommonExportPropertiesInner runSettings() { return this.innerProperties() == null ? null : this.innerProperties().runSettings(); } - /** - * Set the runSettings property: The export settings that were in effect for this run. - * - * @param runSettings the runSettings value to set. - * @return the ExportRunInner object itself. - */ - public ExportRunInner withRunSettings(CommonExportPropertiesInner runSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withRunSettings(runSettings); - return this; - } - /** * Get the error property: The details of any error. * @@ -289,32 +211,6 @@ public ManagementError error() { return this.innerProperties() == null ? null : this.innerProperties().error(); } - /** - * Set the error property: The details of any error. - * - * @param error the error value to set. - * @return the ExportRunInner object itself. - */ - public ExportRunInner withError(ManagementError error) { - if (this.innerProperties() == null) { - this.innerProperties = new ExportRunPropertiesInner(); - } - this.innerProperties().withError(error); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -332,7 +228,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ExportRunInner 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 ExportRunInner. */ public static ExportRunInner fromJson(JsonReader jsonReader) throws IOException { @@ -349,7 +244,7 @@ public static ExportRunInner fromJson(JsonReader jsonReader) throws IOException } else if ("type".equals(fieldName)) { deserializedExportRunInner.type = reader.getString(); } else if ("eTag".equals(fieldName)) { - deserializedExportRunInner.withEtag(reader.getString()); + deserializedExportRunInner.etag = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedExportRunInner.innerProperties = ExportRunPropertiesInner.fromJson(reader); } else { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunPropertiesInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunPropertiesInner.java index cdfceb544594..0529619bfbce 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunPropertiesInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunPropertiesInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; @@ -20,7 +20,7 @@ /** * The properties of the export run. */ -@Fluent +@Immutable public final class ExportRunPropertiesInner implements JsonSerializable { /* * The type of the export run. @@ -53,11 +53,26 @@ public final class ExportRunPropertiesInner implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startDate".equals(fieldName)) { + deserializedExportRunPropertiesInner.startDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDate".equals(fieldName)) { + deserializedExportRunPropertiesInner.endDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("fileName".equals(fieldName)) { deserializedExportRunPropertiesInner.fileName = reader.getString(); + } else if ("manifestFile".equals(fieldName)) { + deserializedExportRunPropertiesInner.manifestFile = reader.getString(); } else if ("runSettings".equals(fieldName)) { deserializedExportRunPropertiesInner.runSettings = CommonExportPropertiesInner.fromJson(reader); } else if ("error".equals(fieldName)) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastProperties.java index 69483adf4e7d..edb324fba74a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Forecast properties. */ -@Fluent +@Immutable public final class ForecastProperties implements JsonSerializable { /* * The link (url) to the next page of results. @@ -36,7 +36,7 @@ public final class ForecastProperties implements JsonSerializable columns() { return this.columns; } - /** - * Set the columns property: Array of columns. - * - * @param columns the columns value to set. - * @return the ForecastProperties object itself. - */ - public ForecastProperties withColumns(List columns) { - this.columns = columns; - return this; - } - /** * Get the rows property: Array of rows. * @@ -88,28 +66,6 @@ public List> rows() { return this.rows; } - /** - * Set the rows property: Array of rows. - * - * @param rows the rows value to set. - * @return the ForecastProperties object itself. - */ - public ForecastProperties withRows(List> rows) { - this.rows = rows; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (columns() != null) { - columns().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastResultInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastResultInner.java index 6a35728b373e..f78e29762a30 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastResultInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,13 +17,18 @@ /** * Result of forecast. It contains all columns listed under groupings and aggregation. */ -@Fluent +@Immutable public final class ForecastResultInner extends CostManagementResource { /* * Forecast properties */ private ForecastProperties innerProperties; + /* + * Resource tags. + */ + private Map tags; + /* * ETag of the resource. */ @@ -35,24 +40,29 @@ public final class ForecastResultInner extends CostManagementResource { private String sku; /* - * The type of the resource. + * Location of the resource. + */ + private String location; + + /* + * Resource type. */ private String type; /* - * The name of the resource. + * Resource name. */ private String name; /* - * Fully qualified resource Id for the resource. + * Resource Id. */ private String id; /** * Creates an instance of ForecastResultInner class. */ - public ForecastResultInner() { + private ForecastResultInner() { } /** @@ -64,6 +74,16 @@ private ForecastProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + @Override + public Map tags() { + return this.tags; + } + /** * Get the etag property: ETag of the resource. * @@ -85,7 +105,17 @@ public String sku() { } /** - * Get the type property: The type of the resource. + * Get the location property: Location of the resource. + * + * @return the location value. + */ + @Override + public String location() { + return this.location; + } + + /** + * Get the type property: Resource type. * * @return the type value. */ @@ -95,7 +125,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: Resource name. * * @return the name value. */ @@ -105,7 +135,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: Resource Id. * * @return the id value. */ @@ -114,24 +144,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ForecastResultInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ForecastResultInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the nextLink property: The link (url) to the next page of results. * @@ -141,20 +153,6 @@ public String nextLink() { return this.innerProperties() == null ? null : this.innerProperties().nextLink(); } - /** - * Set the nextLink property: The link (url) to the next page of results. - * - * @param nextLink the nextLink value to set. - * @return the ForecastResultInner object itself. - */ - public ForecastResultInner withNextLink(String nextLink) { - if (this.innerProperties() == null) { - this.innerProperties = new ForecastProperties(); - } - this.innerProperties().withNextLink(nextLink); - return this; - } - /** * Get the columns property: Array of columns. * @@ -164,20 +162,6 @@ public List columns() { return this.innerProperties() == null ? null : this.innerProperties().columns(); } - /** - * Set the columns property: Array of columns. - * - * @param columns the columns value to set. - * @return the ForecastResultInner object itself. - */ - public ForecastResultInner withColumns(List columns) { - if (this.innerProperties() == null) { - this.innerProperties = new ForecastProperties(); - } - this.innerProperties().withColumns(columns); - return this; - } - /** * Get the rows property: Array of rows. * @@ -187,40 +171,12 @@ public List> rows() { return this.innerProperties() == null ? null : this.innerProperties().rows(); } - /** - * Set the rows property: Array of rows. - * - * @param rows the rows value to set. - * @return the ForecastResultInner object itself. - */ - public ForecastResultInner withRows(List> rows) { - if (this.innerProperties() == null) { - this.innerProperties = new ForecastProperties(); - } - this.innerProperties().withRows(rows); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().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.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -231,7 +187,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ForecastResultInner 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 ForecastResultInner. */ public static ForecastResultInner fromJson(JsonReader jsonReader) throws IOException { @@ -248,14 +203,14 @@ public static ForecastResultInner fromJson(JsonReader jsonReader) throws IOExcep } else if ("type".equals(fieldName)) { deserializedForecastResultInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedForecastResultInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedForecastResultInner.withTags(tags); + deserializedForecastResultInner.location = reader.getString(); } else if ("sku".equals(fieldName)) { deserializedForecastResultInner.sku = reader.getString(); } else if ("eTag".equals(fieldName)) { deserializedForecastResultInner.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedForecastResultInner.tags = tags; } else if ("properties".equals(fieldName)) { deserializedForecastResultInner.innerProperties = ForecastProperties.fromJson(reader); } else { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationResultInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationResultInner.java index 193b14e369cd..135f0d9fec84 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationResultInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationResultInner.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -15,102 +16,85 @@ /** * The result of the long running operation for cost detailed report. */ -@Fluent -public final class GenerateDetailedCostReportOperationResultInner - implements JsonSerializable { +@Immutable +public final class GenerateDetailedCostReportOperationResultInner extends ProxyResource { /* - * The ARM resource id of the long running operation. + * The properties of the resource generated. */ - private String id; + private DownloadUrlInner innerProperties; /* - * The name of the long running operation. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String name; + private SystemData systemData; /* - * The type of the long running operation. + * The type of the resource. */ private String type; /* - * The properties of the resource generated. - */ - private DownloadUrlInner innerProperties; - - /** - * Creates an instance of GenerateDetailedCostReportOperationResultInner class. + * The name of the resource. */ - public GenerateDetailedCostReportOperationResultInner() { - } + private String name; - /** - * Get the id property: The ARM resource id of the long running operation. - * - * @return the id value. + /* + * Fully qualified resource Id for the resource. */ - public String id() { - return this.id; - } + private String id; /** - * Set the id property: The ARM resource id of the long running operation. - * - * @param id the id value to set. - * @return the GenerateDetailedCostReportOperationResultInner object itself. + * Creates an instance of GenerateDetailedCostReportOperationResultInner class. */ - public GenerateDetailedCostReportOperationResultInner withId(String id) { - this.id = id; - return this; + private GenerateDetailedCostReportOperationResultInner() { } /** - * Get the name property: The name of the long running operation. + * Get the innerProperties property: The properties of the resource generated. * - * @return the name value. + * @return the innerProperties value. */ - public String name() { - return this.name; + private DownloadUrlInner innerProperties() { + return this.innerProperties; } /** - * Set the name property: The name of the long running operation. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param name the name value to set. - * @return the GenerateDetailedCostReportOperationResultInner object itself. + * @return the systemData value. */ - public GenerateDetailedCostReportOperationResultInner withName(String name) { - this.name = name; - return this; + public SystemData systemData() { + return this.systemData; } /** - * Get the type property: The type of the long running operation. + * Get the type property: The type of the resource. * * @return the type value. */ + @Override public String type() { return this.type; } /** - * Set the type property: The type of the long running operation. + * Get the name property: The name of the resource. * - * @param type the type value to set. - * @return the GenerateDetailedCostReportOperationResultInner object itself. + * @return the name value. */ - public GenerateDetailedCostReportOperationResultInner withType(String type) { - this.type = type; - return this; + @Override + public String name() { + return this.name; } /** - * Get the innerProperties property: The properties of the resource generated. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the innerProperties value. + * @return the id value. */ - private DownloadUrlInner innerProperties() { - return this.innerProperties; + @Override + public String id() { + return this.id; } /** @@ -133,21 +117,6 @@ public OffsetDateTime validTill() { return this.innerProperties() == null ? null : this.innerProperties().validTill(); } - /** - * Set the validTill property: The time at which report URL becomes invalid/expires in UTC e.g. - * 2020-12-08T05:55:59.4394737Z. - * - * @param validTill the validTill value to set. - * @return the GenerateDetailedCostReportOperationResultInner object itself. - */ - public GenerateDetailedCostReportOperationResultInner withValidTill(OffsetDateTime validTill) { - if (this.innerProperties() == null) { - this.innerProperties = new DownloadUrlInner(); - } - this.innerProperties().withValidTill(validTill); - return this; - } - /** * Get the downloadUrl property: The URL to download the generated report. * @@ -157,40 +126,12 @@ public String downloadUrl() { return this.innerProperties() == null ? null : this.innerProperties().downloadUrl(); } - /** - * Set the downloadUrl property: The URL to download the generated report. - * - * @param downloadUrl the downloadUrl value to set. - * @return the GenerateDetailedCostReportOperationResultInner object itself. - */ - public GenerateDetailedCostReportOperationResultInner withDownloadUrl(String downloadUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new DownloadUrlInner(); - } - this.innerProperties().withDownloadUrl(downloadUrl); - 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.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("type", this.type); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -201,6 +142,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of GenerateDetailedCostReportOperationResultInner 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 GenerateDetailedCostReportOperationResultInner. */ public static GenerateDetailedCostReportOperationResultInner fromJson(JsonReader jsonReader) throws IOException { @@ -220,6 +162,8 @@ public static GenerateDetailedCostReportOperationResultInner fromJson(JsonReader } else if ("properties".equals(fieldName)) { deserializedGenerateDetailedCostReportOperationResultInner.innerProperties = DownloadUrlInner.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGenerateDetailedCostReportOperationResultInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationStatusesInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationStatusesInner.java index b92601abe37a..48dce15374d9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationStatusesInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationStatusesInner.java @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.costmanagement.models.Status; @@ -17,18 +18,12 @@ /** * The status of the long running operation for cost detailed report. */ -@Fluent -public final class GenerateDetailedCostReportOperationStatusesInner - implements JsonSerializable { +@Immutable +public final class GenerateDetailedCostReportOperationStatusesInner extends ProxyResource { /* - * The ID of the long running operation. - */ - private String id; - - /* - * The name of the long running operation. + * The properties of the usage file generated. */ - private String name; + private DownloadUrlInner innerProperties; /* * The status of the long running operation. @@ -45,65 +40,44 @@ public final class GenerateDetailedCostReportOperationStatusesInner */ private String endTime; - /* - * The type of the long running operation. - */ - private String type; - /* * The details of the error. */ private ManagementError error; /* - * The properties of the usage file generated. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private DownloadUrlInner innerProperties; + private SystemData systemData; - /** - * Creates an instance of GenerateDetailedCostReportOperationStatusesInner class. + /* + * The type of the resource. */ - public GenerateDetailedCostReportOperationStatusesInner() { - } + private String type; - /** - * Get the id property: The ID of the long running operation. - * - * @return the id value. + /* + * The name of the resource. */ - public String id() { - return this.id; - } + private String name; - /** - * Set the id property: The ID of the long running operation. - * - * @param id the id value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. + /* + * Fully qualified resource Id for the resource. */ - public GenerateDetailedCostReportOperationStatusesInner withId(String id) { - this.id = id; - return this; - } + private String id; /** - * Get the name property: The name of the long running operation. - * - * @return the name value. + * Creates an instance of GenerateDetailedCostReportOperationStatusesInner class. */ - public String name() { - return this.name; + private GenerateDetailedCostReportOperationStatusesInner() { } /** - * Set the name property: The name of the long running operation. + * Get the innerProperties property: The properties of the usage file generated. * - * @param name the name value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. + * @return the innerProperties value. */ - public GenerateDetailedCostReportOperationStatusesInner withName(String name) { - this.name = name; - return this; + private DownloadUrlInner innerProperties() { + return this.innerProperties; } /** @@ -115,17 +89,6 @@ public Status status() { return this.status; } - /** - * Set the status property: The status of the long running operation. - * - * @param status the status value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. - */ - public GenerateDetailedCostReportOperationStatusesInner withStatus(Status status) { - this.status = status; - return this; - } - /** * Get the startTime property: The startTime of the operation. * @@ -135,17 +98,6 @@ public String startTime() { return this.startTime; } - /** - * Set the startTime property: The startTime of the operation. - * - * @param startTime the startTime value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. - */ - public GenerateDetailedCostReportOperationStatusesInner withStartTime(String startTime) { - this.startTime = startTime; - return this; - } - /** * Get the endTime property: The endTime of the operation. * @@ -156,63 +108,51 @@ public String endTime() { } /** - * Set the endTime property: The endTime of the operation. - * - * @param endTime the endTime value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. - */ - public GenerateDetailedCostReportOperationStatusesInner withEndTime(String endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the type property: The type of the long running operation. + * Get the error property: The details of the error. * - * @return the type value. + * @return the error value. */ - public String type() { - return this.type; + public ManagementError error() { + return this.error; } /** - * Set the type property: The type of the long running operation. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param type the type value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. + * @return the systemData value. */ - public GenerateDetailedCostReportOperationStatusesInner withType(String type) { - this.type = type; - return this; + public SystemData systemData() { + return this.systemData; } /** - * Get the error property: The details of the error. + * Get the type property: The type of the resource. * - * @return the error value. + * @return the type value. */ - public ManagementError error() { - return this.error; + @Override + public String type() { + return this.type; } /** - * Set the error property: The details of the error. + * Get the name property: The name of the resource. * - * @param error the error value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. + * @return the name value. */ - public GenerateDetailedCostReportOperationStatusesInner withError(ManagementError error) { - this.error = error; - return this; + @Override + public String name() { + return this.name; } /** - * Get the innerProperties property: The properties of the usage file generated. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the innerProperties value. + * @return the id value. */ - private DownloadUrlInner innerProperties() { - return this.innerProperties; + @Override + public String id() { + return this.id; } /** @@ -235,21 +175,6 @@ public OffsetDateTime validTill() { return this.innerProperties() == null ? null : this.innerProperties().validTill(); } - /** - * Set the validTill property: The time at which report URL becomes invalid/expires in UTC e.g. - * 2020-12-08T05:55:59.4394737Z. - * - * @param validTill the validTill value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. - */ - public GenerateDetailedCostReportOperationStatusesInner withValidTill(OffsetDateTime validTill) { - if (this.innerProperties() == null) { - this.innerProperties = new DownloadUrlInner(); - } - this.innerProperties().withValidTill(validTill); - return this; - } - /** * Get the downloadUrl property: The URL to download the generated report. * @@ -259,48 +184,17 @@ public String downloadUrl() { return this.innerProperties() == null ? null : this.innerProperties().downloadUrl(); } - /** - * Set the downloadUrl property: The URL to download the generated report. - * - * @param downloadUrl the downloadUrl value to set. - * @return the GenerateDetailedCostReportOperationStatusesInner object itself. - */ - public GenerateDetailedCostReportOperationStatusesInner withDownloadUrl(String downloadUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new DownloadUrlInner(); - } - this.innerProperties().withDownloadUrl(downloadUrl); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeJsonField("status", this.status); jsonWriter.writeStringField("startTime", this.startTime); jsonWriter.writeStringField("endTime", this.endTime); - jsonWriter.writeStringField("type", this.type); jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -310,6 +204,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of GenerateDetailedCostReportOperationStatusesInner 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 GenerateDetailedCostReportOperationStatusesInner. */ public static GenerateDetailedCostReportOperationStatusesInner fromJson(JsonReader jsonReader) throws IOException { @@ -324,20 +219,23 @@ public static GenerateDetailedCostReportOperationStatusesInner fromJson(JsonRead deserializedGenerateDetailedCostReportOperationStatusesInner.id = reader.getString(); } else if ("name".equals(fieldName)) { deserializedGenerateDetailedCostReportOperationStatusesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGenerateDetailedCostReportOperationStatusesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGenerateDetailedCostReportOperationStatusesInner.innerProperties + = DownloadUrlInner.fromJson(reader); } else if ("status".equals(fieldName)) { deserializedGenerateDetailedCostReportOperationStatusesInner.status = Status.fromJson(reader); } else if ("startTime".equals(fieldName)) { deserializedGenerateDetailedCostReportOperationStatusesInner.startTime = reader.getString(); } else if ("endTime".equals(fieldName)) { deserializedGenerateDetailedCostReportOperationStatusesInner.endTime = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGenerateDetailedCostReportOperationStatusesInner.type = reader.getString(); } else if ("error".equals(fieldName)) { deserializedGenerateDetailedCostReportOperationStatusesInner.error = ManagementError.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedGenerateDetailedCostReportOperationStatusesInner.innerProperties - = DownloadUrlInner.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGenerateDetailedCostReportOperationStatusesInner.systemData + = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/IncludedQuantityUtilizationSummaryProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/IncludedQuantityUtilizationSummaryProperties.java index dbfe95c2b38c..35d50978a0f2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/IncludedQuantityUtilizationSummaryProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/IncludedQuantityUtilizationSummaryProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * Included Quantity utilization summary properties. */ -@Fluent +@Immutable public final class IncludedQuantityUtilizationSummaryProperties extends BenefitUtilizationSummaryProperties { /* * This is the utilized percentage for the benefit ID. @@ -31,6 +31,11 @@ public final class IncludedQuantityUtilizationSummaryProperties extends BenefitU */ private OffsetDateTime usageDate; + /* + * The benefit type. Supported values: 'SavingsPlan'. + */ + private BenefitKind benefitType; + /* * The benefit order ID is the identifier for a benefit purchase. */ @@ -49,7 +54,7 @@ public final class IncludedQuantityUtilizationSummaryProperties extends BenefitU /** * Creates an instance of IncludedQuantityUtilizationSummaryProperties class. */ - public IncludedQuantityUtilizationSummaryProperties() { + private IncludedQuantityUtilizationSummaryProperties() { } /** @@ -72,6 +77,16 @@ public OffsetDateTime usageDate() { return this.usageDate; } + /** + * Get the benefitType property: The benefit type. Supported values: 'SavingsPlan'. + * + * @return the benefitType value. + */ + @Override + public BenefitKind benefitType() { + return this.benefitType; + } + /** * Get the benefitOrderId property: The benefit order ID is the identifier for a benefit purchase. * @@ -102,24 +117,6 @@ public String armSkuName() { return this.armSkuName; } - /** - * {@inheritDoc} - */ - @Override - public IncludedQuantityUtilizationSummaryProperties withBenefitType(BenefitKind benefitType) { - super.withBenefitType(benefitType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -153,8 +150,8 @@ public static IncludedQuantityUtilizationSummaryProperties fromJson(JsonReader j } else if ("benefitOrderId".equals(fieldName)) { deserializedIncludedQuantityUtilizationSummaryProperties.benefitOrderId = reader.getString(); } else if ("benefitType".equals(fieldName)) { - deserializedIncludedQuantityUtilizationSummaryProperties - .withBenefitType(BenefitKind.fromString(reader.getString())); + deserializedIncludedQuantityUtilizationSummaryProperties.benefitType + = BenefitKind.fromString(reader.getString()); } else if ("usageDate".equals(fieldName)) { deserializedIncludedQuantityUtilizationSummaryProperties.usageDate = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/MarkupRuleInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/MarkupRuleInner.java new file mode 100644 index 000000000000..194e096e6c9a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/MarkupRuleInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.costmanagement.models.MarkupRuleProperties; +import java.io.IOException; + +/** + * Markup rule. + */ +@Fluent +public final class MarkupRuleInner extends ProxyResource { + /* + * Markup rule properties + */ + private MarkupRuleProperties properties; + + /* + * 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 MarkupRuleInner class. + */ + public MarkupRuleInner() { + } + + /** + * Get the properties property: Markup rule properties. + * + * @return the properties value. + */ + public MarkupRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Markup rule properties. + * + * @param properties the properties value to set. + * @return the MarkupRuleInner object itself. + */ + public MarkupRuleInner withProperties(MarkupRuleProperties properties) { + this.properties = properties; + 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; + } + + /** + * 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarkupRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarkupRuleInner 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 MarkupRuleInner. + */ + public static MarkupRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarkupRuleInner deserializedMarkupRuleInner = new MarkupRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMarkupRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMarkupRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMarkupRuleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMarkupRuleInner.properties = MarkupRuleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMarkupRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMarkupRuleInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/OperationStatusInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/OperationStatusInner.java index 557ede45af19..5e42cdba8f41 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/OperationStatusInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/OperationStatusInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * The status of the long running operation. */ -@Fluent +@Immutable public final class OperationStatusInner implements JsonSerializable { /* * The status of the long running operation. @@ -32,7 +32,7 @@ public final class OperationStatusInner implements JsonSerializable { + /* + * The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + */ + private OffsetDateTime expiryTime; + + /* + * The URL to download the generated report. + */ + private String downloadUrl; + + /* + * The properties in downloaded file + */ + private MCAPriceSheetProperties downloadFileProperties; + + /** + * Creates an instance of PricesheetDownloadPropertiesInner class. + */ + private PricesheetDownloadPropertiesInner() { + } + + /** + * Get the expiryTime property: The time at which report URL becomes invalid/expires in UTC e.g. + * 2020-12-08T05:55:59.4394737Z. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Get the downloadUrl property: The URL to download the generated report. + * + * @return the downloadUrl value. + */ + public String downloadUrl() { + return this.downloadUrl; + } + + /** + * Get the downloadFileProperties property: The properties in downloaded file. + * + * @return the downloadFileProperties value. + */ + public MCAPriceSheetProperties downloadFileProperties() { + return this.downloadFileProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("downloadUrl", this.downloadUrl); + jsonWriter.writeJsonField("downloadFileProperties", this.downloadFileProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PricesheetDownloadPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PricesheetDownloadPropertiesInner 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 PricesheetDownloadPropertiesInner. + */ + public static PricesheetDownloadPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PricesheetDownloadPropertiesInner deserializedPricesheetDownloadPropertiesInner + = new PricesheetDownloadPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expiryTime".equals(fieldName)) { + deserializedPricesheetDownloadPropertiesInner.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("downloadUrl".equals(fieldName)) { + deserializedPricesheetDownloadPropertiesInner.downloadUrl = reader.getString(); + } else if ("downloadFileProperties".equals(fieldName)) { + deserializedPricesheetDownloadPropertiesInner.downloadFileProperties + = MCAPriceSheetProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPricesheetDownloadPropertiesInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryProperties.java index 21e7d1324933..8b47ddcea5a4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Query properties. */ -@Fluent +@Immutable public final class QueryProperties implements JsonSerializable { /* * The link (url) to the next page of results. @@ -36,7 +36,7 @@ public final class QueryProperties implements JsonSerializable /** * Creates an instance of QueryProperties class. */ - public QueryProperties() { + private QueryProperties() { } /** @@ -48,17 +48,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link (url) to the next page of results. - * - * @param nextLink the nextLink value to set. - * @return the QueryProperties object itself. - */ - public QueryProperties withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Get the columns property: Array of columns. * @@ -68,17 +57,6 @@ public List columns() { return this.columns; } - /** - * Set the columns property: Array of columns. - * - * @param columns the columns value to set. - * @return the QueryProperties object itself. - */ - public QueryProperties withColumns(List columns) { - this.columns = columns; - return this; - } - /** * Get the rows property: Array of rows. * @@ -88,28 +66,6 @@ public List> rows() { return this.rows; } - /** - * Set the rows property: Array of rows. - * - * @param rows the rows value to set. - * @return the QueryProperties object itself. - */ - public QueryProperties withRows(List> rows) { - this.rows = rows; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (columns() != null) { - columns().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryResultInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryResultInner.java index 0f4ec1e647dc..a267959072d3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryResultInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,13 +17,18 @@ /** * Result of query. It contains all columns listed under groupings and aggregation. */ -@Fluent +@Immutable public final class QueryResultInner extends CostManagementResource { /* * Query properties */ private QueryProperties innerProperties; + /* + * Resource tags. + */ + private Map tags; + /* * ETag of the resource. */ @@ -35,24 +40,29 @@ public final class QueryResultInner extends CostManagementResource { private String sku; /* - * The type of the resource. + * Location of the resource. + */ + private String location; + + /* + * Resource type. */ private String type; /* - * The name of the resource. + * Resource name. */ private String name; /* - * Fully qualified resource Id for the resource. + * Resource Id. */ private String id; /** * Creates an instance of QueryResultInner class. */ - public QueryResultInner() { + private QueryResultInner() { } /** @@ -64,6 +74,16 @@ private QueryProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + @Override + public Map tags() { + return this.tags; + } + /** * Get the etag property: ETag of the resource. * @@ -85,7 +105,17 @@ public String sku() { } /** - * Get the type property: The type of the resource. + * Get the location property: Location of the resource. + * + * @return the location value. + */ + @Override + public String location() { + return this.location; + } + + /** + * Get the type property: Resource type. * * @return the type value. */ @@ -95,7 +125,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: Resource name. * * @return the name value. */ @@ -105,7 +135,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: Resource Id. * * @return the id value. */ @@ -114,24 +144,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public QueryResultInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public QueryResultInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the nextLink property: The link (url) to the next page of results. * @@ -141,20 +153,6 @@ public String nextLink() { return this.innerProperties() == null ? null : this.innerProperties().nextLink(); } - /** - * Set the nextLink property: The link (url) to the next page of results. - * - * @param nextLink the nextLink value to set. - * @return the QueryResultInner object itself. - */ - public QueryResultInner withNextLink(String nextLink) { - if (this.innerProperties() == null) { - this.innerProperties = new QueryProperties(); - } - this.innerProperties().withNextLink(nextLink); - return this; - } - /** * Get the columns property: Array of columns. * @@ -164,20 +162,6 @@ public List columns() { return this.innerProperties() == null ? null : this.innerProperties().columns(); } - /** - * Set the columns property: Array of columns. - * - * @param columns the columns value to set. - * @return the QueryResultInner object itself. - */ - public QueryResultInner withColumns(List columns) { - if (this.innerProperties() == null) { - this.innerProperties = new QueryProperties(); - } - this.innerProperties().withColumns(columns); - return this; - } - /** * Get the rows property: Array of rows. * @@ -187,40 +171,12 @@ public List> rows() { return this.innerProperties() == null ? null : this.innerProperties().rows(); } - /** - * Set the rows property: Array of rows. - * - * @param rows the rows value to set. - * @return the QueryResultInner object itself. - */ - public QueryResultInner withRows(List> rows) { - if (this.innerProperties() == null) { - this.innerProperties = new QueryProperties(); - } - this.innerProperties().withRows(rows); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().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.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -231,7 +187,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of QueryResultInner 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 QueryResultInner. */ public static QueryResultInner fromJson(JsonReader jsonReader) throws IOException { @@ -248,14 +203,14 @@ public static QueryResultInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedQueryResultInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedQueryResultInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedQueryResultInner.withTags(tags); + deserializedQueryResultInner.location = reader.getString(); } else if ("sku".equals(fieldName)) { deserializedQueryResultInner.sku = reader.getString(); } else if ("eTag".equals(fieldName)) { deserializedQueryResultInner.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedQueryResultInner.tags = tags; } else if ("properties".equals(fieldName)) { deserializedQueryResultInner.innerProperties = QueryProperties.fromJson(reader); } else { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportConfigDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportConfigDefinition.java index 2b529e28b568..ecf5039bfdec 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportConfigDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportConfigDefinition.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.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; @@ -159,31 +158,6 @@ public ReportConfigDefinition withIncludeMonetaryCommitment(Boolean includeMonet 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 ReportConfigDefinition")); - } - if (timeframe() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property timeframe in model ReportConfigDefinition")); - } - if (timePeriod() != null) { - timePeriod().validate(); - } - if (dataSet() != null) { - dataSet().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReportConfigDefinition.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportManifest.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportManifest.java index 57e7622b7986..bdd91c59419e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportManifest.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportManifest.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * The manifest of the report generated by the operation. */ -@Fluent +@Immutable public final class ReportManifest implements JsonSerializable { /* * The Manifest version. @@ -58,7 +58,7 @@ public final class ReportManifest implements JsonSerializable { /** * Creates an instance of ReportManifest class. */ - public ReportManifest() { + private ReportManifest() { } /** @@ -70,17 +70,6 @@ public String manifestVersion() { return this.manifestVersion; } - /** - * Set the manifestVersion property: The Manifest version. - * - * @param manifestVersion the manifestVersion value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withManifestVersion(String manifestVersion) { - this.manifestVersion = manifestVersion; - return this; - } - /** * Get the dataFormat property: The data format of the report. * @@ -90,17 +79,6 @@ public CostDetailsDataFormat dataFormat() { return this.dataFormat; } - /** - * Set the dataFormat property: The data format of the report. - * - * @param dataFormat the dataFormat value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withDataFormat(CostDetailsDataFormat dataFormat) { - this.dataFormat = dataFormat; - return this; - } - /** * Get the byteCount property: The total number of bytes in all blobs. * @@ -110,17 +88,6 @@ public Long byteCount() { return this.byteCount; } - /** - * Set the byteCount property: The total number of bytes in all blobs. - * - * @param byteCount the byteCount value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withByteCount(Long byteCount) { - this.byteCount = byteCount; - return this; - } - /** * Get the blobCount property: The total number of blobs. * @@ -130,17 +97,6 @@ public Integer blobCount() { return this.blobCount; } - /** - * Set the blobCount property: The total number of blobs. - * - * @param blobCount the blobCount value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withBlobCount(Integer blobCount) { - this.blobCount = blobCount; - return this; - } - /** * Get the compressData property: Is the data in compressed format. * @@ -150,17 +106,6 @@ public Boolean compressData() { return this.compressData; } - /** - * Set the compressData property: Is the data in compressed format. - * - * @param compressData the compressData value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withCompressData(Boolean compressData) { - this.compressData = compressData; - return this; - } - /** * Get the innerRequestContext property: The context of the Cost Details request. * @@ -179,17 +124,6 @@ public List blobs() { return this.blobs; } - /** - * Set the blobs property: List of blob information generated by this operation. - * - * @param blobs the blobs value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withBlobs(List blobs) { - this.blobs = blobs; - return this; - } - /** * Get the requestScope property: The request scope of the request. * @@ -199,20 +133,6 @@ public String requestScope() { return this.innerRequestContext() == null ? null : this.innerRequestContext().requestScope(); } - /** - * Set the requestScope property: The request scope of the request. - * - * @param requestScope the requestScope value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withRequestScope(String requestScope) { - if (this.innerRequestContext() == null) { - this.innerRequestContext = new RequestContext(); - } - this.innerRequestContext().withRequestScope(requestScope); - return this; - } - /** * Get the requestBody property: The request payload body provided in Cost Details call. * @@ -222,34 +142,6 @@ public GenerateCostDetailsReportRequestDefinition requestBody() { return this.innerRequestContext() == null ? null : this.innerRequestContext().requestBody(); } - /** - * Set the requestBody property: The request payload body provided in Cost Details call. - * - * @param requestBody the requestBody value to set. - * @return the ReportManifest object itself. - */ - public ReportManifest withRequestBody(GenerateCostDetailsReportRequestDefinition requestBody) { - if (this.innerRequestContext() == null) { - this.innerRequestContext = new RequestContext(); - } - this.innerRequestContext().withRequestBody(requestBody); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerRequestContext() != null) { - innerRequestContext().validate(); - } - if (blobs() != null) { - blobs().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportUrl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportUrl.java index caeb6bbe6189..a6d784a50e65 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportUrl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportUrl.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * The URL to download the generated report. */ -@Fluent +@Immutable public final class ReportUrl implements JsonSerializable { /* * The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily @@ -34,7 +34,7 @@ public final class ReportUrl implements JsonSerializable { /** * Creates an instance of ReportUrl class. */ - public ReportUrl() { + private ReportUrl() { } /** @@ -47,18 +47,6 @@ public ReservationReportSchema reportUrl() { return this.reportUrl; } - /** - * Set the reportUrl property: The CSV file from the reportUrl blob link consists of reservation usage data with the - * following schema at daily granularity. - * - * @param reportUrl the reportUrl value to set. - * @return the ReportUrl object itself. - */ - public ReportUrl withReportUrl(ReservationReportSchema reportUrl) { - this.reportUrl = reportUrl; - return this; - } - /** * Get the validUntil property: The time at which report URL becomes invalid. * @@ -68,25 +56,6 @@ public OffsetDateTime validUntil() { return this.validUntil; } - /** - * Set the validUntil property: The time at which report URL becomes invalid. - * - * @param validUntil the validUntil value to set. - * @return the ReportUrl object itself. - */ - public ReportUrl withValidUntil(OffsetDateTime validUntil) { - this.validUntil = validUntil; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/RequestContext.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/RequestContext.java index f7fc1a42ae3f..27439a4ba440 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/RequestContext.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/RequestContext.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The context of the Cost Details request. */ -@Fluent +@Immutable public final class RequestContext implements JsonSerializable { /* * The request scope of the request. @@ -30,7 +30,7 @@ public final class RequestContext implements JsonSerializable { /** * Creates an instance of RequestContext class. */ - public RequestContext() { + private RequestContext() { } /** @@ -42,17 +42,6 @@ public String requestScope() { return this.requestScope; } - /** - * Set the requestScope property: The request scope of the request. - * - * @param requestScope the requestScope value to set. - * @return the RequestContext object itself. - */ - public RequestContext withRequestScope(String requestScope) { - this.requestScope = requestScope; - return this; - } - /** * Get the requestBody property: The request payload body provided in Cost Details call. * @@ -62,28 +51,6 @@ public GenerateCostDetailsReportRequestDefinition requestBody() { return this.requestBody; } - /** - * Set the requestBody property: The request payload body provided in Cost Details call. - * - * @param requestBody the requestBody value to set. - * @return the RequestContext object itself. - */ - public RequestContext withRequestBody(GenerateCostDetailsReportRequestDefinition requestBody) { - this.requestBody = requestBody; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (requestBody() != null) { - requestBody().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SavingsPlanUtilizationSummaryProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SavingsPlanUtilizationSummaryProperties.java index 03f9415dcc13..41994cdaca51 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SavingsPlanUtilizationSummaryProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SavingsPlanUtilizationSummaryProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,11 +18,11 @@ /** * Savings plan utilization summary properties. */ -@Fluent +@Immutable public final class SavingsPlanUtilizationSummaryProperties extends BenefitUtilizationSummaryProperties { /* * This is the average hourly utilization for each date range that corresponds to given grain (Daily, Monthly). - * Suppose the API call is for usageDate > 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will + * Suppose the API call is for usageDate > 2025-03-01 and usageDate < 2022-10-31 at a daily granularity. There will * be one record per benefit id for each day. For a single day, the avgUtilizationPercentage value will be equal to * the average of the set of values where the set contains 24 utilization percentage entries one for each hour in a * specific day. @@ -31,7 +31,7 @@ public final class SavingsPlanUtilizationSummaryProperties extends BenefitUtiliz /* * This is the minimum hourly utilization for each date range that corresponds to given grain (Daily, Monthly). - * Suppose the API call is for usageDate > 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will + * Suppose the API call is for usageDate > 2025-03-01 and usageDate < 2022-10-31 at a daily granularity. There will * be one record per benefit id for each day. For a single day, the minUtilizationPercentage value will be equal to * the smallest in the set of values where the set contains 24 utilization percentage entries one for each hour in a * specific day. If on the day 2022-10-18, the lowest utilization percentage was 10% at hour 4, then the value for @@ -41,7 +41,7 @@ public final class SavingsPlanUtilizationSummaryProperties extends BenefitUtiliz /* * This is the maximum hourly utilization for each date range that corresponds to given grain (Daily, Monthly). - * Suppose the API call is for usageDate > 2022-10-01 and usageDate < 2022-10-31 at a daily granularity. There will + * Suppose the API call is for usageDate > 2025-03-01 and usageDate < 2022-10-31 at a daily granularity. There will * be one record per benefit id for each day. For a single day, the maxUtilizationPercentage value will be equal to * the largest in the set of values where the set contains 24 utilization percentage entries one for each hour in a * specific day. If on the day 2022-10-18, the largest utilization percentage was 90% at hour 5, then the value for @@ -55,6 +55,11 @@ public final class SavingsPlanUtilizationSummaryProperties extends BenefitUtiliz */ private OffsetDateTime usageDate; + /* + * The benefit type. Supported values: 'SavingsPlan'. + */ + private BenefitKind benefitType; + /* * The benefit order ID is the identifier for a benefit purchase. */ @@ -73,12 +78,12 @@ public final class SavingsPlanUtilizationSummaryProperties extends BenefitUtiliz /** * Creates an instance of SavingsPlanUtilizationSummaryProperties class. */ - public SavingsPlanUtilizationSummaryProperties() { + private SavingsPlanUtilizationSummaryProperties() { } /** * Get the avgUtilizationPercentage property: This is the average hourly utilization for each date range that - * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2022-10-01 and usageDate + * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2025-03-01 and usageDate * < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, * the avgUtilizationPercentage value will be equal to the average of the set of values where the set contains 24 * utilization percentage entries one for each hour in a specific day. @@ -91,7 +96,7 @@ public BigDecimal avgUtilizationPercentage() { /** * Get the minUtilizationPercentage property: This is the minimum hourly utilization for each date range that - * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2022-10-01 and usageDate + * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2025-03-01 and usageDate * < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, * the minUtilizationPercentage value will be equal to the smallest in the set of values where the set contains 24 * utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the lowest @@ -106,7 +111,7 @@ public BigDecimal minUtilizationPercentage() { /** * Get the maxUtilizationPercentage property: This is the maximum hourly utilization for each date range that - * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2022-10-01 and usageDate + * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2025-03-01 and usageDate * < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, * the maxUtilizationPercentage value will be equal to the largest in the set of values where the set contains 24 * utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the largest @@ -130,6 +135,16 @@ public OffsetDateTime usageDate() { return this.usageDate; } + /** + * Get the benefitType property: The benefit type. Supported values: 'SavingsPlan'. + * + * @return the benefitType value. + */ + @Override + public BenefitKind benefitType() { + return this.benefitType; + } + /** * Get the benefitOrderId property: The benefit order ID is the identifier for a benefit purchase. * @@ -160,24 +175,6 @@ public String armSkuName() { return this.armSkuName; } - /** - * {@inheritDoc} - */ - @Override - public SavingsPlanUtilizationSummaryProperties withBenefitType(BenefitKind benefitType) { - super.withBenefitType(benefitType); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -211,8 +208,8 @@ public static SavingsPlanUtilizationSummaryProperties fromJson(JsonReader jsonRe } else if ("benefitOrderId".equals(fieldName)) { deserializedSavingsPlanUtilizationSummaryProperties.benefitOrderId = reader.getString(); } else if ("benefitType".equals(fieldName)) { - deserializedSavingsPlanUtilizationSummaryProperties - .withBenefitType(BenefitKind.fromString(reader.getString())); + deserializedSavingsPlanUtilizationSummaryProperties.benefitType + = BenefitKind.fromString(reader.getString()); } else if ("usageDate".equals(fieldName)) { deserializedSavingsPlanUtilizationSummaryProperties.usageDate = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionInner.java index 136e9e16b3b9..61c5e15d0363 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionInner.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -13,7 +14,6 @@ import com.azure.resourcemanager.costmanagement.models.NotificationProperties; import com.azure.resourcemanager.costmanagement.models.ScheduleProperties; import com.azure.resourcemanager.costmanagement.models.ScheduledActionKind; -import com.azure.resourcemanager.costmanagement.models.ScheduledActionProxyResource; import com.azure.resourcemanager.costmanagement.models.ScheduledActionStatus; import java.io.IOException; @@ -21,17 +21,12 @@ * Scheduled action definition. */ @Fluent -public final class ScheduledActionInner extends ScheduledActionProxyResource { +public final class ScheduledActionInner extends ProxyResource { /* * The properties of the scheduled action. */ private ScheduledActionProperties innerProperties; - /* - * Kind of the scheduled action. - */ - private SystemData systemData; - /* * Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch * the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or @@ -39,6 +34,16 @@ public final class ScheduledActionInner extends ScheduledActionProxyResource { */ private String etag; + /* + * Kind of the scheduled action. + */ + private ScheduledActionKind kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -70,26 +75,58 @@ private ScheduledActionProperties innerProperties() { } /** - * Get the systemData property: Kind of the scheduled action. + * Get the etag property: Resource Etag. For update calls, eTag is optional and can be specified to achieve + * optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag + * as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not + * required. * - * @return the systemData value. + * @return the etag value. */ - @Override - public SystemData systemData() { - return this.systemData; + public String etag() { + return this.etag; } /** - * Get the etag property: Resource Etag. For update calls, eTag is optional and can be specified to achieve + * Set the etag property: Resource Etag. For update calls, eTag is optional and can be specified to achieve * optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag * as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not * required. * - * @return the etag value. + * @param etag the etag value to set. + * @return the ScheduledActionInner object itself. */ - @Override - public String etag() { - return this.etag; + public ScheduledActionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the kind property: Kind of the scheduled action. + * + * @return the kind value. + */ + public ScheduledActionKind kind() { + return this.kind; + } + + /** + * Set the kind property: Kind of the scheduled action. + * + * @param kind the kind value to set. + * @return the ScheduledActionInner object itself. + */ + public ScheduledActionInner withKind(ScheduledActionKind kind) { + this.kind = kind; + 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; } /** @@ -122,15 +159,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ScheduledActionInner withKind(ScheduledActionKind kind) { - super.withKind(kind); - return this; - } - /** * Get the displayName property: Scheduled action name. * @@ -249,9 +277,10 @@ public ScheduledActionInner withSchedule(ScheduleProperties schedule) { } /** - * Get the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Get the scope property: For private scheduled action(Create or Update), scope will be empty.<br /> For + * shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' + * for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup + * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for * EnrollmentAccount scope, @@ -270,9 +299,10 @@ public String scope() { } /** - * Set the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Set the scope property: For private scheduled action(Create or Update), scope will be empty.<br /> For + * shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' + * for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup + * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for * EnrollmentAccount scope, @@ -343,26 +373,15 @@ public ScheduledActionInner withViewId(String viewId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", kind() == null ? null : kind().toString()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("eTag", this.etag); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -388,14 +407,14 @@ public static ScheduledActionInner fromJson(JsonReader jsonReader) throws IOExce deserializedScheduledActionInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedScheduledActionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedScheduledActionInner.innerProperties = ScheduledActionProperties.fromJson(reader); } else if ("eTag".equals(fieldName)) { deserializedScheduledActionInner.etag = reader.getString(); } else if ("kind".equals(fieldName)) { - deserializedScheduledActionInner.withKind(ScheduledActionKind.fromString(reader.getString())); + deserializedScheduledActionInner.kind = ScheduledActionKind.fromString(reader.getString()); } else if ("systemData".equals(fieldName)) { deserializedScheduledActionInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedScheduledActionInner.innerProperties = ScheduledActionProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionProperties.java index bc817c320558..53be0797b469 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.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; @@ -47,7 +46,8 @@ public final class ScheduledActionProperties implements JsonSerializable For shared scheduled action(Create or + * Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, @@ -183,9 +183,10 @@ public ScheduledActionProperties withSchedule(ScheduleProperties schedule) { } /** - * Get the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Get the scope property: For private scheduled action(Create or Update), scope will be empty.<br /> For + * shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' + * for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup + * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for * EnrollmentAccount scope, @@ -204,9 +205,10 @@ public String scope() { } /** - * Set the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Set the scope property: For private scheduled action(Create or Update), scope will be empty.<br /> For + * shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' + * for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup + * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for * EnrollmentAccount scope, @@ -268,48 +270,6 @@ public ScheduledActionProperties withViewId(String viewId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model ScheduledActionProperties")); - } - if (fileDestination() != null) { - fileDestination().validate(); - } - if (notification() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property notification in model ScheduledActionProperties")); - } else { - notification().validate(); - } - if (schedule() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property schedule in model ScheduledActionProperties")); - } else { - schedule().validate(); - } - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model ScheduledActionProperties")); - } - if (viewId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property viewId in model ScheduledActionProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScheduledActionProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingInner.java new file mode 100644 index 000000000000..efa4c7f91726 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +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.costmanagement.models.SettingsKind; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceSetting; +import java.io.IOException; + +/** + * Setting definition. + */ +@Immutable +public class SettingInner extends ProxyResource { + /* + * 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 SettingsKind kind = SettingsKind.fromString("Setting"); + + /* + * 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 SettingInner class. + */ + public SettingInner() { + } + + /** + * 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 SettingsKind kind() { + return this.kind; + } + + /** + * 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 SettingInner object itself. + */ + SettingInner 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SettingInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SettingInner 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 SettingInner. + */ + public static SettingInner 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 ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("taginheritance".equals(discriminatorValue)) { + return TagInheritanceSetting.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SettingInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SettingInner deserializedSettingInner = new SettingInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSettingInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSettingInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSettingInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedSettingInner.kind = SettingsKind.fromString(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedSettingInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSettingInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingsListResultInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingsListResultInner.java new file mode 100644 index 000000000000..614c4f929e4e --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingsListResultInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * Setting list result. It contains a list of settings. + */ +@Immutable +public final class SettingsListResultInner implements JsonSerializable { + /* + * The list of settings. + */ + private List value; + + /** + * Creates an instance of SettingsListResultInner class. + */ + private SettingsListResultInner() { + } + + /** + * Get the value property: The list of settings. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SettingsListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SettingsListResultInner 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 SettingsListResultInner. + */ + public static SettingsListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SettingsListResultInner deserializedSettingsListResultInner = new SettingsListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SettingInner.fromJson(reader1)); + deserializedSettingsListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSettingsListResultInner; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewInner.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewInner.java index 2894a49728c6..4a19ff85be3c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewInner.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewInner.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.costmanagement.models.AccumulatedType; import com.azure.resourcemanager.costmanagement.models.ChartType; -import com.azure.resourcemanager.costmanagement.models.CostManagementProxyResource; import com.azure.resourcemanager.costmanagement.models.KpiProperties; import com.azure.resourcemanager.costmanagement.models.MetricType; import com.azure.resourcemanager.costmanagement.models.PivotProperties; @@ -26,12 +27,23 @@ * States and configurations of Cost Analysis. */ @Fluent -public final class ViewInner extends CostManagementProxyResource { +public final class ViewInner extends ProxyResource { /* * The properties of the view. */ private ViewProperties innerProperties; + /* + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user + * is updating the latest version or not. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -62,6 +74,37 @@ private ViewProperties innerProperties() { return this.innerProperties; } + /** + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @param etag the etag value to set. + * @return the ViewInner object itself. + */ + public ViewInner withEtag(String etag) { + this.etag = etag; + 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; + } + /** * Get the type property: The type of the resource. * @@ -92,15 +135,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ViewInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the displayName property: User input name of the view. Required. * @@ -191,6 +225,20 @@ public OffsetDateTime modifiedOn() { return this.innerProperties() == null ? null : this.innerProperties().modifiedOn(); } + /** + * Set the modifiedOn property: Date when the user last modified this view. + * + * @param modifiedOn the modifiedOn value to set. + * @return the ViewInner object itself. + */ + public ViewInner withModifiedOn(OffsetDateTime modifiedOn) { + if (this.innerProperties() == null) { + this.innerProperties = new ViewProperties(); + } + this.innerProperties().withModifiedOn(modifiedOn); + return this; + } + /** * Get the dateRange property: Date range of the current view. * @@ -459,26 +507,14 @@ public ViewInner withIncludeMonetaryCommitment(Boolean includeMonetaryCommitment return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("eTag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("eTag", this.etag); return jsonWriter.writeEndObject(); } @@ -504,10 +540,12 @@ public static ViewInner fromJson(JsonReader jsonReader) throws IOException { deserializedViewInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedViewInner.type = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedViewInner.withEtag(reader.getString()); } else if ("properties".equals(fieldName)) { deserializedViewInner.innerProperties = ViewProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedViewInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedViewInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewProperties.java index 857821d1a89d..5033ed9968dd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.fluent.models; @@ -21,6 +21,7 @@ import com.azure.resourcemanager.costmanagement.models.ReportType; import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -191,6 +192,17 @@ public OffsetDateTime modifiedOn() { return this.modifiedOn; } + /** + * Set the modifiedOn property: Date when the user last modified this view. + * + * @param modifiedOn the modifiedOn value to set. + * @return the ViewProperties object itself. + */ + public ViewProperties withModifiedOn(OffsetDateTime modifiedOn) { + this.modifiedOn = modifiedOn; + return this; + } + /** * Get the dateRange property: Date range of the current view. * @@ -450,23 +462,6 @@ public ViewProperties withIncludeMonetaryCommitment(Boolean includeMonetaryCommi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerQuery() != null) { - innerQuery().validate(); - } - if (kpis() != null) { - kpis().forEach(e -> e.validate()); - } - if (pivots() != null) { - pivots().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -475,6 +470,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("displayName", this.displayName); jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("modifiedOn", + this.modifiedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.modifiedOn)); jsonWriter.writeStringField("dateRange", this.dateRange); jsonWriter.writeJsonField("query", this.innerQuery); jsonWriter.writeStringField("chart", this.chart == null ? null : this.chart.toString()); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/package-info.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/package-info.java index fb70f3c11b5c..c1a787195965 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/package-info.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for CostManagementClient. + * Package containing the inner data models for CostManagement. * CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.costmanagement.fluent.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/package-info.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/package-info.java index 4ae35adcb046..f4c47725a4ed 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/package-info.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for CostManagementClient. + * Package containing the service clients for CostManagement. * CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.costmanagement.fluent; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertImpl.java index 06a4ea628334..37284bcc7d44 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.AlertInner; import com.azure.resourcemanager.costmanagement.models.Alert; import com.azure.resourcemanager.costmanagement.models.AlertPropertiesDefinition; @@ -37,6 +38,10 @@ public String etag() { return this.innerModel().etag(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public AlertPropertiesDefinition definition() { return this.innerModel().definition(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsClientImpl.java index 956793a9c9e7..8df3a237b9f8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -42,57 +42,92 @@ public final class AlertsClientImpl implements AlertsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of AlertsClientImpl. * * @param client the instance of the service client containing this operation class. */ - AlertsClientImpl(CostManagementClientImpl client) { + AlertsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(AlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientAlerts to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for CostManagementManagementClientAlerts to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientAlerts") public interface AlertsService { @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.CostManagement/alerts") + @Get("/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); + @PathParam(value = "alertId", encoded = true) String alertId, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, @PathParam(value = "alertId", encoded = true) String alertId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> dismiss(@HostParam("$host") String endpoint, + Mono> dismiss(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, @PathParam(value = "alertId", encoded = true) String alertId, - @BodyParam("application/json") DismissAlertPayload parameters, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DismissAlertPayload parameters, Context context); + + @Patch("/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response dismissSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DismissAlertPayload parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/alerts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/alerts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listExternal(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, + @PathParam("externalCloudProviderId") String externalCloudProviderId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listExternal(@HostParam("$host") String endpoint, + Response listExternalSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, @PathParam("externalCloudProviderId") String externalCloudProviderId, @HeaderParam("Accept") String accept, @@ -100,348 +135,148 @@ Mono> listExternal(@HostParam("$host") String endpoi } /** - * Lists the alerts for scope defined. + * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param alertId Alert ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts along with {@link Response} on successful completion of {@link Mono}. + * @return the alert for the scope by alert ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(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.")); - } + private Mono> getWithResponseAsync(String scope, String alertId) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, alertId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the alerts for scope defined. - * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(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.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); - } - - /** - * Lists the alerts for scope defined. - * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scope) { - return listWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists the alerts for scope defined. - * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scope, Context context) { - return listWithResponseAsync(scope, context).block(); - } - - /** - * Lists the alerts for scope defined. + * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param alertId Alert ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts. + * @return the alert for the scope by alert ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsResultInner list(String scope) { - return listWithResponse(scope, Context.NONE).getValue(); + private Mono getAsync(String scope, String alertId) { + return getWithResponseAsync(scope, alertId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert for the scope by alert ID along with {@link Response} on successful completion of {@link Mono}. + * @return the alert for the scope by alert ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String alertId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (alertId == null) { - return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); - } + public Response getWithResponse(String scope, String alertId, Context context) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, alertId, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, alertId, accept, context); } /** * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert for the scope by alert ID along with {@link Response} on successful completion of {@link Mono}. + * @return the alert for the scope by alert ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String alertId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (alertId == null) { - return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, alertId, accept, context); + public AlertInner get(String scope, String alertId) { + return getWithResponse(scope, alertId, Context.NONE).getValue(); } /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param parameters Parameters supplied to the Dismiss Alert 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 alert for the scope by alert ID on successful completion of {@link Mono}. + * @return an individual alert along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String alertId) { - return getWithResponseAsync(scope, alertId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> dismissWithResponseAsync(String scope, String alertId, + DismissAlertPayload parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.dismiss(this.client.getEndpoint(), this.client.getApiVersion(), scope, + alertId, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to the Dismiss Alert 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 alert for the scope by alert ID along with {@link Response}. + * @return an individual alert on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String alertId, Context context) { - return getWithResponseAsync(scope, alertId, context).block(); + private Mono dismissAsync(String scope, String alertId, DismissAlertPayload parameters) { + return dismissWithResponseAsync(scope, alertId, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param parameters Parameters supplied to the Dismiss Alert operation. + * @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 alert for the scope by alert ID. + * @return an individual alert along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner get(String scope, String alertId) { - return getWithResponse(scope, alertId, Context.NONE).getValue(); + public Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.dismissSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, alertId, contentType, + accept, parameters, context); } /** * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. * @param parameters Parameters supplied to the Dismiss Alert 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 an individual alert along with {@link Response} on successful completion of {@link Mono}. + * @return an individual alert. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> dismissWithResponseAsync(String scope, String alertId, - DismissAlertPayload parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (alertId == null) { - return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.dismiss(this.client.getEndpoint(), this.client.getApiVersion(), scope, - alertId, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public AlertInner dismiss(String scope, String alertId, DismissAlertPayload parameters) { + return dismissWithResponse(scope, alertId, parameters, Context.NONE).getValue(); } /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -454,40 +289,22 @@ private Mono> dismissWithResponseAsync(String scope, String * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert operation. - * @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 an individual alert along with {@link Response} on successful completion of {@link Mono}. + * @return result of alerts along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> dismissWithResponseAsync(String scope, String alertId, - DismissAlertPayload parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (alertId == null) { - return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> listWithResponseAsync(String scope) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.dismiss(this.client.getEndpoint(), this.client.getApiVersion(), scope, alertId, parameters, - accept, context); + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -500,20 +317,18 @@ private Mono> dismissWithResponseAsync(String scope, String * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert 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 an individual alert on successful completion of {@link Mono}. + * @return result of alerts on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono dismissAsync(String scope, String alertId, DismissAlertPayload parameters) { - return dismissWithResponseAsync(scope, alertId, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono listAsync(String scope) { + return listWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -526,22 +341,20 @@ private Mono dismissAsync(String scope, String alertId, DismissAlert * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert operation. * @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 an individual alert along with {@link Response}. + * @return result of alerts along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, - Context context) { - return dismissWithResponseAsync(scope, alertId, parameters, context).block(); + public Response listWithResponse(String scope, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); } /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -554,16 +367,14 @@ public Response dismissWithResponse(String scope, String alertId, Di * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert 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 an individual alert. + * @return result of alerts. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner dismiss(String scope, String alertId, DismissAlertPayload parameters) { - return dismissWithResponse(scope, alertId, parameters, Context.NONE).getValue(); + public AlertsResultInner list(String scope) { + return listWithResponse(scope, Context.NONE).getValue(); } /** @@ -581,18 +392,6 @@ public AlertInner dismiss(String scope, String alertId, DismissAlertPayload para @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listExternalWithResponseAsync( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listExternal(this.client.getEndpoint(), this.client.getApiVersion(), @@ -600,40 +399,6 @@ private Mono> listExternalWithResponseAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the Alerts for external cloud provider type defined. - * - * @param externalCloudProviderType The external cloud provider type associated with dimension/query operations. - * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or - * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listExternalWithResponseAsync( - ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listExternal(this.client.getEndpoint(), this.client.getApiVersion(), externalCloudProviderType, - externalCloudProviderId, accept, context); - } - /** * Lists the Alerts for external cloud provider type defined. * @@ -669,7 +434,9 @@ private Mono listExternalAsync(ExternalCloudProviderType exte @ServiceMethod(returns = ReturnType.SINGLE) public Response listExternalWithResponse(ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, Context context) { - return listExternalWithResponseAsync(externalCloudProviderType, externalCloudProviderId, context).block(); + final String accept = "application/json"; + return service.listExternalSync(this.client.getEndpoint(), this.client.getApiVersion(), + externalCloudProviderType, externalCloudProviderId, accept, context); } /** diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsImpl.java index b0209c0bd387..bf28008eb901 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -30,33 +30,10 @@ public AlertsImpl(AlertsClient innerClient, this.serviceManager = serviceManager; } - public Response listWithResponse(String scope, Context context) { - Response inner = this.serviceClient().listWithResponse(scope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertsResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AlertsResult list(String scope) { - AlertsResultInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new AlertsResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String scope, String alertId, Context context) { Response inner = this.serviceClient().getWithResponse(scope, alertId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertImpl(inner.getValue(), this.manager())); } public Alert get(String scope, String alertId) { @@ -71,18 +48,29 @@ public Alert get(String scope, String alertId) { public Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, Context context) { Response inner = this.serviceClient().dismissWithResponse(scope, alertId, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertImpl(inner.getValue(), this.manager())); + } + + public Alert dismiss(String scope, String alertId, DismissAlertPayload parameters) { + AlertInner inner = this.serviceClient().dismiss(scope, alertId, parameters); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertImpl(inner.getValue(), this.manager())); + return new AlertImpl(inner, this.manager()); } else { return null; } } - public Alert dismiss(String scope, String alertId, DismissAlertPayload parameters) { - AlertInner inner = this.serviceClient().dismiss(scope, alertId, parameters); + public Response listWithResponse(String scope, Context context) { + Response inner = this.serviceClient().listWithResponse(scope, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertsResultImpl(inner.getValue(), this.manager())); + } + + public AlertsResult list(String scope) { + AlertsResultInner inner = this.serviceClient().list(scope); if (inner != null) { - return new AlertImpl(inner, this.manager()); + return new AlertsResultImpl(inner, this.manager()); } else { return null; } @@ -92,12 +80,8 @@ public Response listExternalWithResponse(ExternalCloudProviderType String externalCloudProviderId, Context context) { Response inner = this.serviceClient() .listExternalWithResponse(externalCloudProviderType, externalCloudProviderId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertsResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertsResultImpl(inner.getValue(), this.manager())); } public AlertsResult listExternal(ExternalCloudProviderType externalCloudProviderType, diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsResultImpl.java index 8242c3ad2c1d..779c57424d0e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsResultImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationModelImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationModelImpl.java index 66a2cc9f9747..daba13fd3a15 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationModelImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationModelImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.BenefitRecommendationModelInner; import com.azure.resourcemanager.costmanagement.models.BenefitKind; import com.azure.resourcemanager.costmanagement.models.BenefitRecommendationModel; @@ -36,6 +37,10 @@ public BenefitKind kind() { return this.innerModel().kind(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public BenefitRecommendationProperties properties() { return this.innerModel().properties(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsClientImpl.java index 6962cab69c04..dc1134aabb85 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.costmanagement.fluent.BenefitRecommendationsClient; import com.azure.resourcemanager.costmanagement.fluent.models.BenefitRecommendationModelInner; -import com.azure.resourcemanager.costmanagement.models.BenefitRecommendationsListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.BenefitRecommendationsListResult; import reactor.core.publisher.Mono; /** @@ -42,33 +42,43 @@ public final class BenefitRecommendationsClientImpl implements BenefitRecommenda /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of BenefitRecommendationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - BenefitRecommendationsClientImpl(CostManagementClientImpl client) { + BenefitRecommendationsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(BenefitRecommendationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientBenefitRecommendations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for CostManagementManagementClientBenefitRecommendations to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientBenefitRecommendations") public interface BenefitRecommendationsService { @Headers({ "Content-Type: application/json" }) @Get("/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("$expand") String expand, + @PathParam(value = "billingScope", encoded = true) String billingScope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("$expand") String expand, @PathParam(value = "billingScope", encoded = true) String billingScope, @HeaderParam("Accept") String accept, Context context); @@ -77,7 +87,15 @@ Mono> list(@HostParam("$host") String @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -106,17 +124,10 @@ Mono> listNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String billingScope, String filter, String orderby, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingScope == null) { - return Mono.error(new IllegalArgumentException("Parameter billingScope is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), filter, orderby, expand, - this.client.getApiVersion(), billingScope, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, + orderby, expand, billingScope, 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())); @@ -138,30 +149,16 @@ private Mono> listSinglePageAsync * @param orderby May be used to order the recommendations by: properties/armSkuName. For the savings plan, the * results are in order by default. There is no need to use this clause. * @param expand May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing benefit recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of listing benefit recommendations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String billingScope, String filter, - String orderby, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingScope == null) { - return Mono.error(new IllegalArgumentException("Parameter billingScope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, orderby, expand, this.client.getApiVersion(), billingScope, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String billingScope, String filter, String orderby, + String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(billingScope, filter, orderby, expand), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -173,21 +170,16 @@ private Mono> listSinglePageAsync * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for enterprise agreement scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billing * profile scope. - * @param filter Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', - * 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', - * 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] - * and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. - * @param orderby May be used to order the recommendations by: properties/armSkuName. For the savings plan, the - * results are in order by default. There is no need to use this clause. - * @param expand May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of listing benefit recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String billingScope, String filter, String orderby, - String expand) { + private PagedFlux listAsync(String billingScope) { + final String filter = null; + final String orderby = null; + final String expand = null; return new PagedFlux<>(() -> listSinglePageAsync(billingScope, filter, orderby, expand), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -201,18 +193,26 @@ private PagedFlux listAsync(String billingScope * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for enterprise agreement scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billing * profile scope. + * @param filter Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', + * 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', + * 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] + * and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. + * @param orderby May be used to order the recommendations by: properties/armSkuName. For the savings plan, the + * results are in order by default. There is no need to use this clause. + * @param expand May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing benefit recommendations as paginated response with {@link PagedFlux}. + * @return result of listing benefit recommendations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String billingScope) { - final String filter = null; - final String orderby = null; - final String expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(billingScope, filter, orderby, expand), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String billingScope, String filter, + String orderby, String expand) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), filter, orderby, expand, billingScope, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -235,13 +235,16 @@ private PagedFlux listAsync(String billingScope * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing benefit recommendations as paginated response with {@link PagedFlux}. + * @return result of listing benefit recommendations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String billingScope, String filter, String orderby, - String expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(billingScope, filter, orderby, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String billingScope, String filter, + String orderby, String expand, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), filter, orderby, expand, billingScope, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -263,7 +266,8 @@ public PagedIterable list(String billingScope) final String filter = null; final String orderby = null; final String expand = null; - return new PagedIterable<>(listAsync(billingScope, filter, orderby, expand)); + return new PagedIterable<>(() -> listSinglePage(billingScope, filter, orderby, expand), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -291,7 +295,8 @@ public PagedIterable list(String billingScope) @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String billingScope, String filter, String orderby, String expand, Context context) { - return new PagedIterable<>(listAsync(billingScope, filter, orderby, expand, context)); + return new PagedIterable<>(() -> listSinglePage(billingScope, filter, orderby, expand, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -306,13 +311,6 @@ public PagedIterable list(String billingScope, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -320,6 +318,24 @@ private Mono> listNextSinglePageA .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing benefit recommendations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -328,23 +344,14 @@ private Mono> listNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing benefit recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of listing benefit recommendations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsImpl.java index 1e1a8596a0c2..764f13a96f75 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesClientImpl.java index 602e906bfee6..e63b0fd3578d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient; import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummaryInner; -import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.BenefitUtilizationSummariesListResult; import com.azure.resourcemanager.costmanagement.models.GrainParameter; import reactor.core.publisher.Mono; @@ -43,62 +43,103 @@ public final class BenefitUtilizationSummariesClientImpl implements BenefitUtili /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of BenefitUtilizationSummariesClientImpl. * * @param client the instance of the service client containing this operation class. */ - BenefitUtilizationSummariesClientImpl(CostManagementClientImpl client) { + BenefitUtilizationSummariesClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(BenefitUtilizationSummariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientBenefitUtilizationSummaries to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for CostManagementManagementClientBenefitUtilizationSummaries to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientBenefitUtilizationSummaries") public interface BenefitUtilizationSummariesService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingAccountId( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, @QueryParam("grainParameter") GrainParameter grainParameter, @QueryParam("filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByBillingAccountIdSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountId") String billingAccountId, + @QueryParam("grainParameter") GrainParameter grainParameter, @QueryParam("filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfileId( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, @PathParam("billingProfileId") String billingProfileId, @QueryParam("grainParameter") GrainParameter grainParameter, @QueryParam("filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByBillingProfileIdSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, + @QueryParam("grainParameter") GrainParameter grainParameter, @QueryParam("filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySavingsPlanOrder( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @QueryParam("grainParameter") GrainParameter grainParameter, + @PathParam("savingsPlanOrderId") String savingsPlanOrderId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySavingsPlanOrderSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("grainParameter") GrainParameter grainParameter, @PathParam("savingsPlanOrderId") String savingsPlanOrderId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @Get("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySavingsPlanId(@HostParam("$host") String endpoint, + Mono> listBySavingsPlanId( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @QueryParam("grainParameter") GrainParameter grainParameter, + @PathParam("savingsPlanOrderId") String savingsPlanOrderId, + @PathParam("savingsPlanId") String savingsPlanId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySavingsPlanIdSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("grainParameter") GrainParameter grainParameter, @PathParam("savingsPlanOrderId") String savingsPlanOrderId, @@ -109,7 +150,15 @@ Mono> listBySavingsPlanId(@HostP @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingAccountIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByBillingAccountIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -117,7 +166,15 @@ Mono> listByBillingAccountIdNext @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfileIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByBillingProfileIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -125,7 +182,15 @@ Mono> listByBillingProfileIdNext @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySavingsPlanOrderNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySavingsPlanOrderNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -133,7 +198,15 @@ Mono> listBySavingsPlanOrderNext @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySavingsPlanIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySavingsPlanIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -141,7 +214,7 @@ Mono> listBySavingsPlanIdNext( * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,14 +226,6 @@ Mono> listBySavingsPlanIdNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountIdSinglePageAsync(String billingAccountId, GrainParameter grainParameter, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByBillingAccountId(this.client.getEndpoint(), @@ -174,51 +239,35 @@ Mono> listBySavingsPlanIdNext( * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. - * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountIdSinglePageAsync( - String billingAccountId, GrainParameter grainParameter, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountId(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, - grainParameter, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountIdAsync(String billingAccountId, + GrainParameter grainParameter, String filter) { + return new PagedFlux<>(() -> listByBillingAccountIdSinglePageAsync(billingAccountId, grainParameter, filter), + nextLink -> listByBillingAccountIdNextSinglePageAsync(nextLink)); } /** * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param grainParameter Grain. - * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. + * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of benefit utilization summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountIdAsync(String billingAccountId, - GrainParameter grainParameter, String filter) { + private PagedFlux listByBillingAccountIdAsync(String billingAccountId) { + final GrainParameter grainParameter = null; + final String filter = null; return new PagedFlux<>(() -> listByBillingAccountIdSinglePageAsync(billingAccountId, grainParameter, filter), nextLink -> listByBillingAccountIdNextSinglePageAsync(nextLink)); } @@ -227,46 +276,54 @@ private PagedFlux listByBillingAccountIdAsync(St * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. + * @param grainParameter Grain. + * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountIdAsync(String billingAccountId) { - final GrainParameter grainParameter = null; - final String filter = null; - return new PagedFlux<>(() -> listByBillingAccountIdSinglePageAsync(billingAccountId, grainParameter, filter), - nextLink -> listByBillingAccountIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByBillingAccountIdSinglePage(String billingAccountId, + GrainParameter grainParameter, String filter) { + final String accept = "application/json"; + Response res + = service.listByBillingAccountIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, grainParameter, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountIdAsync(String billingAccountId, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByBillingAccountIdSinglePage(String billingAccountId, GrainParameter grainParameter, String filter, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountIdSinglePageAsync(billingAccountId, grainParameter, filter, context), - nextLink -> listByBillingAccountIdNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listByBillingAccountIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, grainParameter, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -276,14 +333,15 @@ private PagedFlux listByBillingAccountIdAsync(St public PagedIterable listByBillingAccountId(String billingAccountId) { final GrainParameter grainParameter = null; final String filter = null; - return new PagedIterable<>(listByBillingAccountIdAsync(billingAccountId, grainParameter, filter)); + return new PagedIterable<>(() -> listByBillingAccountIdSinglePage(billingAccountId, grainParameter, filter), + nextLink -> listByBillingAccountIdNextSinglePage(nextLink)); } /** * Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' * and 'Monthly'. * - * @param billingAccountId Billing account ID. + * @param billingAccountId BillingAccount ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @param context The context to associate with this operation. @@ -295,14 +353,16 @@ public PagedIterable listByBillingAccountId(Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingAccountId(String billingAccountId, GrainParameter grainParameter, String filter, Context context) { - return new PagedIterable<>(listByBillingAccountIdAsync(billingAccountId, grainParameter, filter, context)); + return new PagedIterable<>( + () -> listByBillingAccountIdSinglePage(billingAccountId, grainParameter, filter, context), + nextLink -> listByBillingAccountIdNextSinglePage(nextLink, context)); } /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -314,18 +374,6 @@ public PagedIterable listByBillingAccountId(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileIdSinglePageAsync( String billingAccountId, String billingProfileId, GrainParameter grainParameter, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - if (billingProfileId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -339,47 +387,8 @@ private Mono> listByBillingProfile /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. - * @param grainParameter Grain. - * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. - * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileIdSinglePageAsync( - String billingAccountId, String billingProfileId, GrainParameter grainParameter, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - if (billingProfileId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileId(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, - billingProfileId, grainParameter, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. - * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -398,8 +407,8 @@ private PagedFlux listByBillingProfileIdAsync(St /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -418,28 +427,55 @@ private PagedFlux listByBillingProfileIdAsync(St /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param grainParameter Grain. + * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. + * @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 list of benefit utilization summaries along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByBillingProfileIdSinglePage(String billingAccountId, + String billingProfileId, GrainParameter grainParameter, String filter) { + final String accept = "application/json"; + Response res + = service.listByBillingProfileIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, grainParameter, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileIdAsync(String billingAccountId, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByBillingProfileIdSinglePage(String billingAccountId, String billingProfileId, GrainParameter grainParameter, String filter, Context context) { - return new PagedFlux<>(() -> listByBillingProfileIdSinglePageAsync(billingAccountId, billingProfileId, - grainParameter, filter, context), nextLink -> listByBillingProfileIdNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listByBillingProfileIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, grainParameter, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -451,14 +487,15 @@ public PagedIterable listByBillingProfileId(Stri final GrainParameter grainParameter = null; final String filter = null; return new PagedIterable<>( - listByBillingProfileIdAsync(billingAccountId, billingProfileId, grainParameter, filter)); + () -> listByBillingProfileIdSinglePage(billingAccountId, billingProfileId, grainParameter, filter), + nextLink -> listByBillingProfileIdNextSinglePage(nextLink)); } /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @param context The context to associate with this operation. @@ -471,7 +508,8 @@ public PagedIterable listByBillingProfileId(Stri public PagedIterable listByBillingProfileId(String billingAccountId, String billingProfileId, GrainParameter grainParameter, String filter, Context context) { return new PagedIterable<>( - listByBillingProfileIdAsync(billingAccountId, billingProfileId, grainParameter, filter, context)); + () -> listByBillingProfileIdSinglePage(billingAccountId, billingProfileId, grainParameter, filter, context), + nextLink -> listByBillingProfileIdNextSinglePage(nextLink, context)); } /** @@ -489,14 +527,6 @@ public PagedIterable listByBillingProfileId(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySavingsPlanOrderSinglePageAsync(String savingsPlanOrderId, String filter, GrainParameter grainParameter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (savingsPlanOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter savingsPlanOrderId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listBySavingsPlanOrder(this.client.getEndpoint(), @@ -512,47 +542,31 @@ public PagedIterable listByBillingProfileId(Stri * @param savingsPlanOrderId Savings plan order ID. * @param filter Supports filtering by properties/usageDate. * @param grainParameter Grain. - * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySavingsPlanOrderSinglePageAsync( - String savingsPlanOrderId, String filter, GrainParameter grainParameter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (savingsPlanOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter savingsPlanOrderId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySavingsPlanOrder(this.client.getEndpoint(), this.client.getApiVersion(), filter, grainParameter, - savingsPlanOrderId, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySavingsPlanOrderAsync(String savingsPlanOrderId, + String filter, GrainParameter grainParameter) { + return new PagedFlux<>(() -> listBySavingsPlanOrderSinglePageAsync(savingsPlanOrderId, filter, grainParameter), + nextLink -> listBySavingsPlanOrderNextSinglePageAsync(nextLink)); } /** * Lists the savings plan utilization summaries for daily or monthly grain. * * @param savingsPlanOrderId Savings plan order ID. - * @param filter Supports filtering by properties/usageDate. - * @param grainParameter Grain. * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySavingsPlanOrderAsync(String savingsPlanOrderId, - String filter, GrainParameter grainParameter) { + private PagedFlux listBySavingsPlanOrderAsync(String savingsPlanOrderId) { + final String filter = null; + final GrainParameter grainParameter = null; return new PagedFlux<>(() -> listBySavingsPlanOrderSinglePageAsync(savingsPlanOrderId, filter, grainParameter), nextLink -> listBySavingsPlanOrderNextSinglePageAsync(nextLink)); } @@ -561,17 +575,22 @@ private PagedFlux listBySavingsPlanOrderAsync(St * Lists the savings plan utilization summaries for daily or monthly grain. * * @param savingsPlanOrderId Savings plan order ID. + * @param filter Supports filtering by properties/usageDate. + * @param grainParameter Grain. * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySavingsPlanOrderAsync(String savingsPlanOrderId) { - final String filter = null; - final GrainParameter grainParameter = null; - return new PagedFlux<>(() -> listBySavingsPlanOrderSinglePageAsync(savingsPlanOrderId, filter, grainParameter), - nextLink -> listBySavingsPlanOrderNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySavingsPlanOrderSinglePage(String savingsPlanOrderId, + String filter, GrainParameter grainParameter) { + final String accept = "application/json"; + Response res + = service.listBySavingsPlanOrderSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + grainParameter, savingsPlanOrderId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -584,14 +603,17 @@ private PagedFlux listBySavingsPlanOrderAsync(St * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySavingsPlanOrderAsync(String savingsPlanOrderId, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySavingsPlanOrderSinglePage(String savingsPlanOrderId, String filter, GrainParameter grainParameter, Context context) { - return new PagedFlux<>( - () -> listBySavingsPlanOrderSinglePageAsync(savingsPlanOrderId, filter, grainParameter, context), - nextLink -> listBySavingsPlanOrderNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listBySavingsPlanOrderSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + grainParameter, savingsPlanOrderId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -607,7 +629,8 @@ private PagedFlux listBySavingsPlanOrderAsync(St public PagedIterable listBySavingsPlanOrder(String savingsPlanOrderId) { final String filter = null; final GrainParameter grainParameter = null; - return new PagedIterable<>(listBySavingsPlanOrderAsync(savingsPlanOrderId, filter, grainParameter)); + return new PagedIterable<>(() -> listBySavingsPlanOrderSinglePage(savingsPlanOrderId, filter, grainParameter), + nextLink -> listBySavingsPlanOrderNextSinglePage(nextLink)); } /** @@ -625,7 +648,9 @@ public PagedIterable listBySavingsPlanOrder(Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySavingsPlanOrder(String savingsPlanOrderId, String filter, GrainParameter grainParameter, Context context) { - return new PagedIterable<>(listBySavingsPlanOrderAsync(savingsPlanOrderId, filter, grainParameter, context)); + return new PagedIterable<>( + () -> listBySavingsPlanOrderSinglePage(savingsPlanOrderId, filter, grainParameter, context), + nextLink -> listBySavingsPlanOrderNextSinglePage(nextLink, context)); } /** @@ -644,17 +669,6 @@ public PagedIterable listBySavingsPlanOrder(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySavingsPlanIdSinglePageAsync( String savingsPlanOrderId, String savingsPlanId, String filter, GrainParameter grainParameter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (savingsPlanOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter savingsPlanOrderId is required and cannot be null.")); - } - if (savingsPlanId == null) { - return Mono.error(new IllegalArgumentException("Parameter savingsPlanId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listBySavingsPlanId(this.client.getEndpoint(), this.client.getApiVersion(), @@ -671,35 +685,17 @@ private Mono> listBySavingsPlanIdS * @param savingsPlanId Savings plan ID. * @param filter Supports filtering by properties/usageDate. * @param grainParameter Grain. - * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySavingsPlanIdSinglePageAsync( - String savingsPlanOrderId, String savingsPlanId, String filter, GrainParameter grainParameter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (savingsPlanOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter savingsPlanOrderId is required and cannot be null.")); - } - if (savingsPlanId == null) { - return Mono.error(new IllegalArgumentException("Parameter savingsPlanId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySavingsPlanId(this.client.getEndpoint(), this.client.getApiVersion(), filter, grainParameter, - savingsPlanOrderId, savingsPlanId, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySavingsPlanIdAsync(String savingsPlanOrderId, + String savingsPlanId, String filter, GrainParameter grainParameter) { + return new PagedFlux<>( + () -> listBySavingsPlanIdSinglePageAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter), + nextLink -> listBySavingsPlanIdNextSinglePageAsync(nextLink)); } /** @@ -707,8 +703,6 @@ private Mono> listBySavingsPlanIdS * * @param savingsPlanOrderId Savings plan order ID. * @param savingsPlanId Savings plan ID. - * @param filter Supports filtering by properties/usageDate. - * @param grainParameter Grain. * @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. @@ -716,7 +710,9 @@ private Mono> listBySavingsPlanIdS */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listBySavingsPlanIdAsync(String savingsPlanOrderId, - String savingsPlanId, String filter, GrainParameter grainParameter) { + String savingsPlanId) { + final String filter = null; + final GrainParameter grainParameter = null; return new PagedFlux<>( () -> listBySavingsPlanIdSinglePageAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter), nextLink -> listBySavingsPlanIdNextSinglePageAsync(nextLink)); @@ -727,19 +723,22 @@ private PagedFlux listBySavingsPlanIdAsync(Strin * * @param savingsPlanOrderId Savings plan order ID. * @param savingsPlanId Savings plan ID. + * @param filter Supports filtering by properties/usageDate. + * @param grainParameter Grain. * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySavingsPlanIdAsync(String savingsPlanOrderId, - String savingsPlanId) { - final String filter = null; - final GrainParameter grainParameter = null; - return new PagedFlux<>( - () -> listBySavingsPlanIdSinglePageAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter), - nextLink -> listBySavingsPlanIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySavingsPlanIdSinglePage(String savingsPlanOrderId, + String savingsPlanId, String filter, GrainParameter grainParameter) { + final String accept = "application/json"; + Response res + = service.listBySavingsPlanIdSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + grainParameter, savingsPlanOrderId, savingsPlanId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -753,13 +752,16 @@ private PagedFlux listBySavingsPlanIdAsync(Strin * @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 list of benefit utilization summaries as paginated response with {@link PagedFlux}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySavingsPlanIdAsync(String savingsPlanOrderId, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySavingsPlanIdSinglePage(String savingsPlanOrderId, String savingsPlanId, String filter, GrainParameter grainParameter, Context context) { - return new PagedFlux<>(() -> listBySavingsPlanIdSinglePageAsync(savingsPlanOrderId, savingsPlanId, filter, - grainParameter, context), nextLink -> listBySavingsPlanIdNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listBySavingsPlanIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), filter, grainParameter, savingsPlanOrderId, savingsPlanId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -777,7 +779,9 @@ public PagedIterable listBySavingsPlanId(String String savingsPlanId) { final String filter = null; final GrainParameter grainParameter = null; - return new PagedIterable<>(listBySavingsPlanIdAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter)); + return new PagedIterable<>( + () -> listBySavingsPlanIdSinglePage(savingsPlanOrderId, savingsPlanId, filter, grainParameter), + nextLink -> listBySavingsPlanIdNextSinglePage(nextLink)); } /** @@ -797,7 +801,8 @@ public PagedIterable listBySavingsPlanId(String public PagedIterable listBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, String filter, GrainParameter grainParameter, Context context) { return new PagedIterable<>( - listBySavingsPlanIdAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter, context)); + () -> listBySavingsPlanIdSinglePage(savingsPlanOrderId, savingsPlanId, filter, grainParameter, context), + nextLink -> listBySavingsPlanIdNextSinglePage(nextLink, context)); } /** @@ -813,13 +818,6 @@ public PagedIterable listBySavingsPlanId(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountIdNextSinglePageAsync(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( @@ -829,6 +827,24 @@ public PagedIterable listBySavingsPlanId(String .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. + * @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 list of benefit utilization summaries along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByBillingAccountIdNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByBillingAccountIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -837,24 +853,16 @@ public PagedIterable listBySavingsPlanId(String * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByBillingAccountIdNextSinglePageAsync(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.")); - } + private PagedResponse listByBillingAccountIdNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByBillingAccountIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByBillingAccountIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -870,13 +878,6 @@ public PagedIterable listBySavingsPlanId(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileIdNextSinglePageAsync(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( @@ -886,6 +887,24 @@ public PagedIterable listBySavingsPlanId(String .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. + * @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 list of benefit utilization summaries along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByBillingProfileIdNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByBillingProfileIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -894,24 +913,16 @@ public PagedIterable listBySavingsPlanId(String * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByBillingProfileIdNextSinglePageAsync(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.")); - } + private PagedResponse listByBillingProfileIdNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByBillingProfileIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByBillingProfileIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -927,13 +938,6 @@ public PagedIterable listBySavingsPlanId(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySavingsPlanOrderNextSinglePageAsync(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( @@ -943,6 +947,24 @@ public PagedIterable listBySavingsPlanId(String .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. + * @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 list of benefit utilization summaries along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySavingsPlanOrderNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySavingsPlanOrderNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -951,24 +973,16 @@ public PagedIterable listBySavingsPlanId(String * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySavingsPlanOrderNextSinglePageAsync(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.")); - } + private PagedResponse listBySavingsPlanOrderNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySavingsPlanOrderNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySavingsPlanOrderNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -984,13 +998,6 @@ public PagedIterable listBySavingsPlanId(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySavingsPlanIdNextSinglePageAsync(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( @@ -1000,6 +1007,24 @@ public PagedIterable listBySavingsPlanId(String .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. + * @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 list of benefit utilization summaries along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySavingsPlanIdNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySavingsPlanIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1008,23 +1033,15 @@ public PagedIterable listBySavingsPlanId(String * @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 list of benefit utilization summaries along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of benefit utilization summaries along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySavingsPlanIdNextSinglePageAsync(String nextLink, + private PagedResponse listBySavingsPlanIdNextSinglePage(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.listBySavingsPlanIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySavingsPlanIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesImpl.java index f44046a30f41..5dc1aad9f721 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesOperationStatusImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesOperationStatusImpl.java new file mode 100644 index 000000000000..0c37dc14318d --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesOperationStatusImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner; +import com.azure.resourcemanager.costmanagement.models.AsyncOperationStatusProperties; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; + +public final class BenefitUtilizationSummariesOperationStatusImpl + implements BenefitUtilizationSummariesOperationStatus { + private BenefitUtilizationSummariesOperationStatusInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + BenefitUtilizationSummariesOperationStatusImpl(BenefitUtilizationSummariesOperationStatusInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public BenefitUtilizationSummariesRequest input() { + return this.innerModel().input(); + } + + public OperationStatusType status() { + return this.innerModel().status(); + } + + public AsyncOperationStatusProperties properties() { + return this.innerModel().properties(); + } + + public BenefitUtilizationSummariesOperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummaryImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummaryImpl.java index 22e6ee055f65..74838be52acd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummaryImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummaryImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummaryInner; import com.azure.resourcemanager.costmanagement.models.BenefitKind; import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummary; @@ -35,6 +36,10 @@ public BenefitKind kind() { return this.innerModel().kind(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public BenefitUtilizationSummaryInner innerModel() { return this.innerObject; } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetImpl.java new file mode 100644 index 000000000000..6efdd7446ba7 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; +import com.azure.resourcemanager.costmanagement.models.Budget; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CurrentSpend; +import com.azure.resourcemanager.costmanagement.models.ForecastSpend; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.util.Collections; +import java.util.Map; + +public final class BudgetImpl implements Budget, Budget.Definition, Budget.Update { + private BudgetInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String eTag() { + return this.innerModel().eTag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public CategoryType category() { + return this.innerModel().category(); + } + + public Double amount() { + return this.innerModel().amount(); + } + + public TimeGrainType timeGrain() { + return this.innerModel().timeGrain(); + } + + public BudgetTimePeriod timePeriod() { + return this.innerModel().timePeriod(); + } + + public BudgetFilter filter() { + return this.innerModel().filter(); + } + + public CurrentSpend currentSpend() { + return this.innerModel().currentSpend(); + } + + public Map notifications() { + Map inner = this.innerModel().notifications(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ForecastSpend forecastSpend() { + return this.innerModel().forecastSpend(); + } + + public BudgetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } + + private String scope; + + private String budgetName; + + public BudgetImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + + public Budget create() { + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Budget create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), context) + .getValue(); + return this; + } + + BudgetImpl(String name, com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerObject = new BudgetInner(); + this.serviceManager = serviceManager; + this.budgetName = name; + } + + public BudgetImpl update() { + return this; + } + + public Budget apply() { + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Budget apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), context) + .getValue(); + return this; + } + + BudgetImpl(BudgetInner innerObject, com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "scope"); + this.budgetName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "budgetName"); + } + + public Budget refresh() { + this.innerObject + = serviceManager.serviceClient().getBudgets().getWithResponse(scope, budgetName, Context.NONE).getValue(); + return this; + } + + public Budget refresh(Context context) { + this.innerObject + = serviceManager.serviceClient().getBudgets().getWithResponse(scope, budgetName, context).getValue(); + return this; + } + + public BudgetImpl withETag(String eTag) { + this.innerModel().withETag(eTag); + return this; + } + + public BudgetImpl withCategory(CategoryType category) { + this.innerModel().withCategory(category); + return this; + } + + public BudgetImpl withAmount(Double amount) { + this.innerModel().withAmount(amount); + return this; + } + + public BudgetImpl withTimeGrain(TimeGrainType timeGrain) { + this.innerModel().withTimeGrain(timeGrain); + return this; + } + + public BudgetImpl withTimePeriod(BudgetTimePeriod timePeriod) { + this.innerModel().withTimePeriod(timePeriod); + return this; + } + + public BudgetImpl withFilter(BudgetFilter filter) { + this.innerModel().withFilter(filter); + return this; + } + + public BudgetImpl withNotifications(Map notifications) { + this.innerModel().withNotifications(notifications); + return this; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsClientImpl.java new file mode 100644 index 000000000000..6520be556927 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsClientImpl.java @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.costmanagement.fluent.BudgetsClient; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; +import com.azure.resourcemanager.costmanagement.implementation.models.BudgetsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BudgetsClient. + */ +public final class BudgetsClientImpl implements BudgetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BudgetsService service; + + /** + * The service client containing this operation class. + */ + private final CostManagementManagementClientImpl client; + + /** + * Initializes an instance of BudgetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BudgetsClientImpl(CostManagementManagementClientImpl client) { + this.service = RestProxy.create(BudgetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CostManagementManagementClientBudgets to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientBudgets") + public interface BudgetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("budgetName") String budgetName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("budgetName") String budgetName, @HeaderParam("Accept") String accept, Context context); + + @Put("/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("budgetName") String budgetName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BudgetInner parameters, + Context context); + + @Put("/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("budgetName") String budgetName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BudgetInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("budgetName") String budgetName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam(value = "scope", encoded = true) String scope, @PathParam("budgetName") String budgetName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/budgets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/budgets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 budget for the scope by budget name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String budgetName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, + budgetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 budget for the scope by budget name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String budgetName) { + return getWithResponseAsync(scope, budgetName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 budget for the scope by budget name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String budgetName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, budgetName, accept, + context); + } + + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 budget for the scope by budget name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BudgetInner get(String scope, String budgetName) { + return getWithResponse(scope, budgetName, Context.NONE).getValue(); + } + + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of + * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put + * operation. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget 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 budget resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String scope, String budgetName, + BudgetInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + scope, budgetName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of + * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put + * operation. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget 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 budget resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String scope, String budgetName, BudgetInner parameters) { + return createOrUpdateWithResponseAsync(scope, budgetName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of + * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put + * operation. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget operation. + * @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 budget resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String scope, String budgetName, BudgetInner parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, budgetName, + contentType, accept, parameters, context); + } + + /** + * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of + * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put + * operation. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @param parameters Parameters supplied to the Create Budget 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 budget resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner parameters) { + return createOrUpdateWithResponse(scope, budgetName, parameters, Context.NONE).getValue(); + } + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 scope, String budgetName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), scope, + budgetName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 scope, String budgetName) { + return deleteWithResponseAsync(scope, budgetName).flatMap(ignored -> Mono.empty()); + } + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String scope, String budgetName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, budgetName, context); + } + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 scope, String budgetName) { + deleteWithResponse(scope, budgetName, Context.NONE); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String scope, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, filter, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String scope, String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + scope, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String scope, String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope) { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(scope, filter), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope, String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(scope, filter, context), + nextLink -> listNextSinglePage(nextLink, 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 result of listing budgets along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsImpl.java new file mode 100644 index 000000000000..22b4d1165573 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.http.rest.PagedIterable; +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.costmanagement.fluent.BudgetsClient; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; +import com.azure.resourcemanager.costmanagement.models.Budget; +import com.azure.resourcemanager.costmanagement.models.Budgets; + +public final class BudgetsImpl implements Budgets { + private static final ClientLogger LOGGER = new ClientLogger(BudgetsImpl.class); + + private final BudgetsClient innerClient; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + public BudgetsImpl(BudgetsClient innerClient, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String scope, String budgetName, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, budgetName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BudgetImpl(inner.getValue(), this.manager())); + } + + public Budget get(String scope, String budgetName) { + BudgetInner inner = this.serviceClient().get(scope, budgetName); + if (inner != null) { + return new BudgetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String scope, String budgetName, Context context) { + return this.serviceClient().deleteWithResponse(scope, budgetName, context); + } + + public void deleteByResourceGroup(String scope, String budgetName) { + this.serviceClient().delete(scope, budgetName); + } + + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); + } + + public PagedIterable list(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(scope, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); + } + + public Budget getById(String id) { + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "scope"); + if (scope == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "budgetName"); + if (budgetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + } + return this.getWithResponse(scope, budgetName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "scope"); + if (scope == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "budgetName"); + if (budgetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + } + return this.getWithResponse(scope, budgetName, context); + } + + public void deleteById(String id) { + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "scope"); + if (scope == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "budgetName"); + if (budgetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + } + this.deleteByResourceGroupWithResponse(scope, budgetName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "scope"); + if (scope == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}", "budgetName"); + if (budgetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + } + return this.deleteByResourceGroupWithResponse(scope, budgetName, context); + } + + private BudgetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } + + public BudgetImpl define(String name) { + return new BudgetImpl(name, this.manager()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CheckNameAvailabilityResponseImpl.java index 9fee92bebe4f..0ea7b0cd658c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CheckNameAvailabilityResponseImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CheckNameAvailabilityResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CommonExportPropertiesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CommonExportPropertiesImpl.java index e6de9980634d..61399fa4e380 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CommonExportPropertiesImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CommonExportPropertiesImpl.java @@ -1,15 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; import com.azure.resourcemanager.costmanagement.fluent.models.CommonExportPropertiesInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportExecutionListResultInner; import com.azure.resourcemanager.costmanagement.models.CommonExportProperties; +import com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; import com.azure.resourcemanager.costmanagement.models.ExportExecutionListResult; +import com.azure.resourcemanager.costmanagement.models.ExportSuspensionContext; import com.azure.resourcemanager.costmanagement.models.FormatType; import java.time.OffsetDateTime; @@ -49,10 +52,26 @@ public Boolean partitionData() { return this.innerModel().partitionData(); } + public DataOverwriteBehaviorType dataOverwriteBehavior() { + return this.innerModel().dataOverwriteBehavior(); + } + + public CompressionModeType compressionMode() { + return this.innerModel().compressionMode(); + } + + public String exportDescription() { + return this.innerModel().exportDescription(); + } + public OffsetDateTime nextRunTimeEstimate() { return this.innerModel().nextRunTimeEstimate(); } + public ExportSuspensionContext systemSuspensionContext() { + return this.innerModel().systemSuspensionContext(); + } + public CommonExportPropertiesInner innerModel() { return this.innerObject; } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleCheckNameAvailabilityResponseImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleCheckNameAvailabilityResponseImpl.java new file mode 100644 index 000000000000..453c1baed2e2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleCheckNameAvailabilityResponseImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse; +import com.azure.resourcemanager.costmanagement.models.Reason; + +public final class CostAllocationRuleCheckNameAvailabilityResponseImpl + implements CostAllocationRuleCheckNameAvailabilityResponse { + private CostAllocationRuleCheckNameAvailabilityResponseInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + CostAllocationRuleCheckNameAvailabilityResponseImpl( + CostAllocationRuleCheckNameAvailabilityResponseInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CostAllocationRuleCheckNameAvailabilityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleDefinitionImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleDefinitionImpl.java new file mode 100644 index 000000000000..f5711b3ea61a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleDefinitionImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDefinition; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties; + +public final class CostAllocationRuleDefinitionImpl implements CostAllocationRuleDefinition { + private CostAllocationRuleDefinitionInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + CostAllocationRuleDefinitionImpl(CostAllocationRuleDefinitionInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager 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 CostAllocationRuleProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public CostAllocationRuleDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesClientImpl.java new file mode 100644 index 000000000000..984ab42ff684 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesClientImpl.java @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.implementation.models.CostAllocationRuleList; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CostAllocationRulesClient. + */ +public final class CostAllocationRulesClientImpl implements CostAllocationRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final CostAllocationRulesService service; + + /** + * The service client containing this operation class. + */ + private final CostManagementManagementClientImpl client; + + /** + * Initializes an instance of CostAllocationRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CostAllocationRulesClientImpl(CostManagementManagementClientImpl client) { + this.service = RestProxy.create(CostAllocationRulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CostManagementManagementClientCostAllocationRules to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientCostAllocationRules") + public interface CostAllocationRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("ruleName") String ruleName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("ruleName") String ruleName, @HeaderParam("Accept") String accept, Context context); + + @Put("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("ruleName") String ruleName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CostAllocationRuleDefinitionInner costAllocationRule, Context context); + + @Put("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("ruleName") String ruleName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CostAllocationRuleDefinitionInner costAllocationRule, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("ruleName") String ruleName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountId") String billingAccountId, @PathParam("ruleName") String ruleName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountId") String billingAccountId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest, + Context context); + + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountId") String billingAccountId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 cost allocation rule by rule name and billing account or enterprise enrollment along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String billingAccountId, + String ruleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, ruleName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 cost allocation rule by rule name and billing account or enterprise enrollment on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String billingAccountId, String ruleName) { + return getWithResponseAsync(billingAccountId, ruleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 cost allocation rule by rule name and billing account or enterprise enrollment along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String billingAccountId, String ruleName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, ruleName, + accept, context); + } + + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 cost allocation rule by rule name and billing account or enterprise enrollment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CostAllocationRuleDefinitionInner get(String billingAccountId, String ruleName) { + return getWithResponse(billingAccountId, ruleName, Context.NONE).getValue(); + } + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String billingAccountId, + String ruleName, CostAllocationRuleDefinitionInner costAllocationRule) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, ruleName, contentType, accept, costAllocationRule, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule) { + return createOrUpdateWithResponseAsync(billingAccountId, ruleName, costAllocationRule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String billingAccountId, + String ruleName, CostAllocationRuleDefinitionInner costAllocationRule, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + ruleName, contentType, accept, costAllocationRule, context); + } + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CostAllocationRuleDefinitionInner createOrUpdate(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule) { + return createOrUpdateWithResponse(billingAccountId, ruleName, costAllocationRule, Context.NONE).getValue(); + } + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 billingAccountId, String ruleName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, ruleName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 billingAccountId, String ruleName) { + return deleteWithResponseAsync(billingAccountId, ruleName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String billingAccountId, String ruleName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, ruleName, + context); + } + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 billingAccountId, String ruleName) { + deleteWithResponse(billingAccountId, ruleName, Context.NONE); + } + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String billingAccountId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, 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 list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String billingAccountId) { + return new PagedFlux<>(() -> listSinglePageAsync(billingAccountId), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String billingAccountId) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String billingAccountId, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String billingAccountId) { + return new PagedIterable<>(() -> listSinglePage(billingAccountId), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String billingAccountId, Context context) { + return new PagedIterable<>(() -> listSinglePage(billingAccountId, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, contentType, accept, costAllocationRuleCheckNameAvailabilityRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest) { + return checkNameAvailabilityWithResponseAsync(billingAccountId, costAllocationRuleCheckNameAvailabilityRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, contentType, accept, costAllocationRuleCheckNameAvailabilityRequest, context); + } + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CostAllocationRuleCheckNameAvailabilityResponseInner checkNameAvailability(String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest) { + return checkNameAvailabilityWithResponse(billingAccountId, costAllocationRuleCheckNameAvailabilityRequest, + Context.NONE).getValue(); + } + + /** + * 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 the list of all cost allocation rules for a billing account or enterprise enrollment along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(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. + * @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 list of all cost allocation rules for a billing account or enterprise enrollment along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @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 list of all cost allocation rules for a billing account or enterprise enrollment along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesImpl.java new file mode 100644 index 000000000000..f036eacb0590 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.http.rest.PagedIterable; +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.costmanagement.fluent.CostAllocationRulesClient; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDefinition; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRules; + +public final class CostAllocationRulesImpl implements CostAllocationRules { + private static final ClientLogger LOGGER = new ClientLogger(CostAllocationRulesImpl.class); + + private final CostAllocationRulesClient innerClient; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + public CostAllocationRulesImpl(CostAllocationRulesClient innerClient, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String billingAccountId, String ruleName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(billingAccountId, ruleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CostAllocationRuleDefinitionImpl(inner.getValue(), this.manager())); + } + + public CostAllocationRuleDefinition get(String billingAccountId, String ruleName) { + CostAllocationRuleDefinitionInner inner = this.serviceClient().get(billingAccountId, ruleName); + if (inner != null) { + return new CostAllocationRuleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule, Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(billingAccountId, ruleName, costAllocationRule, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CostAllocationRuleDefinitionImpl(inner.getValue(), this.manager())); + } + + public CostAllocationRuleDefinition createOrUpdate(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule) { + CostAllocationRuleDefinitionInner inner + = this.serviceClient().createOrUpdate(billingAccountId, ruleName, costAllocationRule); + if (inner != null) { + return new CostAllocationRuleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String billingAccountId, String ruleName, Context context) { + return this.serviceClient().deleteWithResponse(billingAccountId, ruleName, context); + } + + public void deleteByResourceGroup(String billingAccountId, String ruleName) { + this.serviceClient().delete(billingAccountId, ruleName); + } + + public PagedIterable list(String billingAccountId) { + PagedIterable inner = this.serviceClient().list(billingAccountId); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CostAllocationRuleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String billingAccountId, Context context) { + PagedIterable inner = this.serviceClient().list(billingAccountId, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CostAllocationRuleDefinitionImpl(inner1, this.manager())); + } + + public Response checkNameAvailabilityWithResponse( + String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest, + Context context) { + Response inner = this.serviceClient() + .checkNameAvailabilityWithResponse(billingAccountId, costAllocationRuleCheckNameAvailabilityRequest, + context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CostAllocationRuleCheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } + + public CostAllocationRuleCheckNameAvailabilityResponse checkNameAvailability(String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest) { + CostAllocationRuleCheckNameAvailabilityResponseInner inner = this.serviceClient() + .checkNameAvailability(billingAccountId, costAllocationRuleCheckNameAvailabilityRequest); + if (inner != null) { + return new CostAllocationRuleCheckNameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private CostAllocationRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostDetailsOperationResultsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostDetailsOperationResultsImpl.java index 57b932420163..764be9a483e1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostDetailsOperationResultsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostDetailsOperationResultsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementClientBuilder.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientBuilder.java similarity index 65% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementClientBuilder.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientBuilder.java index 69c9fbcc837f..cea09bbd60e7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementClientBuilder.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -15,22 +15,22 @@ import java.time.Duration; /** - * A builder for creating a new instance of the CostManagementClientImpl type. + * A builder for creating a new instance of the CostManagementManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { CostManagementClientImpl.class }) -public final class CostManagementClientBuilder { +@ServiceClientBuilder(serviceClients = { CostManagementManagementClientImpl.class }) +public final class CostManagementManagementClientBuilder { /* - * server parameter + * Service host */ private String endpoint; /** - * Sets server parameter. + * Sets Service host. * * @param endpoint the endpoint value. - * @return the CostManagementClientBuilder. + * @return the CostManagementManagementClientBuilder. */ - public CostManagementClientBuilder endpoint(String endpoint) { + public CostManagementManagementClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -44,9 +44,9 @@ public CostManagementClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the CostManagementClientBuilder. + * @return the CostManagementManagementClientBuilder. */ - public CostManagementClientBuilder environment(AzureEnvironment environment) { + public CostManagementManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -60,9 +60,9 @@ public CostManagementClientBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the CostManagementClientBuilder. + * @return the CostManagementManagementClientBuilder. */ - public CostManagementClientBuilder pipeline(HttpPipeline pipeline) { + public CostManagementManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -76,9 +76,9 @@ public CostManagementClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the CostManagementClientBuilder. + * @return the CostManagementManagementClientBuilder. */ - public CostManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public CostManagementManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -92,19 +92,19 @@ public CostManagementClientBuilder defaultPollInterval(Duration defaultPollInter * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the CostManagementClientBuilder. + * @return the CostManagementManagementClientBuilder. */ - public CostManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public CostManagementManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of CostManagementClientImpl with the provided parameters. + * Builds an instance of CostManagementManagementClientImpl with the provided parameters. * - * @return an instance of CostManagementClientImpl. + * @return an instance of CostManagementManagementClientImpl. */ - public CostManagementClientImpl buildClient() { + public CostManagementManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -115,8 +115,8 @@ public CostManagementClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - CostManagementClientImpl client = new CostManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, localEndpoint); + CostManagementManagementClientImpl client = new CostManagementManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); return client; } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientImpl.java similarity index 79% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementClientImpl.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientImpl.java index 984525574d0b..54193ef5c789 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -15,30 +15,38 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.costmanagement.fluent.AlertsClient; import com.azure.resourcemanager.costmanagement.fluent.BenefitRecommendationsClient; import com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient; -import com.azure.resourcemanager.costmanagement.fluent.CostManagementClient; +import com.azure.resourcemanager.costmanagement.fluent.BudgetsClient; +import com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient; +import com.azure.resourcemanager.costmanagement.fluent.CostManagementManagementClient; import com.azure.resourcemanager.costmanagement.fluent.DimensionsClient; import com.azure.resourcemanager.costmanagement.fluent.ExportsClient; import com.azure.resourcemanager.costmanagement.fluent.ForecastsClient; +import com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient; import com.azure.resourcemanager.costmanagement.fluent.GenerateCostDetailsReportsClient; import com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationResultsClient; import com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationStatusClient; import com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportsClient; import com.azure.resourcemanager.costmanagement.fluent.GenerateReservationDetailsReportsClient; +import com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient; import com.azure.resourcemanager.costmanagement.fluent.OperationsClient; import com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient; import com.azure.resourcemanager.costmanagement.fluent.QueriesClient; import com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient; +import com.azure.resourcemanager.costmanagement.fluent.SettingsClient; import com.azure.resourcemanager.costmanagement.fluent.ViewsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -50,17 +58,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the CostManagementClientImpl type. + * Initializes a new instance of the CostManagementManagementClientImpl type. */ -@ServiceClient(builder = CostManagementClientBuilder.class) -public final class CostManagementClientImpl implements CostManagementClient { +@ServiceClient(builder = CostManagementManagementClientBuilder.class) +public final class CostManagementManagementClientImpl implements CostManagementManagementClient { /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -69,12 +77,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -124,6 +132,20 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The GenerateDetailedCostReportOperationStatusClient object to access its operations. + */ + private final GenerateDetailedCostReportOperationStatusClient generateDetailedCostReportOperationStatus; + + /** + * Gets the GenerateDetailedCostReportOperationStatusClient object to access its operations. + * + * @return the GenerateDetailedCostReportOperationStatusClient object. + */ + public GenerateDetailedCostReportOperationStatusClient getGenerateDetailedCostReportOperationStatus() { + return this.generateDetailedCostReportOperationStatus; + } + /** * The OperationsClient object to access its operations. */ @@ -138,6 +160,48 @@ public OperationsClient getOperations() { return this.operations; } + /** + * The BudgetsClient object to access its operations. + */ + private final BudgetsClient budgets; + + /** + * Gets the BudgetsClient object to access its operations. + * + * @return the BudgetsClient object. + */ + public BudgetsClient getBudgets() { + return this.budgets; + } + + /** + * The ExportsClient object to access its operations. + */ + private final ExportsClient exports; + + /** + * Gets the ExportsClient object to access its operations. + * + * @return the ExportsClient object. + */ + public ExportsClient getExports() { + return this.exports; + } + + /** + * The GenerateDetailedCostReportOperationResultsClient object to access its operations. + */ + private final GenerateDetailedCostReportOperationResultsClient generateDetailedCostReportOperationResults; + + /** + * Gets the GenerateDetailedCostReportOperationResultsClient object to access its operations. + * + * @return the GenerateDetailedCostReportOperationResultsClient object. + */ + public GenerateDetailedCostReportOperationResultsClient getGenerateDetailedCostReportOperationResults() { + return this.generateDetailedCostReportOperationResults; + } + /** * The ViewsClient object to access its operations. */ @@ -167,220 +231,240 @@ public AlertsClient getAlerts() { } /** - * The ForecastsClient object to access its operations. + * The ScheduledActionsClient object to access its operations. */ - private final ForecastsClient forecasts; + private final ScheduledActionsClient scheduledActions; /** - * Gets the ForecastsClient object to access its operations. + * Gets the ScheduledActionsClient object to access its operations. * - * @return the ForecastsClient object. + * @return the ScheduledActionsClient object. */ - public ForecastsClient getForecasts() { - return this.forecasts; + public ScheduledActionsClient getScheduledActions() { + return this.scheduledActions; } /** - * The DimensionsClient object to access its operations. + * The SettingsClient object to access its operations. */ - private final DimensionsClient dimensions; + private final SettingsClient settings; /** - * Gets the DimensionsClient object to access its operations. + * Gets the SettingsClient object to access its operations. * - * @return the DimensionsClient object. + * @return the SettingsClient object. */ - public DimensionsClient getDimensions() { - return this.dimensions; + public SettingsClient getSettings() { + return this.settings; } /** - * The QueriesClient object to access its operations. + * The MarkupRulesClient object to access its operations. */ - private final QueriesClient queries; + private final MarkupRulesClient markupRules; /** - * Gets the QueriesClient object to access its operations. + * Gets the MarkupRulesClient object to access its operations. * - * @return the QueriesClient object. + * @return the MarkupRulesClient object. */ - public QueriesClient getQueries() { - return this.queries; + public MarkupRulesClient getMarkupRules() { + return this.markupRules; } /** - * The GenerateReservationDetailsReportsClient object to access its operations. + * The GenerateCostDetailsReportsClient object to access its operations. */ - private final GenerateReservationDetailsReportsClient generateReservationDetailsReports; + private final GenerateCostDetailsReportsClient generateCostDetailsReports; /** - * Gets the GenerateReservationDetailsReportsClient object to access its operations. + * Gets the GenerateCostDetailsReportsClient object to access its operations. * - * @return the GenerateReservationDetailsReportsClient object. + * @return the GenerateCostDetailsReportsClient object. */ - public GenerateReservationDetailsReportsClient getGenerateReservationDetailsReports() { - return this.generateReservationDetailsReports; + public GenerateCostDetailsReportsClient getGenerateCostDetailsReports() { + return this.generateCostDetailsReports; } /** - * The ExportsClient object to access its operations. + * The CostAllocationRulesClient object to access its operations. */ - private final ExportsClient exports; + private final CostAllocationRulesClient costAllocationRules; /** - * Gets the ExportsClient object to access its operations. + * Gets the CostAllocationRulesClient object to access its operations. * - * @return the ExportsClient object. + * @return the CostAllocationRulesClient object. */ - public ExportsClient getExports() { - return this.exports; + public CostAllocationRulesClient getCostAllocationRules() { + return this.costAllocationRules; } /** - * The GenerateCostDetailsReportsClient object to access its operations. + * The BenefitRecommendationsClient object to access its operations. */ - private final GenerateCostDetailsReportsClient generateCostDetailsReports; + private final BenefitRecommendationsClient benefitRecommendations; /** - * Gets the GenerateCostDetailsReportsClient object to access its operations. + * Gets the BenefitRecommendationsClient object to access its operations. * - * @return the GenerateCostDetailsReportsClient object. + * @return the BenefitRecommendationsClient object. */ - public GenerateCostDetailsReportsClient getGenerateCostDetailsReports() { - return this.generateCostDetailsReports; + public BenefitRecommendationsClient getBenefitRecommendations() { + return this.benefitRecommendations; } /** - * The GenerateDetailedCostReportsClient object to access its operations. + * The BenefitUtilizationSummariesClient object to access its operations. */ - private final GenerateDetailedCostReportsClient generateDetailedCostReports; + private final BenefitUtilizationSummariesClient benefitUtilizationSummaries; /** - * Gets the GenerateDetailedCostReportsClient object to access its operations. + * Gets the BenefitUtilizationSummariesClient object to access its operations. * - * @return the GenerateDetailedCostReportsClient object. + * @return the BenefitUtilizationSummariesClient object. */ - public GenerateDetailedCostReportsClient getGenerateDetailedCostReports() { - return this.generateDetailedCostReports; + public BenefitUtilizationSummariesClient getBenefitUtilizationSummaries() { + return this.benefitUtilizationSummaries; } /** - * The GenerateDetailedCostReportOperationResultsClient object to access its operations. + * The GenerateBenefitUtilizationSummariesReportsClient object to access its operations. */ - private final GenerateDetailedCostReportOperationResultsClient generateDetailedCostReportOperationResults; + private final GenerateBenefitUtilizationSummariesReportsClient generateBenefitUtilizationSummariesReports; /** - * Gets the GenerateDetailedCostReportOperationResultsClient object to access its operations. + * Gets the GenerateBenefitUtilizationSummariesReportsClient object to access its operations. * - * @return the GenerateDetailedCostReportOperationResultsClient object. + * @return the GenerateBenefitUtilizationSummariesReportsClient object. */ - public GenerateDetailedCostReportOperationResultsClient getGenerateDetailedCostReportOperationResults() { - return this.generateDetailedCostReportOperationResults; + public GenerateBenefitUtilizationSummariesReportsClient getGenerateBenefitUtilizationSummariesReports() { + return this.generateBenefitUtilizationSummariesReports; } /** - * The GenerateDetailedCostReportOperationStatusClient object to access its operations. + * The GenerateDetailedCostReportsClient object to access its operations. */ - private final GenerateDetailedCostReportOperationStatusClient generateDetailedCostReportOperationStatus; + private final GenerateDetailedCostReportsClient generateDetailedCostReports; /** - * Gets the GenerateDetailedCostReportOperationStatusClient object to access its operations. + * Gets the GenerateDetailedCostReportsClient object to access its operations. * - * @return the GenerateDetailedCostReportOperationStatusClient object. + * @return the GenerateDetailedCostReportsClient object. */ - public GenerateDetailedCostReportOperationStatusClient getGenerateDetailedCostReportOperationStatus() { - return this.generateDetailedCostReportOperationStatus; + public GenerateDetailedCostReportsClient getGenerateDetailedCostReports() { + return this.generateDetailedCostReports; } /** - * The PriceSheetsClient object to access its operations. + * The ForecastsClient object to access its operations. */ - private final PriceSheetsClient priceSheets; + private final ForecastsClient forecasts; /** - * Gets the PriceSheetsClient object to access its operations. + * Gets the ForecastsClient object to access its operations. * - * @return the PriceSheetsClient object. + * @return the ForecastsClient object. */ - public PriceSheetsClient getPriceSheets() { - return this.priceSheets; + public ForecastsClient getForecasts() { + return this.forecasts; } /** - * The ScheduledActionsClient object to access its operations. + * The DimensionsClient object to access its operations. */ - private final ScheduledActionsClient scheduledActions; + private final DimensionsClient dimensions; /** - * Gets the ScheduledActionsClient object to access its operations. + * Gets the DimensionsClient object to access its operations. * - * @return the ScheduledActionsClient object. + * @return the DimensionsClient object. */ - public ScheduledActionsClient getScheduledActions() { - return this.scheduledActions; + public DimensionsClient getDimensions() { + return this.dimensions; } /** - * The BenefitRecommendationsClient object to access its operations. + * The QueriesClient object to access its operations. */ - private final BenefitRecommendationsClient benefitRecommendations; + private final QueriesClient queries; /** - * Gets the BenefitRecommendationsClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the BenefitRecommendationsClient object. + * @return the QueriesClient object. */ - public BenefitRecommendationsClient getBenefitRecommendations() { - return this.benefitRecommendations; + public QueriesClient getQueries() { + return this.queries; } /** - * The BenefitUtilizationSummariesClient object to access its operations. + * The GenerateReservationDetailsReportsClient object to access its operations. */ - private final BenefitUtilizationSummariesClient benefitUtilizationSummaries; + private final GenerateReservationDetailsReportsClient generateReservationDetailsReports; /** - * Gets the BenefitUtilizationSummariesClient object to access its operations. + * Gets the GenerateReservationDetailsReportsClient object to access its operations. * - * @return the BenefitUtilizationSummariesClient object. + * @return the GenerateReservationDetailsReportsClient object. */ - public BenefitUtilizationSummariesClient getBenefitUtilizationSummaries() { - return this.benefitUtilizationSummaries; + public GenerateReservationDetailsReportsClient getGenerateReservationDetailsReports() { + return this.generateReservationDetailsReports; + } + + /** + * The PriceSheetsClient object to access its operations. + */ + private final PriceSheetsClient priceSheets; + + /** + * Gets the PriceSheetsClient object to access its operations. + * + * @return the PriceSheetsClient object. + */ + public PriceSheetsClient getPriceSheets() { + return this.priceSheets; } /** - * Initializes an instance of CostManagementClient client. + * Initializes an instance of CostManagementManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @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 endpoint server parameter. + * @param endpoint Service host. */ - CostManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + CostManagementManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; - this.apiVersion = "2022-10-01"; + this.apiVersion = "2026-06-01"; + this.generateDetailedCostReportOperationStatus = new GenerateDetailedCostReportOperationStatusClientImpl(this); this.operations = new OperationsClientImpl(this); + this.budgets = new BudgetsClientImpl(this); + this.exports = new ExportsClientImpl(this); + this.generateDetailedCostReportOperationResults + = new GenerateDetailedCostReportOperationResultsClientImpl(this); this.views = new ViewsClientImpl(this); this.alerts = new AlertsClientImpl(this); + this.scheduledActions = new ScheduledActionsClientImpl(this); + this.settings = new SettingsClientImpl(this); + this.markupRules = new MarkupRulesClientImpl(this); + this.generateCostDetailsReports = new GenerateCostDetailsReportsClientImpl(this); + this.costAllocationRules = new CostAllocationRulesClientImpl(this); + this.benefitRecommendations = new BenefitRecommendationsClientImpl(this); + this.benefitUtilizationSummaries = new BenefitUtilizationSummariesClientImpl(this); + this.generateBenefitUtilizationSummariesReports + = new GenerateBenefitUtilizationSummariesReportsClientImpl(this); + this.generateDetailedCostReports = new GenerateDetailedCostReportsClientImpl(this); this.forecasts = new ForecastsClientImpl(this); this.dimensions = new DimensionsClientImpl(this); this.queries = new QueriesClientImpl(this); this.generateReservationDetailsReports = new GenerateReservationDetailsReportsClientImpl(this); - this.exports = new ExportsClientImpl(this); - this.generateCostDetailsReports = new GenerateCostDetailsReportsClientImpl(this); - this.generateDetailedCostReports = new GenerateDetailedCostReportsClientImpl(this); - this.generateDetailedCostReportOperationResults - = new GenerateDetailedCostReportOperationResultsClientImpl(this); - this.generateDetailedCostReportOperationStatus = new GenerateDetailedCostReportOperationStatusClientImpl(this); this.priceSheets = new PriceSheetsClientImpl(this); - this.scheduledActions = new ScheduledActionsClientImpl(this); - this.benefitRecommendations = new BenefitRecommendationsClientImpl(this); - this.benefitUtilizationSummaries = new BenefitUtilizationSummariesClientImpl(this); } /** @@ -420,6 +504,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -477,7 +578,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -509,5 +610,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(CostManagementClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(CostManagementManagementClientImpl.class); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementOperationImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementOperationImpl.java index 9f0065798512..bf54384549e4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementOperationImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementOperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionImpl.java index 63fa182d6e78..6283fc88d5ce 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -38,6 +38,14 @@ public String location() { return this.innerModel().location(); } + public String sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -47,14 +55,6 @@ public Map tags() { } } - public String sku() { - return this.innerModel().sku(); - } - - public String etag() { - return this.innerModel().etag(); - } - public String description() { return this.innerModel().description(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsClientImpl.java index ab7f083a1734..e1355f4165f7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.costmanagement.fluent.DimensionsClient; import com.azure.resourcemanager.costmanagement.fluent.models.DimensionInner; -import com.azure.resourcemanager.costmanagement.models.DimensionsListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.DimensionsListResult; import com.azure.resourcemanager.costmanagement.models.ExternalCloudProviderType; import reactor.core.publisher.Mono; @@ -43,46 +43,97 @@ public final class DimensionsClientImpl implements DimensionsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of DimensionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - DimensionsClientImpl(CostManagementClientImpl client) { + DimensionsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(DimensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientDimensions to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for CostManagementManagementClientDimensions to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientDimensions") public interface DimensionsService { @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/dimensions") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$skiptoken") String skiptoken, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/dimensions") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, + @QueryParam("$skiptoken") String skiptoken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> byExternalCloudProviderType(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, + @PathParam("externalCloudProviderId") String externalCloudProviderId, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @QueryParam("$skiptoken") String skiptoken, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> byExternalCloudProviderType(@HostParam("$host") String endpoint, + Response byExternalCloudProviderTypeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, - @PathParam("externalCloudProviderId") String externalCloudProviderId, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @PathParam("externalCloudProviderId") String externalCloudProviderId, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$skiptoken") String skiptoken, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> byExternalCloudProviderTypeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response byExternalCloudProviderTypeNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -116,19 +167,12 @@ Mono> byExternalCloudProviderType(@HostParam("$ho @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope, String filter, String expand, String skiptoken, Integer top) { - 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.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, filter, expand, skiptoken, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -155,29 +199,16 @@ private Mono> listSinglePageAsync(String scope, St * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N dimension data. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing dimensions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return result of listing dimensions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String filter, String expand, - String skiptoken, Integer top, 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 - .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, expand, skiptoken, top, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String filter, String expand, String skiptoken, + Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, expand, skiptoken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -195,23 +226,19 @@ private Mono> listSinglePageAsync(String scope, St * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param filter May be used to filter dimensions by properties/category, properties/usageStart, - * properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - * @param expand May be used to expand the properties/data within a dimension category. By default, data is not - * included when listing dimensions. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies - * a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N dimension data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of listing dimensions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String filter, String expand, String skiptoken, - Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, expand, skiptoken, top)); + private PagedFlux listAsync(String scope) { + final String filter = null; + final String expand = null; + final String skiptoken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, expand, skiptoken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -229,18 +256,27 @@ private PagedFlux listAsync(String scope, String filter, String * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param filter May be used to filter dimensions by properties/category, properties/usageStart, + * properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + * @param expand May be used to expand the properties/data within a dimension category. By default, data is not + * included when listing dimensions. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N dimension data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing dimensions as paginated response with {@link PagedFlux}. + * @return result of listing dimensions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - final String filter = null; - final String expand = null; - final String skiptoken = null; - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, expand, skiptoken, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String scope, String filter, String expand, String skiptoken, + Integer top) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + scope, filter, expand, skiptoken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -270,12 +306,16 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing dimensions as paginated response with {@link PagedFlux}. + * @return result of listing dimensions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String filter, String expand, String skiptoken, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String scope, String filter, String expand, String skiptoken, Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, expand, skiptoken, top, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + scope, filter, expand, skiptoken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -304,7 +344,8 @@ public PagedIterable list(String scope) { final String expand = null; final String skiptoken = null; final Integer top = null; - return new PagedIterable<>(listAsync(scope, filter, expand, skiptoken, top)); + return new PagedIterable<>(() -> listSinglePage(scope, filter, expand, skiptoken, top), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -339,7 +380,8 @@ public PagedIterable list(String scope) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope, String filter, String expand, String skiptoken, Integer top, Context context) { - return new PagedIterable<>(listAsync(scope, filter, expand, skiptoken, top, context)); + return new PagedIterable<>(() -> listSinglePage(scope, filter, expand, skiptoken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -366,25 +408,13 @@ public PagedIterable list(String scope, String filter, String ex private Mono> byExternalCloudProviderTypeSinglePageAsync( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, String filter, String expand, String skiptoken, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.byExternalCloudProviderType(this.client.getEndpoint(), - externalCloudProviderType, externalCloudProviderId, this.client.getApiVersion(), filter, expand, + this.client.getApiVersion(), externalCloudProviderType, externalCloudProviderId, filter, expand, skiptoken, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -403,35 +433,18 @@ private Mono> byExternalCloudProviderTypeSinglePag * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N dimension data. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing dimensions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return result of listing dimensions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> byExternalCloudProviderTypeSinglePageAsync( + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux byExternalCloudProviderTypeAsync( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, String filter, - String expand, String skiptoken, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .byExternalCloudProviderType(this.client.getEndpoint(), externalCloudProviderType, externalCloudProviderId, - this.client.getApiVersion(), filter, expand, skiptoken, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + String expand, String skiptoken, Integer top) { + return new PagedFlux<>(() -> byExternalCloudProviderTypeSinglePageAsync(externalCloudProviderType, + externalCloudProviderId, filter, expand, skiptoken, top), + nextLink -> byExternalCloudProviderTypeNextSinglePageAsync(nextLink)); } /** @@ -441,14 +454,6 @@ private Mono> byExternalCloudProviderTypeSinglePag * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param filter May be used to filter dimensions by properties/category, properties/usageStart, - * properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - * @param expand May be used to expand the properties/data within a dimension category. By default, data is not - * included when listing dimensions. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies - * a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N dimension data. * @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. @@ -456,10 +461,14 @@ private Mono> byExternalCloudProviderTypeSinglePag */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux byExternalCloudProviderTypeAsync( - ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, String filter, - String expand, String skiptoken, Integer top) { + ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId) { + final String filter = null; + final String expand = null; + final String skiptoken = null; + final Integer top = null; return new PagedFlux<>(() -> byExternalCloudProviderTypeSinglePageAsync(externalCloudProviderType, - externalCloudProviderId, filter, expand, skiptoken, top)); + externalCloudProviderId, filter, expand, skiptoken, top), + nextLink -> byExternalCloudProviderTypeNextSinglePageAsync(nextLink)); } /** @@ -469,20 +478,29 @@ private PagedFlux byExternalCloudProviderTypeAsync( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + * @param filter May be used to filter dimensions by properties/category, properties/usageStart, + * properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + * @param expand May be used to expand the properties/data within a dimension category. By default, data is not + * included when listing dimensions. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N dimension data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing dimensions as paginated response with {@link PagedFlux}. + * @return result of listing dimensions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux byExternalCloudProviderTypeAsync( - ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId) { - final String filter = null; - final String expand = null; - final String skiptoken = null; - final Integer top = null; - return new PagedFlux<>(() -> byExternalCloudProviderTypeSinglePageAsync(externalCloudProviderType, - externalCloudProviderId, filter, expand, skiptoken, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse byExternalCloudProviderTypeSinglePage( + ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, String filter, + String expand, String skiptoken, Integer top) { + final String accept = "application/json"; + Response res = service.byExternalCloudProviderTypeSync(this.client.getEndpoint(), + this.client.getApiVersion(), externalCloudProviderType, externalCloudProviderId, filter, expand, skiptoken, + top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -504,14 +522,18 @@ private PagedFlux byExternalCloudProviderTypeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing dimensions as paginated response with {@link PagedFlux}. + * @return result of listing dimensions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux byExternalCloudProviderTypeAsync( + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse byExternalCloudProviderTypeSinglePage( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, String filter, String expand, String skiptoken, Integer top, Context context) { - return new PagedFlux<>(() -> byExternalCloudProviderTypeSinglePageAsync(externalCloudProviderType, - externalCloudProviderId, filter, expand, skiptoken, top, context)); + final String accept = "application/json"; + Response res + = service.byExternalCloudProviderTypeSync(this.client.getEndpoint(), this.client.getApiVersion(), + externalCloudProviderType, externalCloudProviderId, filter, expand, skiptoken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -533,8 +555,9 @@ public PagedIterable byExternalCloudProviderType( final String expand = null; final String skiptoken = null; final Integer top = null; - return new PagedIterable<>(byExternalCloudProviderTypeAsync(externalCloudProviderType, externalCloudProviderId, - filter, expand, skiptoken, top)); + return new PagedIterable<>(() -> byExternalCloudProviderTypeSinglePage(externalCloudProviderType, + externalCloudProviderId, filter, expand, skiptoken, top), + nextLink -> byExternalCloudProviderTypeNextSinglePage(nextLink)); } /** @@ -562,7 +585,119 @@ public PagedIterable byExternalCloudProviderType( public PagedIterable byExternalCloudProviderType( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, String filter, String expand, String skiptoken, Integer top, Context context) { - return new PagedIterable<>(byExternalCloudProviderTypeAsync(externalCloudProviderType, externalCloudProviderId, - filter, expand, skiptoken, top, context)); + return new PagedIterable<>( + () -> byExternalCloudProviderTypeSinglePage(externalCloudProviderType, externalCloudProviderId, filter, + expand, skiptoken, top, context), + nextLink -> byExternalCloudProviderTypeNextSinglePage(nextLink, 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 result of listing dimensions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing dimensions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing dimensions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 result of listing dimensions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> byExternalCloudProviderTypeNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.byExternalCloudProviderTypeNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing dimensions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse byExternalCloudProviderTypeNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.byExternalCloudProviderTypeNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing dimensions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse byExternalCloudProviderTypeNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.byExternalCloudProviderTypeNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsImpl.java index a9ad1545f981..631ad08702cf 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DownloadUrlImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DownloadUrlImpl.java index a106e91eb938..2a6fff5434ad 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DownloadUrlImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/DownloadUrlImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportExecutionListResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportExecutionListResultImpl.java index 6b9fcd7d7a4d..26c6e451a987 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportExecutionListResultImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportExecutionListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportImpl.java index 8e13b53f7d89..9dfbcdaeb9b1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportImpl.java @@ -1,19 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.costmanagement.fluent.models.ExportExecutionListResultInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportInner; +import com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; import com.azure.resourcemanager.costmanagement.models.Export; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; import com.azure.resourcemanager.costmanagement.models.ExportExecutionListResult; +import com.azure.resourcemanager.costmanagement.models.ExportRunRequest; import com.azure.resourcemanager.costmanagement.models.ExportSchedule; +import com.azure.resourcemanager.costmanagement.models.ExportSuspensionContext; import com.azure.resourcemanager.costmanagement.models.FormatType; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentity; import java.time.OffsetDateTime; public final class ExportImpl implements Export, Export.Definition, Export.Update { @@ -33,10 +40,22 @@ public String type() { return this.innerModel().type(); } + public SystemAssignedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String location() { + return this.innerModel().location(); + } + public String etag() { return this.innerModel().etag(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ExportSchedule schedule() { return this.innerModel().schedule(); } @@ -66,10 +85,34 @@ public Boolean partitionData() { return this.innerModel().partitionData(); } + public DataOverwriteBehaviorType dataOverwriteBehavior() { + return this.innerModel().dataOverwriteBehavior(); + } + + public CompressionModeType compressionMode() { + return this.innerModel().compressionMode(); + } + + public String exportDescription() { + return this.innerModel().exportDescription(); + } + public OffsetDateTime nextRunTimeEstimate() { return this.innerModel().nextRunTimeEstimate(); } + public ExportSuspensionContext systemSuspensionContext() { + return this.innerModel().systemSuspensionContext(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + public ExportInner innerModel() { return this.innerObject; } @@ -156,14 +199,29 @@ public Export refresh(Context context) { return this; } - public Response executeWithResponse(Context context) { - return serviceManager.exports().executeWithResponse(scope, exportName, context); + public Response executeWithResponse(ExportRunRequest parameters, Context context) { + return serviceManager.exports().executeWithResponse(scope, exportName, parameters, context); } public void execute() { serviceManager.exports().execute(scope, exportName); } + public ExportImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExportImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExportImpl withIdentity(SystemAssignedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + public ExportImpl withEtag(String etag) { this.innerModel().withEtag(etag); return this; @@ -198,4 +256,19 @@ public ExportImpl withPartitionData(Boolean partitionData) { this.innerModel().withPartitionData(partitionData); return this; } + + public ExportImpl withDataOverwriteBehavior(DataOverwriteBehaviorType dataOverwriteBehavior) { + this.innerModel().withDataOverwriteBehavior(dataOverwriteBehavior); + return this; + } + + public ExportImpl withCompressionMode(CompressionModeType compressionMode) { + this.innerModel().withCompressionMode(compressionMode); + return this; + } + + public ExportImpl withExportDescription(String exportDescription) { + this.innerModel().withExportDescription(exportDescription); + return this; + } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportListResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportListResultImpl.java index 6a142e24cd8c..0542da4d19cf 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportListResultImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunImpl.java index 2f3f1aeaf6bf..73ae82abb226 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -64,10 +64,22 @@ public OffsetDateTime processingEndTime() { return this.innerModel().processingEndTime(); } + public OffsetDateTime startDate() { + return this.innerModel().startDate(); + } + + public OffsetDateTime endDate() { + return this.innerModel().endDate(); + } + public String fileName() { return this.innerModel().fileName(); } + public String manifestFile() { + return this.innerModel().manifestFile(); + } + public CommonExportProperties runSettings() { CommonExportPropertiesInner inner = this.innerModel().runSettings(); if (inner != null) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunPropertiesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunPropertiesImpl.java index 9aea4b919ba6..89e49c30c2ff 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunPropertiesImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunPropertiesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -48,10 +48,22 @@ public OffsetDateTime processingEndTime() { return this.innerModel().processingEndTime(); } + public OffsetDateTime startDate() { + return this.innerModel().startDate(); + } + + public OffsetDateTime endDate() { + return this.innerModel().endDate(); + } + public String fileName() { return this.innerModel().fileName(); } + public String manifestFile() { + return this.innerModel().manifestFile(); + } + public CommonExportProperties runSettings() { CommonExportPropertiesInner inner = this.innerModel().runSettings(); if (inner != null) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsClientImpl.java index 96837c788923..af596b8a330f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -29,6 +29,7 @@ import com.azure.resourcemanager.costmanagement.fluent.models.ExportExecutionListResultInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportListResultInner; +import com.azure.resourcemanager.costmanagement.models.ExportRunRequest; import reactor.core.publisher.Mono; /** @@ -43,240 +44,131 @@ public final class ExportsClientImpl implements ExportsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of ExportsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ExportsClientImpl(CostManagementClientImpl client) { + ExportsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(ExportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientExports to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for CostManagementManagementClientExports to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientExports") public interface ExportsService { @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.CostManagement/exports") + @Get("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, @PathParam("exportName") String exportName, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @PathParam("exportName") String exportName, @BodyParam("application/json") ExportInner parameters, - @HeaderParam("Accept") String accept, Context context); + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExportInner parameters, + Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExportInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @PathParam("exportName") String exportName, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run") + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> execute(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @PathParam("exportName") String exportName, @HeaderParam("Accept") String accept, Context context); + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam(value = "scope", encoded = true) String scope, @PathParam("exportName") String exportName, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory") + @Get("/{scope}/providers/Microsoft.CostManagement/exports") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getExecutionHistory(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @PathParam("exportName") String exportName, @HeaderParam("Accept") String accept, Context context); - } + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last run of each export. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope, String expand) { - 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.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), expand, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/exports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last run of each export. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scope, String expand, 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.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), expand, accept, context); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> execute(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, @BodyParam("application/json") ExportRunRequest parameters, + Context context); - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scope) { - final String expand = null; - return listWithResponseAsync(scope, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam(value = "scope", encoded = true) String scope, @PathParam("exportName") String exportName, + @BodyParam("application/json") ExportRunRequest parameters, Context context); - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last run of each export. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scope, String expand, Context context) { - return listWithResponseAsync(scope, expand, context).block(); - } + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getExecutionHistory(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, @HeaderParam("Accept") String accept, Context context); - /** - * The operation to list all exports at the given scope. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExportListResultInner list(String scope) { - final String expand = null; - return listWithResponse(scope, expand, Context.NONE).getValue(); + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getExecutionHistorySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("exportName") String exportName, @HeaderParam("Accept") String accept, Context context); } /** * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and * will return information for the last 10 runs of the export. @@ -287,19 +179,9 @@ public ExportListResultInner list(String scope) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String scope, String exportName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, exportName, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -307,59 +189,7 @@ private Mono> getWithResponseAsync(String scope, String ex /** * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. - * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last 10 runs of the export. - * @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 an export resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String exportName, String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), exportName, expand, accept, - context); - } - - /** - * The operation to get the export for the defined scope by export name. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -375,17 +205,7 @@ private Mono getAsync(String scope, String exportName) { /** * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and * will return information for the last 10 runs of the export. @@ -397,23 +217,15 @@ private Mono getAsync(String scope, String exportName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String scope, String exportName, String expand, Context context) { - return getWithResponseAsync(scope, exportName, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, exportName, expand, + accept, context); } /** * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -430,17 +242,7 @@ public ExportInner get(String scope, String exportName) { * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param parameters Parameters supplied to the CreateOrUpdate Export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -451,25 +253,11 @@ public ExportInner get(String scope, String exportName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String scope, String exportName, ExportInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), scope, - this.client.getApiVersion(), exportName, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + scope, exportName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -477,64 +265,7 @@ private Mono> createOrUpdateWithResponseAsync(String scope * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. - * @param parameters Parameters supplied to the CreateOrUpdate Export operation. - * @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 an export resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String exportName, - ExportInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), scope, this.client.getApiVersion(), exportName, - parameters, accept, context); - } - - /** - * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You - * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param parameters Parameters supplied to the CreateOrUpdate Export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -552,17 +283,7 @@ private Mono createOrUpdateAsync(String scope, String exportName, E * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param parameters Parameters supplied to the CreateOrUpdate Export operation. * @param context The context to associate with this operation. @@ -574,24 +295,17 @@ private Mono createOrUpdateAsync(String scope, String exportName, E @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String scope, String exportName, ExportInner parameters, Context context) { - return createOrUpdateWithResponseAsync(scope, exportName, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, exportName, + contentType, accept, parameters, context); } /** * The operation to create or update a export. Update operation requires latest eTag to be set in the request. You * may obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param parameters Parameters supplied to the CreateOrUpdate Export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -607,17 +321,7 @@ public ExportInner createOrUpdate(String scope, String exportName, ExportInner p /** * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -626,117 +330,61 @@ public ExportInner createOrUpdate(String scope, String exportName, ExportInner p */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String scope, String exportName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), scope, this.client.getApiVersion(), - exportName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), scope, + exportName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. - * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String exportName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), scope, this.client.getApiVersion(), exportName, accept, - context); + private Mono deleteAsync(String scope, String exportName) { + return deleteWithResponseAsync(scope, exportName).flatMap(ignored -> Mono.empty()); } /** * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. + * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String exportName) { - return deleteWithResponseAsync(scope, exportName).flatMap(ignored -> Mono.empty()); + public Response deleteWithResponse(String scope, String exportName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, exportName, context); } /** * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. - * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String exportName, Context context) { - return deleteWithResponseAsync(scope, exportName, context).block(); + public void delete(String scope, String exportName) { + deleteWithResponse(scope, exportName, Context.NONE); } /** - * The operation to delete a export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -747,20 +395,26 @@ public Response deleteWithResponse(String scope, String exportName, Contex * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. + * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and + * will return information for the last run of each export. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing exports along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String exportName) { - deleteWithResponse(scope, exportName, Context.NONE); + private Mono> listWithResponseAsync(String scope, String expand) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, expand, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * The operation to run an export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -771,35 +425,21 @@ public void delete(String scope, String exportName) { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. * @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}. + * @return result of listing exports on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync(String scope, String exportName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), scope, this.client.getApiVersion(), - exportName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono listAsync(String scope) { + final String expand = null; + return listWithResponseAsync(scope, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The operation to run an export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -810,35 +450,24 @@ private Mono> executeWithResponseAsync(String scope, String expor * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. + * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and + * will return information for the last run of each export. * @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}. + * @return result of listing exports along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeWithResponseAsync(String scope, String exportName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } + public Response listWithResponse(String scope, String expand, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), scope, this.client.getApiVersion(), exportName, accept, - context); + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, expand, accept, context); } /** - * The operation to run an export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -849,124 +478,92 @@ private Mono> executeWithResponseAsync(String scope, String expor * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing exports. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportListResultInner list(String scope) { + final String expand = null; + return listWithResponse(scope, expand, Context.NONE).getValue(); + } + + /** + * The operation to run an export. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. + * @param parameters Parameters supplied to the Execute Export 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync(String scope, String exportName) { - return executeWithResponseAsync(scope, exportName).flatMap(ignored -> Mono.empty()); + private Mono> executeWithResponseAsync(String scope, String exportName, + ExportRunRequest parameters) { + return FluxUtil + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), scope, + exportName, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to run an export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. - * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response executeWithResponse(String scope, String exportName, Context context) { - return executeWithResponseAsync(scope, exportName, context).block(); + private Mono executeAsync(String scope, String exportName) { + final ExportRunRequest parameters = null; + return executeWithResponseAsync(scope, exportName, parameters).flatMap(ignored -> Mono.empty()); } /** * The operation to run an export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. + * @param parameters Parameters supplied to the Execute Export operation. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void execute(String scope, String exportName) { - executeWithResponse(scope, exportName, Context.NONE); + public Response executeWithResponse(String scope, String exportName, ExportRunRequest parameters, + Context context) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, exportName, + parameters, context); } /** - * The operation to get the run history of an export for the defined scope and export name. + * The operation to run an export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing the run history of an export along with {@link Response} on successful completion of - * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getExecutionHistoryWithResponseAsync(String scope, - String exportName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getExecutionHistory(this.client.getEndpoint(), scope, - this.client.getApiVersion(), exportName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public void execute(String scope, String exportName) { + final ExportRunRequest parameters = null; + executeWithResponse(scope, exportName, parameters, Context.NONE); } /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. - * @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. @@ -975,37 +572,18 @@ private Mono> getExecutionHistoryWithRe */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getExecutionHistoryWithResponseAsync(String scope, - String exportName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (exportName == null) { - return Mono.error(new IllegalArgumentException("Parameter exportName is required and cannot be null.")); - } + String exportName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getExecutionHistory(this.client.getEndpoint(), scope, this.client.getApiVersion(), exportName, - accept, context); + return FluxUtil + .withContext(context -> service.getExecutionHistory(this.client.getEndpoint(), this.client.getApiVersion(), + scope, exportName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1020,17 +598,7 @@ private Mono getExecutionHistoryAsync(String sco /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1041,23 +609,15 @@ private Mono getExecutionHistoryAsync(String sco @ServiceMethod(returns = ReturnType.SINGLE) public Response getExecutionHistoryWithResponse(String scope, String exportName, Context context) { - return getExecutionHistoryWithResponseAsync(scope, exportName, context).block(); + final String accept = "application/json"; + return service.getExecutionHistorySync(this.client.getEndpoint(), this.client.getApiVersion(), scope, + exportName, accept, context); } /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsImpl.java index 2e96c529905a..90aafabd854f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -15,6 +15,7 @@ import com.azure.resourcemanager.costmanagement.models.Export; import com.azure.resourcemanager.costmanagement.models.ExportExecutionListResult; import com.azure.resourcemanager.costmanagement.models.ExportListResult; +import com.azure.resourcemanager.costmanagement.models.ExportRunRequest; import com.azure.resourcemanager.costmanagement.models.Exports; public final class ExportsImpl implements Exports { @@ -30,33 +31,10 @@ public ExportsImpl(ExportsClient innerClient, this.serviceManager = serviceManager; } - public Response listWithResponse(String scope, String expand, Context context) { - Response inner = this.serviceClient().listWithResponse(scope, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ExportListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ExportListResult list(String scope) { - ExportListResultInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new ExportListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String scope, String exportName, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(scope, exportName, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ExportImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExportImpl(inner.getValue(), this.manager())); } public Export get(String scope, String exportName) { @@ -76,8 +54,24 @@ public void deleteByResourceGroup(String scope, String exportName) { this.serviceClient().delete(scope, exportName); } - public Response executeWithResponse(String scope, String exportName, Context context) { - return this.serviceClient().executeWithResponse(scope, exportName, context); + public Response listWithResponse(String scope, String expand, Context context) { + Response inner = this.serviceClient().listWithResponse(scope, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExportListResultImpl(inner.getValue(), this.manager())); + } + + public ExportListResult list(String scope) { + ExportListResultInner inner = this.serviceClient().list(scope); + if (inner != null) { + return new ExportListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response executeWithResponse(String scope, String exportName, ExportRunRequest parameters, + Context context) { + return this.serviceClient().executeWithResponse(scope, exportName, parameters, context); } public void execute(String scope, String exportName) { @@ -88,12 +82,8 @@ public Response getExecutionHistoryWithResponse(Strin Context context) { Response inner = this.serviceClient().getExecutionHistoryWithResponse(scope, exportName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ExportExecutionListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExportExecutionListResultImpl(inner.getValue(), this.manager())); } public ExportExecutionListResult getExecutionHistory(String scope, String exportName) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastResultImpl.java index ae55c69c3236..491430788cac 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastResultImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -38,6 +38,14 @@ public String location() { return this.innerModel().location(); } + public String sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -47,14 +55,6 @@ public Map tags() { } } - public String sku() { - return this.innerModel().sku(); - } - - public String etag() { - return this.innerModel().etag(); - } - public String nextLink() { return this.innerModel().nextLink(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsClientImpl.java index 5e18909e6bfc..f72cc223dc24 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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; @@ -40,46 +39,63 @@ public final class ForecastsClientImpl implements ForecastsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of ForecastsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ForecastsClientImpl(CostManagementClientImpl client) { + ForecastsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(ForecastsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientForecasts to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for CostManagementManagementClientForecasts to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientForecasts") public interface ForecastsService { - @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.CostManagement/forecast") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> usage(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @BodyParam("application/json") ForecastDefinition parameters, @HeaderParam("Accept") String accept, + Mono> usage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @PathParam(value = "scope", encoded = true) String scope, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ForecastDefinition parameters, + Context context); + + @Post("/{scope}/providers/Microsoft.CostManagement/forecast") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response usageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @PathParam(value = "scope", encoded = true) String scope, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ForecastDefinition parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> externalCloudProviderUsage(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, + Mono> externalCloudProviderUsage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, @PathParam("externalCloudProviderId") String externalCloudProviderId, - @BodyParam("application/json") ForecastDefinition parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ForecastDefinition parameters, Context context); + + @Post("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response externalCloudProviderUsageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, + @PathParam("externalCloudProviderId") String externalCloudProviderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ForecastDefinition parameters, Context context); } /** @@ -108,70 +124,14 @@ Mono> externalCloudProviderUsage(@HostParam("$host @ServiceMethod(returns = ReturnType.SINGLE) private Mono> usageWithResponseAsync(String scope, ForecastDefinition parameters, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.usage(this.client.getEndpoint(), filter, this.client.getApiVersion(), scope, - parameters, accept, context)) + .withContext(context -> service.usage(this.client.getEndpoint(), this.client.getApiVersion(), filter, scope, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the forecast charges for scope defined. - * - * @param scope The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of forecast along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> usageWithResponseAsync(String scope, ForecastDefinition parameters, - String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.usage(this.client.getEndpoint(), filter, this.client.getApiVersion(), scope, parameters, accept, - context); - } - /** * Lists the forecast charges for scope defined. * @@ -225,7 +185,10 @@ private Mono usageAsync(String scope, ForecastDefinition pa @ServiceMethod(returns = ReturnType.SINGLE) public Response usageWithResponse(String scope, ForecastDefinition parameters, String filter, Context context) { - return usageWithResponseAsync(scope, parameters, filter, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.usageSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, scope, contentType, + accept, parameters, context); } /** @@ -261,7 +224,7 @@ public ForecastResultInner usage(String scope, ForecastDefinition parameters) { * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support * 'ne', 'or', or 'not'. @@ -274,28 +237,12 @@ public ForecastResultInner usage(String scope, ForecastDefinition parameters) { private Mono> externalCloudProviderUsageWithResponseAsync( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, ForecastDefinition parameters, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.externalCloudProviderUsage(this.client.getEndpoint(), filter, - this.client.getApiVersion(), externalCloudProviderType, externalCloudProviderId, parameters, accept, - context)) + .withContext(context -> service.externalCloudProviderUsage(this.client.getEndpoint(), + this.client.getApiVersion(), filter, externalCloudProviderType, externalCloudProviderId, contentType, + accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -306,51 +253,7 @@ private Mono> externalCloudProviderUsageWithRespon * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of forecast along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> externalCloudProviderUsageWithResponseAsync( - ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, - ForecastDefinition parameters, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.externalCloudProviderUsage(this.client.getEndpoint(), filter, this.client.getApiVersion(), - externalCloudProviderType, externalCloudProviderId, parameters, accept, context); - } - - /** - * Lists the forecast charges for external cloud provider type defined. - * - * @param externalCloudProviderType The external cloud provider type associated with dimension/query operations. - * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or - * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @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. @@ -372,7 +275,7 @@ private Mono externalCloudProviderUsageAsync( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support * 'ne', 'or', or 'not'. @@ -386,8 +289,10 @@ private Mono externalCloudProviderUsageAsync( public Response externalCloudProviderUsageWithResponse( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, ForecastDefinition parameters, String filter, Context context) { - return externalCloudProviderUsageWithResponseAsync(externalCloudProviderType, externalCloudProviderId, - parameters, filter, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.externalCloudProviderUsageSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + externalCloudProviderType, externalCloudProviderId, contentType, accept, parameters, context); } /** @@ -397,7 +302,7 @@ public Response externalCloudProviderUsageWithResponse( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsImpl.java index 6413b5304316..20542296fc9b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -32,12 +32,8 @@ public Response usageWithResponse(String scope, ForecastDefiniti Context context) { Response inner = this.serviceClient().usageWithResponse(scope, parameters, filter, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ForecastResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ForecastResultImpl(inner.getValue(), this.manager())); } public ForecastResult usage(String scope, ForecastDefinition parameters) { @@ -55,12 +51,8 @@ public Response externalCloudProviderUsageWithResponse( Response inner = this.serviceClient() .externalCloudProviderUsageWithResponse(externalCloudProviderType, externalCloudProviderId, parameters, filter, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ForecastResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ForecastResultImpl(inner.getValue(), this.manager())); } public ForecastResult externalCloudProviderUsage(ExternalCloudProviderType externalCloudProviderType, diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsClientImpl.java new file mode 100644 index 000000000000..4237214590b2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsClientImpl.java @@ -0,0 +1,1337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +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.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.BinaryData; +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.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient; +import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +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 + * GenerateBenefitUtilizationSummariesReportsClient. + */ +public final class GenerateBenefitUtilizationSummariesReportsClientImpl + implements GenerateBenefitUtilizationSummariesReportsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GenerateBenefitUtilizationSummariesReportsService service; + + /** + * The service client containing this operation class. + */ + private final CostManagementManagementClientImpl client; + + /** + * Initializes an instance of GenerateBenefitUtilizationSummariesReportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GenerateBenefitUtilizationSummariesReportsClientImpl(CostManagementManagementClientImpl client) { + this.service = RestProxy.create(GenerateBenefitUtilizationSummariesReportsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * CostManagementManagementClientGenerateBenefitUtilizationSummariesReports to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientGenerateBenefitUtilizationSummariesReports") + public interface GenerateBenefitUtilizationSummariesReportsService { + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateByBillingAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateByBillingAccountSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateByBillingProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateByBillingProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateByReservationOrderId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateByReservationOrderIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateByReservationId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateByReservationIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateBySavingsPlanOrderId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("savingsPlanOrderId") String savingsPlanOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateBySavingsPlanOrderIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("savingsPlanOrderId") String savingsPlanOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateBySavingsPlanId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("savingsPlanOrderId") String savingsPlanOrderId, + @PathParam("savingsPlanId") String savingsPlanId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + @Post("/providers/microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/generateBenefitUtilizationSummariesReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateBySavingsPlanIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("savingsPlanOrderId") String savingsPlanOrderId, + @PathParam("savingsPlanId") String savingsPlanId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateByBillingAccountWithResponseAsync(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.generateByBillingAccount(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, contentType, accept, benefitUtilizationSummariesRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByBillingAccountWithResponse(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByBillingAccountSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, contentType, accept, benefitUtilizationSummariesRequest, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByBillingAccountWithResponse(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByBillingAccountSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, contentType, accept, benefitUtilizationSummariesRequest, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingAccountAsync(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Mono>> mono + = generateByBillingAccountWithResponseAsync(billingAccountId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, this.client.getContext()); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Response response + = generateByBillingAccountWithResponse(billingAccountId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + Response response + = generateByBillingAccountWithResponse(billingAccountId, benefitUtilizationSummariesRequest, context); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateByBillingAccountAsync(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByBillingAccountAsync(billingAccountId, benefitUtilizationSummariesRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByBillingAccount(billingAccountId, benefitUtilizationSummariesRequest).getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + return beginGenerateByBillingAccount(billingAccountId, benefitUtilizationSummariesRequest, context) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateByBillingProfileWithResponseAsync(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateByBillingProfile(this.client.getEndpoint(), + this.client.getApiVersion(), billingAccountId, billingProfileId, contentType, accept, + benefitUtilizationSummariesRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByBillingProfileWithResponse(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByBillingProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, contentType, accept, benefitUtilizationSummariesRequest, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByBillingProfileWithResponse(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByBillingProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, contentType, accept, benefitUtilizationSummariesRequest, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingProfileAsync(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Mono>> mono = generateByBillingProfileWithResponseAsync(billingAccountId, + billingProfileId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, this.client.getContext()); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingProfile(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Response response = generateByBillingProfileWithResponse(billingAccountId, billingProfileId, + benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByBillingProfile(String billingAccountId, String billingProfileId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + Response response = generateByBillingProfileWithResponse(billingAccountId, billingProfileId, + benefitUtilizationSummariesRequest, context); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateByBillingProfileAsync(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByBillingProfileAsync(billingAccountId, billingProfileId, + benefitUtilizationSummariesRequest).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByBillingProfile(billingAccountId, billingProfileId, benefitUtilizationSummariesRequest) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context) { + return beginGenerateByBillingProfile(billingAccountId, billingProfileId, benefitUtilizationSummariesRequest, + context).getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateByReservationOrderIdWithResponseAsync(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.generateByReservationOrderId(this.client.getEndpoint(), this.client.getApiVersion(), + reservationOrderId, contentType, accept, benefitUtilizationSummariesRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByReservationOrderIdWithResponse(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByReservationOrderIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + reservationOrderId, contentType, accept, benefitUtilizationSummariesRequest, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByReservationOrderIdWithResponse(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByReservationOrderIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + reservationOrderId, contentType, accept, benefitUtilizationSummariesRequest, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationOrderIdAsync(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Mono>> mono + = generateByReservationOrderIdWithResponseAsync(reservationOrderId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, this.client.getContext()); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Response response + = generateByReservationOrderIdWithResponse(reservationOrderId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + Response response + = generateByReservationOrderIdWithResponse(reservationOrderId, benefitUtilizationSummariesRequest, context); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateByReservationOrderIdAsync( + String reservationOrderId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByReservationOrderIdAsync(reservationOrderId, benefitUtilizationSummariesRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByReservationOrderId(reservationOrderId, benefitUtilizationSummariesRequest) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + return beginGenerateByReservationOrderId(reservationOrderId, benefitUtilizationSummariesRequest, context) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateByReservationIdWithResponseAsync(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateByReservationId(this.client.getEndpoint(), + this.client.getApiVersion(), reservationOrderId, reservationId, contentType, accept, + benefitUtilizationSummariesRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByReservationIdWithResponse(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByReservationIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + reservationOrderId, reservationId, contentType, accept, benefitUtilizationSummariesRequest, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateByReservationIdWithResponse(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateByReservationIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + reservationOrderId, reservationId, contentType, accept, benefitUtilizationSummariesRequest, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationIdAsync(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Mono>> mono = generateByReservationIdWithResponseAsync(reservationOrderId, + reservationId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, this.client.getContext()); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationId(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Response response = generateByReservationIdWithResponse(reservationOrderId, reservationId, + benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateByReservationId(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + Response response = generateByReservationIdWithResponse(reservationOrderId, reservationId, + benefitUtilizationSummariesRequest, context); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateByReservationIdAsync( + String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByReservationIdAsync(reservationOrderId, reservationId, benefitUtilizationSummariesRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByReservationId(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateByReservationId(reservationOrderId, reservationId, benefitUtilizationSummariesRequest) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateByReservationId(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + return beginGenerateByReservationId(reservationOrderId, reservationId, benefitUtilizationSummariesRequest, + context).getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateBySavingsPlanOrderIdWithResponseAsync(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.generateBySavingsPlanOrderId(this.client.getEndpoint(), this.client.getApiVersion(), + savingsPlanOrderId, contentType, accept, benefitUtilizationSummariesRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateBySavingsPlanOrderIdWithResponse(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateBySavingsPlanOrderIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + savingsPlanOrderId, contentType, accept, benefitUtilizationSummariesRequest, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateBySavingsPlanOrderIdWithResponse(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateBySavingsPlanOrderIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + savingsPlanOrderId, contentType, accept, benefitUtilizationSummariesRequest, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanOrderIdAsync(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Mono>> mono + = generateBySavingsPlanOrderIdWithResponseAsync(savingsPlanOrderId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, this.client.getContext()); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Response response + = generateBySavingsPlanOrderIdWithResponse(savingsPlanOrderId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + Response response + = generateBySavingsPlanOrderIdWithResponse(savingsPlanOrderId, benefitUtilizationSummariesRequest, context); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateBySavingsPlanOrderIdAsync( + String savingsPlanOrderId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateBySavingsPlanOrderIdAsync(savingsPlanOrderId, benefitUtilizationSummariesRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateBySavingsPlanOrderId(savingsPlanOrderId, benefitUtilizationSummariesRequest) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + return beginGenerateBySavingsPlanOrderId(savingsPlanOrderId, benefitUtilizationSummariesRequest, context) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateBySavingsPlanIdWithResponseAsync(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateBySavingsPlanId(this.client.getEndpoint(), + this.client.getApiVersion(), savingsPlanOrderId, savingsPlanId, contentType, accept, + benefitUtilizationSummariesRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateBySavingsPlanIdWithResponse(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateBySavingsPlanIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + savingsPlanOrderId, savingsPlanId, contentType, accept, benefitUtilizationSummariesRequest, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateBySavingsPlanIdWithResponse(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateBySavingsPlanIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + savingsPlanOrderId, savingsPlanId, contentType, accept, benefitUtilizationSummariesRequest, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanIdAsync(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Mono>> mono = generateBySavingsPlanIdWithResponseAsync(savingsPlanOrderId, + savingsPlanId, benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, this.client.getContext()); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + Response response = generateBySavingsPlanIdWithResponse(savingsPlanOrderId, savingsPlanId, + benefitUtilizationSummariesRequest); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, Context.NONE); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BenefitUtilizationSummariesOperationStatusInner> + beginGenerateBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + Response response = generateBySavingsPlanIdWithResponse(savingsPlanOrderId, savingsPlanId, + benefitUtilizationSummariesRequest, context); + return this.client + .getLroResult( + response, BenefitUtilizationSummariesOperationStatusInner.class, + BenefitUtilizationSummariesOperationStatusInner.class, context); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateBySavingsPlanIdAsync( + String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateBySavingsPlanIdAsync(savingsPlanOrderId, savingsPlanId, benefitUtilizationSummariesRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanId(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + return beginGenerateBySavingsPlanId(savingsPlanOrderId, savingsPlanId, benefitUtilizationSummariesRequest) + .getFinalResult(); + } + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BenefitUtilizationSummariesOperationStatusInner generateBySavingsPlanId(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + return beginGenerateBySavingsPlanId(savingsPlanOrderId, savingsPlanId, benefitUtilizationSummariesRequest, + context).getFinalResult(); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsImpl.java new file mode 100644 index 000000000000..501f9a5db2ce --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient; +import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.GenerateBenefitUtilizationSummariesReports; + +public final class GenerateBenefitUtilizationSummariesReportsImpl + implements GenerateBenefitUtilizationSummariesReports { + private static final ClientLogger LOGGER = new ClientLogger(GenerateBenefitUtilizationSummariesReportsImpl.class); + + private final GenerateBenefitUtilizationSummariesReportsClient innerClient; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + public GenerateBenefitUtilizationSummariesReportsImpl(GenerateBenefitUtilizationSummariesReportsClient innerClient, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BenefitUtilizationSummariesOperationStatus generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + BenefitUtilizationSummariesOperationStatusInner inner + = this.serviceClient().generateByBillingAccount(billingAccountId, benefitUtilizationSummariesRequest); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateByBillingAccount(billingAccountId, benefitUtilizationSummariesRequest, context); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateByBillingProfile(billingAccountId, billingProfileId, benefitUtilizationSummariesRequest); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateByBillingProfile(billingAccountId, billingProfileId, benefitUtilizationSummariesRequest, context); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + BenefitUtilizationSummariesOperationStatusInner inner + = this.serviceClient().generateByReservationOrderId(reservationOrderId, benefitUtilizationSummariesRequest); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateByReservationOrderId(reservationOrderId, benefitUtilizationSummariesRequest, context); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByReservationId(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateByReservationId(reservationOrderId, reservationId, benefitUtilizationSummariesRequest); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateByReservationId(String reservationOrderId, + String reservationId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateByReservationId(reservationOrderId, reservationId, benefitUtilizationSummariesRequest, context); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + BenefitUtilizationSummariesOperationStatusInner inner + = this.serviceClient().generateBySavingsPlanOrderId(savingsPlanOrderId, benefitUtilizationSummariesRequest); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateBySavingsPlanOrderId(savingsPlanOrderId, benefitUtilizationSummariesRequest, context); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateBySavingsPlanId(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateBySavingsPlanId(savingsPlanOrderId, savingsPlanId, benefitUtilizationSummariesRequest); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BenefitUtilizationSummariesOperationStatus generateBySavingsPlanId(String savingsPlanOrderId, + String savingsPlanId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context) { + BenefitUtilizationSummariesOperationStatusInner inner = this.serviceClient() + .generateBySavingsPlanId(savingsPlanOrderId, savingsPlanId, benefitUtilizationSummariesRequest, context); + if (inner != null) { + return new BenefitUtilizationSummariesOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private GenerateBenefitUtilizationSummariesReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsClientImpl.java index 5eba6ec6eb6e..376633440fc5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -22,6 +22,7 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -45,42 +46,232 @@ public final class GenerateCostDetailsReportsClientImpl implements GenerateCostD /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of GenerateCostDetailsReportsClientImpl. * * @param client the instance of the service client containing this operation class. */ - GenerateCostDetailsReportsClientImpl(CostManagementClientImpl client) { + GenerateCostDetailsReportsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(GenerateCostDetailsReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientGenerateCostDetailsReports to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for CostManagementManagementClientGenerateCostDetailsReports to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientGenerateCostDetailsReports") public interface GenerateCostDetailsReportsService { @Headers({ "Content-Type: application/json" }) - @Post("/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOperation(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenerateCostDetailsReportRequestDefinition parameters, - @HeaderParam("Accept") String accept, Context context); + Mono>> getOperationResults(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> getOperationResults(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getOperationResultsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Post("/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOperation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateCostDetailsReportRequestDefinition parameters, Context context); + + @Post("/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateCostDetailsReportRequestDefinition parameters, Context context); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getOperationResultsWithResponseAsync(String scope, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getOperationResults(this.client.getEndpoint(), this.client.getApiVersion(), + scope, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getOperationResultsWithResponse(String scope, String operationId) { + final String accept = "application/json"; + return service.getOperationResultsSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, + operationId, accept, Context.NONE); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getOperationResultsWithResponse(String scope, String operationId, Context context) { + final String accept = "application/json"; + return service.getOperationResultsSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, + operationId, accept, context); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CostDetailsOperationResultsInner> + beginGetOperationResultsAsync(String scope, String operationId) { + Mono>> mono = getOperationResultsWithResponseAsync(scope, operationId); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CostDetailsOperationResultsInner.class, + CostDetailsOperationResultsInner.class, this.client.getContext()); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CostDetailsOperationResultsInner> + beginGetOperationResults(String scope, String operationId) { + Response response = getOperationResultsWithResponse(scope, operationId); + return this.client.getLroResult(response, + CostDetailsOperationResultsInner.class, CostDetailsOperationResultsInner.class, Context.NONE); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CostDetailsOperationResultsInner> + beginGetOperationResults(String scope, String operationId, Context context) { + Response response = getOperationResultsWithResponse(scope, operationId, context); + return this.client.getLroResult(response, + CostDetailsOperationResultsInner.class, CostDetailsOperationResultsInner.class, context); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOperationResultsAsync(String scope, String operationId) { + return beginGetOperationResultsAsync(scope, operationId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CostDetailsOperationResultsInner getOperationResults(String scope, String operationId) { + return beginGetOperationResults(scope, operationId).getFinalResult(); + } + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CostDetailsOperationResultsInner getOperationResults(String scope, String operationId, Context context) { + return beginGetOperationResults(scope, operationId, context).getFinalResult(); } /** @@ -93,10 +284,11 @@ Mono>> getOperationResults(@HostParam("$host") String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -107,22 +299,11 @@ Mono>> getOperationResults(@HostParam("$host") String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOperationWithResponseAsync(String scope, GenerateCostDetailsReportRequestDefinition parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOperation(this.client.getEndpoint(), scope, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOperation(this.client.getEndpoint(), this.client.getApiVersion(), + scope, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -136,37 +317,24 @@ private Mono>> createOperationWithResponseAsync(String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. - * @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 result of the long running operation for cost details Api along with {@link Response} on successful - * completion of {@link Mono}. + * @return the result of the long running operation for cost details Api along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOperationWithResponseAsync(String scope, - GenerateCostDetailsReportRequestDefinition parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOperationWithResponse(String scope, + GenerateCostDetailsReportRequestDefinition parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOperation(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, - accept, context); + return service.createOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, + accept, parameters, Context.NONE); } /** @@ -179,23 +347,25 @@ private Mono>> createOperationWithResponseAsync(String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. + * @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 the result of the long running operation for cost details Api. + * @return the result of the long running operation for cost details Api along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CostDetailsOperationResultsInner> - beginCreateOperationAsync(String scope, GenerateCostDetailsReportRequestDefinition parameters) { - Mono>> mono = createOperationWithResponseAsync(scope, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CostDetailsOperationResultsInner.class, - CostDetailsOperationResultsInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOperationWithResponse(String scope, + GenerateCostDetailsReportRequestDefinition parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, + accept, parameters, context); } /** @@ -208,12 +378,12 @@ private Mono>> createOperationWithResponseAsync(String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. - * @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. @@ -221,13 +391,11 @@ private Mono>> createOperationWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CostDetailsOperationResultsInner> - beginCreateOperationAsync(String scope, GenerateCostDetailsReportRequestDefinition parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOperationWithResponseAsync(scope, parameters, context); + beginCreateOperationAsync(String scope, GenerateCostDetailsReportRequestDefinition parameters) { + Mono>> mono = createOperationWithResponseAsync(scope, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), CostDetailsOperationResultsInner.class, - CostDetailsOperationResultsInner.class, context); + CostDetailsOperationResultsInner.class, this.client.getContext()); } /** @@ -240,10 +408,11 @@ private Mono>> createOperationWithResponseAsync(String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -253,7 +422,9 @@ private Mono>> createOperationWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CostDetailsOperationResultsInner> beginCreateOperation(String scope, GenerateCostDetailsReportRequestDefinition parameters) { - return this.beginCreateOperationAsync(scope, parameters).getSyncPoller(); + Response response = createOperationWithResponse(scope, parameters); + return this.client.getLroResult(response, + CostDetailsOperationResultsInner.class, CostDetailsOperationResultsInner.class, Context.NONE); } /** @@ -266,10 +437,11 @@ private Mono>> createOperationWithResponseAsync(String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -280,7 +452,9 @@ private Mono>> createOperationWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CostDetailsOperationResultsInner> beginCreateOperation(String scope, GenerateCostDetailsReportRequestDefinition parameters, Context context) { - return this.beginCreateOperationAsync(scope, parameters, context).getSyncPoller(); + Response response = createOperationWithResponse(scope, parameters, context); + return this.client.getLroResult(response, + CostDetailsOperationResultsInner.class, CostDetailsOperationResultsInner.class, context); } /** @@ -293,10 +467,11 @@ private Mono>> createOperationWithResponseAsync(String * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -319,38 +494,11 @@ private Mono createOperationAsync(String scope * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param parameters Parameters supplied to the Create cost details operation. - * @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 result of the long running operation for cost details Api on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOperationAsync(String scope, - GenerateCostDetailsReportRequestDefinition parameters, Context context) { - return beginCreateOperationAsync(scope, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details - * report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a - * certain scope. The initial call to request a report will return a 202 with a 'Location' and 'Retry-After' header. - * The 'Location' header will provide the endpoint to poll to get the result of the report generation. The - * 'Retry-After' provides the duration to wait before polling for the generated report. A call to poll the report - * operation will provide a 202 response with a 'Location' header if the operation is still in progress. Once the - * report generation operation completes, the polling endpoint will provide a 200 response along with details on the - * report blob(s) that are available for download. The details on the file(s) available for download will be - * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -360,7 +508,7 @@ private Mono createOperationAsync(String scope @ServiceMethod(returns = ReturnType.SINGLE) public CostDetailsOperationResultsInner createOperation(String scope, GenerateCostDetailsReportRequestDefinition parameters) { - return createOperationAsync(scope, parameters).block(); + return beginCreateOperation(scope, parameters).getFinalResult(); } /** @@ -373,10 +521,11 @@ public CostDetailsOperationResultsInner createOperation(String scope, * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -387,224 +536,6 @@ public CostDetailsOperationResultsInner createOperation(String scope, @ServiceMethod(returns = ReturnType.SINGLE) public CostDetailsOperationResultsInner createOperation(String scope, GenerateCostDetailsReportRequestDefinition parameters, Context context) { - return createOperationAsync(scope, parameters, context).block(); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getOperationResultsWithResponseAsync(String scope, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getOperationResults(this.client.getEndpoint(), scope, operationId, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getOperationResultsWithResponseAsync(String scope, String operationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getOperationResults(this.client.getEndpoint(), scope, operationId, this.client.getApiVersion(), - accept, context); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CostDetailsOperationResultsInner> - beginGetOperationResultsAsync(String scope, String operationId) { - Mono>> mono = getOperationResultsWithResponseAsync(scope, operationId); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CostDetailsOperationResultsInner.class, - CostDetailsOperationResultsInner.class, this.client.getContext()); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CostDetailsOperationResultsInner> - beginGetOperationResultsAsync(String scope, String operationId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = getOperationResultsWithResponseAsync(scope, operationId, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CostDetailsOperationResultsInner.class, - CostDetailsOperationResultsInner.class, context); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CostDetailsOperationResultsInner> - beginGetOperationResults(String scope, String operationId) { - return this.beginGetOperationResultsAsync(scope, operationId).getSyncPoller(); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CostDetailsOperationResultsInner> - beginGetOperationResults(String scope, String operationId, Context context) { - return this.beginGetOperationResultsAsync(scope, operationId, context).getSyncPoller(); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationResultsAsync(String scope, String operationId) { - return beginGetOperationResultsAsync(scope, operationId).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationResultsAsync(String scope, String operationId, - Context context) { - return beginGetOperationResultsAsync(scope, operationId, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CostDetailsOperationResultsInner getOperationResults(String scope, String operationId) { - return getOperationResultsAsync(scope, operationId).block(); - } - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CostDetailsOperationResultsInner getOperationResults(String scope, String operationId, Context context) { - return getOperationResultsAsync(scope, operationId, context).block(); + return beginCreateOperation(scope, parameters, context).getFinalResult(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsImpl.java index 67aee2bac04e..ce1b2b973c97 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -25,9 +25,8 @@ public GenerateCostDetailsReportsImpl(GenerateCostDetailsReportsClient innerClie this.serviceManager = serviceManager; } - public CostDetailsOperationResults createOperation(String scope, - GenerateCostDetailsReportRequestDefinition parameters) { - CostDetailsOperationResultsInner inner = this.serviceClient().createOperation(scope, parameters); + public CostDetailsOperationResults getOperationResults(String scope, String operationId) { + CostDetailsOperationResultsInner inner = this.serviceClient().getOperationResults(scope, operationId); if (inner != null) { return new CostDetailsOperationResultsImpl(inner, this.manager()); } else { @@ -35,9 +34,8 @@ public CostDetailsOperationResults createOperation(String scope, } } - public CostDetailsOperationResults createOperation(String scope, - GenerateCostDetailsReportRequestDefinition parameters, Context context) { - CostDetailsOperationResultsInner inner = this.serviceClient().createOperation(scope, parameters, context); + public CostDetailsOperationResults getOperationResults(String scope, String operationId, Context context) { + CostDetailsOperationResultsInner inner = this.serviceClient().getOperationResults(scope, operationId, context); if (inner != null) { return new CostDetailsOperationResultsImpl(inner, this.manager()); } else { @@ -45,8 +43,9 @@ public CostDetailsOperationResults createOperation(String scope, } } - public CostDetailsOperationResults getOperationResults(String scope, String operationId) { - CostDetailsOperationResultsInner inner = this.serviceClient().getOperationResults(scope, operationId); + public CostDetailsOperationResults createOperation(String scope, + GenerateCostDetailsReportRequestDefinition parameters) { + CostDetailsOperationResultsInner inner = this.serviceClient().createOperation(scope, parameters); if (inner != null) { return new CostDetailsOperationResultsImpl(inner, this.manager()); } else { @@ -54,8 +53,9 @@ public CostDetailsOperationResults getOperationResults(String scope, String oper } } - public CostDetailsOperationResults getOperationResults(String scope, String operationId, Context context) { - CostDetailsOperationResultsInner inner = this.serviceClient().getOperationResults(scope, operationId, context); + public CostDetailsOperationResults createOperation(String scope, + GenerateCostDetailsReportRequestDefinition parameters, Context context) { + CostDetailsOperationResultsInner inner = this.serviceClient().createOperation(scope, parameters, context); if (inner != null) { return new CostDetailsOperationResultsImpl(inner, this.manager()); } else { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultImpl.java index 04624df7cadd..32625cdc72f1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.GenerateDetailedCostReportOperationResultInner; import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportOperationResult; import java.time.OffsetDateTime; @@ -31,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public OffsetDateTime expiryTime() { return this.innerModel().expiryTime(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsClientImpl.java index acd4da82a896..bcb84a90a913 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -20,6 +20,7 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -44,33 +45,42 @@ public final class GenerateDetailedCostReportOperationResultsClientImpl /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of GenerateDetailedCostReportOperationResultsClientImpl. * * @param client the instance of the service client containing this operation class. */ - GenerateDetailedCostReportOperationResultsClientImpl(CostManagementClientImpl client) { + GenerateDetailedCostReportOperationResultsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(GenerateDetailedCostReportOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientGenerateDetailedCostReportOperationResults to be - * used by the proxy service to perform REST calls. + * The interface defining all the services for + * CostManagementManagementClientGenerateDetailedCostReportOperationResults to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientGenerateDetailedCostReportOperationResults") public interface GenerateDetailedCostReportOperationResultsService { @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> get(@HostParam("$host") String endpoint, - @PathParam("operationId") String operationId, @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono>> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); } /** @@ -78,8 +88,7 @@ Mono>> get(@HostParam("$host") String endpoint, * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -88,20 +97,10 @@ Mono>> get(@HostParam("$host") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> getWithResponseAsync(String operationId, String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId 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.get(this.client.getEndpoint(), operationId, scope, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, + operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -110,30 +109,17 @@ private Mono>> getWithResponseAsync(String operationId * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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 result of the specified operation along with {@link Response} on successful completion of - * {@link Mono}. + * @return the result of the specified operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getWithResponseAsync(String operationId, 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 (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } + private Response getWithResponse(String operationId, String scope) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), operationId, scope, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, operationId, accept, + Context.NONE); } /** @@ -141,22 +127,18 @@ private Mono>> getWithResponseAsync(String operationId * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @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 the result of the specified operation. + * @return the result of the specified operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, GenerateDetailedCostReportOperationResultInner> - beginGetAsync(String operationId, String scope) { - Mono>> mono = getWithResponseAsync(operationId, scope); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), GenerateDetailedCostReportOperationResultInner.class, - GenerateDetailedCostReportOperationResultInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String operationId, String scope, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, operationId, accept, + context); } /** @@ -164,9 +146,7 @@ private Mono>> getWithResponseAsync(String operationId * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -175,13 +155,12 @@ private Mono>> getWithResponseAsync(String operationId @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, GenerateDetailedCostReportOperationResultInner> - beginGetAsync(String operationId, String scope, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = getWithResponseAsync(operationId, scope, context); + beginGetAsync(String operationId, String scope) { + Mono>> mono = getWithResponseAsync(operationId, scope); return this.client .getLroResult( mono, this.client.getHttpPipeline(), GenerateDetailedCostReportOperationResultInner.class, - GenerateDetailedCostReportOperationResultInner.class, context); + GenerateDetailedCostReportOperationResultInner.class, this.client.getContext()); } /** @@ -189,8 +168,7 @@ private Mono>> getWithResponseAsync(String operationId * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -200,7 +178,11 @@ private Mono>> getWithResponseAsync(String operationId public SyncPoller, GenerateDetailedCostReportOperationResultInner> beginGet(String operationId, String scope) { - return this.beginGetAsync(operationId, scope).getSyncPoller(); + Response response = getWithResponse(operationId, scope); + return this.client + .getLroResult( + response, GenerateDetailedCostReportOperationResultInner.class, + GenerateDetailedCostReportOperationResultInner.class, Context.NONE); } /** @@ -208,8 +190,7 @@ private Mono>> getWithResponseAsync(String operationId * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -220,7 +201,11 @@ private Mono>> getWithResponseAsync(String operationId public SyncPoller, GenerateDetailedCostReportOperationResultInner> beginGet(String operationId, String scope, Context context) { - return this.beginGetAsync(operationId, scope, context).getSyncPoller(); + Response response = getWithResponse(operationId, scope, context); + return this.client + .getLroResult( + response, GenerateDetailedCostReportOperationResultInner.class, + GenerateDetailedCostReportOperationResultInner.class, context); } /** @@ -228,8 +213,7 @@ private Mono>> getWithResponseAsync(String operationId * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -245,27 +229,7 @@ private Mono getAsync(String ope * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @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 result of the specified operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String operationId, String scope, - Context context) { - return beginGetAsync(operationId, scope, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets the result of the specified operation. The link with this operationId is provided as a response header of - * the initial request. - * - * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -273,7 +237,7 @@ private Mono getAsync(String ope */ @ServiceMethod(returns = ReturnType.SINGLE) public GenerateDetailedCostReportOperationResultInner get(String operationId, String scope) { - return getAsync(operationId, scope).block(); + return beginGet(operationId, scope).getFinalResult(); } /** @@ -281,8 +245,7 @@ public GenerateDetailedCostReportOperationResultInner get(String operationId, St * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -291,6 +254,6 @@ public GenerateDetailedCostReportOperationResultInner get(String operationId, St */ @ServiceMethod(returns = ReturnType.SINGLE) public GenerateDetailedCostReportOperationResultInner get(String operationId, String scope, Context context) { - return getAsync(operationId, scope, context).block(); + return beginGet(operationId, scope, context).getFinalResult(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsImpl.java index 5c8bcf301c8c..15308ad3b2b5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusClientImpl.java index 8869ad28f1d7..ac9bce1fc701 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -39,33 +39,42 @@ public final class GenerateDetailedCostReportOperationStatusClientImpl /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of GenerateDetailedCostReportOperationStatusClientImpl. * * @param client the instance of the service client containing this operation class. */ - GenerateDetailedCostReportOperationStatusClientImpl(CostManagementClientImpl client) { + GenerateDetailedCostReportOperationStatusClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(GenerateDetailedCostReportOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientGenerateDetailedCostReportOperationStatus to be - * used by the proxy service to perform REST calls. + * The interface defining all the services for + * CostManagementManagementClientGenerateDetailedCostReportOperationStatus to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientGenerateDetailedCostReportOperationStatus") public interface GenerateDetailedCostReportOperationStatusService { @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("operationId") String operationId, @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); } /** @@ -73,8 +82,7 @@ Mono> get(@HostParam( * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -84,20 +92,10 @@ Mono> get(@HostParam( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String operationId, String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId 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.get(this.client.getEndpoint(), operationId, scope, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, + operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -106,40 +104,7 @@ private Mono> getWith * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @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 status of the specified operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String operationId, - 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 (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId 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.get(this.client.getEndpoint(), operationId, scope, this.client.getApiVersion(), accept, context); - } - - /** - * Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation - * request response header. - * - * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -155,8 +120,7 @@ private Mono getAsync(String o * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -166,7 +130,9 @@ private Mono getAsync(String o @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String operationId, String scope, Context context) { - return getWithResponseAsync(operationId, scope, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, operationId, accept, + context); } /** @@ -174,8 +140,7 @@ public Response getWithRespons * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusImpl.java index 54a96ac15867..be88c736dcf7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -30,12 +30,8 @@ public Response getWithResponse(Str Context context) { Response inner = this.serviceClient().getWithResponse(operationId, scope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GenerateDetailedCostReportOperationStatusesImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GenerateDetailedCostReportOperationStatusesImpl(inner.getValue(), this.manager())); } public GenerateDetailedCostReportOperationStatuses get(String operationId, String scope) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusesImpl.java index 72383453ae3c..28efeb168bd1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusesImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusesImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; +import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.costmanagement.fluent.models.GenerateDetailedCostReportOperationStatusesInner; import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportOperationStatuses; @@ -30,6 +31,10 @@ public String name() { return this.innerModel().name(); } + public String type() { + return this.innerModel().type(); + } + public Status status() { return this.innerModel().status(); } @@ -42,14 +47,14 @@ public String endTime() { return this.innerModel().endTime(); } - public String type() { - return this.innerModel().type(); - } - public ManagementError error() { return this.innerModel().error(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public OffsetDateTime expiryTime() { return this.innerModel().expiryTime(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsClientImpl.java index dfbb52b0f822..2f9ce1621be4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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; @@ -21,6 +20,7 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -44,34 +44,41 @@ public final class GenerateDetailedCostReportsClientImpl implements GenerateDeta /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of GenerateDetailedCostReportsClientImpl. * * @param client the instance of the service client containing this operation class. */ - GenerateDetailedCostReportsClientImpl(CostManagementClientImpl client) { + GenerateDetailedCostReportsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(GenerateDetailedCostReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientGenerateDetailedCostReports to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for CostManagementManagementClientGenerateDetailedCostReports to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientGenerateDetailedCostReports") public interface GenerateDetailedCostReportsService { - @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOperation(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenerateDetailedCostReportDefinition parameters, - @HeaderParam("Accept") String accept, Context context); + Mono>> createOperation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateDetailedCostReportDefinition parameters, Context context); + + @Post("/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateDetailedCostReportDefinition parameters, Context context); } /** @@ -92,22 +99,11 @@ Mono>> createOperation(@HostParam("$host") String endp @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOperationWithResponseAsync(String scope, GenerateDetailedCostReportDefinition parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOperation(this.client.getEndpoint(), scope, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOperation(this.client.getEndpoint(), this.client.getApiVersion(), + scope, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -120,32 +116,18 @@ private Mono>> createOperationWithResponseAsync(String * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For * details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create detailed cost report operation. - * @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 result of the long running operation for cost detailed report along with {@link Response} on - * successful completion of {@link Mono}. + * @return the result of the long running operation for cost detailed report along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOperationWithResponseAsync(String scope, - GenerateDetailedCostReportDefinition parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOperationWithResponse(String scope, + GenerateDetailedCostReportDefinition parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOperation(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, - accept, context); + return service.createOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, + accept, parameters, Context.NONE); } /** @@ -157,20 +139,19 @@ private Mono>> createOperationWithResponseAsync(String * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For * details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create detailed cost report operation. + * @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 the result of the long running operation for cost detailed report. + * @return the result of the long running operation for cost detailed report along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, GenerateDetailedCostReportOperationResultInner> - beginCreateOperationAsync(String scope, GenerateDetailedCostReportDefinition parameters) { - Mono>> mono = createOperationWithResponseAsync(scope, parameters); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), GenerateDetailedCostReportOperationResultInner.class, - GenerateDetailedCostReportOperationResultInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOperationWithResponse(String scope, + GenerateDetailedCostReportDefinition parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOperationSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, + accept, parameters, context); } /** @@ -182,7 +163,6 @@ private Mono>> createOperationWithResponseAsync(String * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For * details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create detailed cost report operation. - * @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. @@ -191,13 +171,12 @@ private Mono>> createOperationWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, GenerateDetailedCostReportOperationResultInner> - beginCreateOperationAsync(String scope, GenerateDetailedCostReportDefinition parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOperationWithResponseAsync(scope, parameters, context); + beginCreateOperationAsync(String scope, GenerateDetailedCostReportDefinition parameters) { + Mono>> mono = createOperationWithResponseAsync(scope, parameters); return this.client .getLroResult( mono, this.client.getHttpPipeline(), GenerateDetailedCostReportOperationResultInner.class, - GenerateDetailedCostReportOperationResultInner.class, context); + GenerateDetailedCostReportOperationResultInner.class, this.client.getContext()); } /** @@ -218,7 +197,11 @@ private Mono>> createOperationWithResponseAsync(String public SyncPoller, GenerateDetailedCostReportOperationResultInner> beginCreateOperation(String scope, GenerateDetailedCostReportDefinition parameters) { - return this.beginCreateOperationAsync(scope, parameters).getSyncPoller(); + Response response = createOperationWithResponse(scope, parameters); + return this.client + .getLroResult( + response, GenerateDetailedCostReportOperationResultInner.class, + GenerateDetailedCostReportOperationResultInner.class, Context.NONE); } /** @@ -240,7 +223,11 @@ private Mono>> createOperationWithResponseAsync(String public SyncPoller, GenerateDetailedCostReportOperationResultInner> beginCreateOperation(String scope, GenerateDetailedCostReportDefinition parameters, Context context) { - return this.beginCreateOperationAsync(scope, parameters, context).getSyncPoller(); + Response response = createOperationWithResponse(scope, parameters, context); + return this.client + .getLroResult( + response, GenerateDetailedCostReportOperationResultInner.class, + GenerateDetailedCostReportOperationResultInner.class, context); } /** @@ -264,29 +251,6 @@ private Mono createOperationAsyn return beginCreateOperationAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Generates the detailed cost report for provided date range, billing period(only enterprise customers) or Invoice - * ID asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a - * link to the operation created. A call on the operation will provide the status and if the operation is completed - * the blob file where generated detailed cost report is being stored. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param parameters Parameters supplied to the Create detailed cost report operation. - * @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 result of the long running operation for cost detailed report on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOperationAsync(String scope, - GenerateDetailedCostReportDefinition parameters, Context context) { - return beginCreateOperationAsync(scope, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Generates the detailed cost report for provided date range, billing period(only enterprise customers) or Invoice * ID asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a @@ -304,7 +268,7 @@ private Mono createOperationAsyn @ServiceMethod(returns = ReturnType.SINGLE) public GenerateDetailedCostReportOperationResultInner createOperation(String scope, GenerateDetailedCostReportDefinition parameters) { - return createOperationAsync(scope, parameters).block(); + return beginCreateOperation(scope, parameters).getFinalResult(); } /** @@ -325,6 +289,6 @@ public GenerateDetailedCostReportOperationResultInner createOperation(String sco @ServiceMethod(returns = ReturnType.SINGLE) public GenerateDetailedCostReportOperationResultInner createOperation(String scope, GenerateDetailedCostReportDefinition parameters, Context context) { - return createOperationAsync(scope, parameters, context).block(); + return beginCreateOperation(scope, parameters, context).getFinalResult(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsImpl.java index 50b90587fbc6..de1762bc2017 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsClientImpl.java index 237dc35bdf42..93b005867cbb 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -20,6 +20,7 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -42,52 +43,69 @@ public final class GenerateReservationDetailsReportsClientImpl implements Genera /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of GenerateReservationDetailsReportsClientImpl. * * @param client the instance of the service client containing this operation class. */ - GenerateReservationDetailsReportsClientImpl(CostManagementClientImpl client) { + GenerateReservationDetailsReportsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(GenerateReservationDetailsReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientGenerateReservationDetailsReports to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for CostManagementManagementClientGenerateReservationDetailsReports to be + * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientGenerateReservationDetailsReports") public interface GenerateReservationDetailsReportsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> byBillingAccountId(@HostParam("$host") String endpoint, - @PathParam("billingAccountId") String billingAccountId, @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, @QueryParam("api-version") String apiVersion, + Mono>> byBillingAccountId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> byBillingProfileId(@HostParam("$host") String endpoint, - @PathParam("billingAccountId") String billingAccountId, - @PathParam("billingProfileId") String billingProfileId, @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, @QueryParam("api-version") String apiVersion, + Response byBillingAccountIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> byBillingProfileId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("startDate") String startDate, + @QueryParam("endDate") String endDate, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response byBillingProfileIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("startDate") String startDate, + @QueryParam("endDate") String endDate, @HeaderParam("Accept") String accept, Context context); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -99,96 +117,64 @@ Mono>> byBillingProfileId(@HostParam("$host") String e @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> byBillingAccountIdWithResponseAsync(String billingAccountId, String startDate, String endDate) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - if (startDate == null) { - return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); - } - if (endDate == null) { - return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.byBillingAccountId(this.client.getEndpoint(), billingAccountId, startDate, - endDate, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.byBillingAccountId(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, startDate, endDate, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. - * @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 status of the long running operation along with {@link Response} on successful completion of - * {@link Mono}. + * @return the status of the long running operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> byBillingAccountIdWithResponseAsync(String billingAccountId, - String startDate, String endDate, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - if (startDate == null) { - return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); - } - if (endDate == null) { - return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); - } + private Response byBillingAccountIdWithResponse(String billingAccountId, String startDate, + String endDate) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.byBillingAccountId(this.client.getEndpoint(), billingAccountId, startDate, endDate, - this.client.getApiVersion(), accept, context); + return service.byBillingAccountIdSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + startDate, endDate, accept, Context.NONE); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. + * @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 the status of the long running operation. + * @return the status of the long running operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusInner> - beginByBillingAccountIdAsync(String billingAccountId, String startDate, String endDate) { - Mono>> mono - = byBillingAccountIdWithResponseAsync(billingAccountId, startDate, endDate); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - OperationStatusInner.class, OperationStatusInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response byBillingAccountIdWithResponse(String billingAccountId, String startDate, + String endDate, Context context) { + final String accept = "application/json"; + return service.byBillingAccountIdSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + startDate, endDate, accept, context); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. - * @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. @@ -196,20 +182,19 @@ private Mono>> byBillingAccountIdWithResponseAsync(Str */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusInner> - beginByBillingAccountIdAsync(String billingAccountId, String startDate, String endDate, Context context) { - context = this.client.mergeContext(context); + beginByBillingAccountIdAsync(String billingAccountId, String startDate, String endDate) { Mono>> mono - = byBillingAccountIdWithResponseAsync(billingAccountId, startDate, endDate, context); + = byBillingAccountIdWithResponseAsync(billingAccountId, startDate, endDate); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - OperationStatusInner.class, OperationStatusInner.class, context); + OperationStatusInner.class, OperationStatusInner.class, this.client.getContext()); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -220,15 +205,17 @@ private Mono>> byBillingAccountIdWithResponseAsync(Str @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusInner> beginByBillingAccountId(String billingAccountId, String startDate, String endDate) { - return this.beginByBillingAccountIdAsync(billingAccountId, startDate, endDate).getSyncPoller(); + Response response = byBillingAccountIdWithResponse(billingAccountId, startDate, endDate); + return this.client.getLroResult(response, + OperationStatusInner.class, OperationStatusInner.class, Context.NONE); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -240,15 +227,17 @@ private Mono>> byBillingAccountIdWithResponseAsync(Str @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusInner> beginByBillingAccountId(String billingAccountId, String startDate, String endDate, Context context) { - return this.beginByBillingAccountIdAsync(billingAccountId, startDate, endDate, context).getSyncPoller(); + Response response = byBillingAccountIdWithResponse(billingAccountId, startDate, endDate, context); + return this.client.getLroResult(response, + OperationStatusInner.class, OperationStatusInner.class, context); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,30 +255,9 @@ private Mono byBillingAccountIdAsync(String billingAccount /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. - * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). - * @param startDate Start Date. - * @param endDate End Date. - * @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 status of the long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono byBillingAccountIdAsync(String billingAccountId, String startDate, - String endDate, Context context) { - return beginByBillingAccountIdAsync(billingAccountId, startDate, endDate, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates the reservations details report for provided date range asynchronously based on enrollment id. The - * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,15 +267,15 @@ private Mono byBillingAccountIdAsync(String billingAccount */ @ServiceMethod(returns = ReturnType.SINGLE) public OperationStatusInner byBillingAccountId(String billingAccountId, String startDate, String endDate) { - return byBillingAccountIdAsync(billingAccountId, startDate, endDate).block(); + return beginByBillingAccountId(billingAccountId, startDate, endDate).getFinalResult(); } /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -319,17 +287,17 @@ public OperationStatusInner byBillingAccountId(String billingAccountId, String s @ServiceMethod(returns = ReturnType.SINGLE) public OperationStatusInner byBillingAccountId(String billingAccountId, String startDate, String endDate, Context context) { - return byBillingAccountIdAsync(billingAccountId, startDate, endDate, context).block(); + return beginByBillingAccountId(billingAccountId, startDate, endDate, context).getFinalResult(); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -341,28 +309,10 @@ public OperationStatusInner byBillingAccountId(String billingAccountId, String s @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> byBillingProfileIdWithResponseAsync(String billingAccountId, String billingProfileId, String startDate, String endDate) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - if (billingProfileId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); - } - if (startDate == null) { - return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); - } - if (endDate == null) { - return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.byBillingProfileId(this.client.getEndpoint(), billingAccountId, - billingProfileId, startDate, endDate, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.byBillingProfileId(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, startDate, endDate, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -370,81 +320,59 @@ private Mono>> byBillingProfileIdWithResponseAsync(Str * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. - * @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 status of the long running operation along with {@link Response} on successful completion of - * {@link Mono}. + * @return the status of the long running operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> byBillingProfileIdWithResponseAsync(String billingAccountId, - String billingProfileId, String startDate, String endDate, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); - } - if (billingProfileId == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); - } - if (startDate == null) { - return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); - } - if (endDate == null) { - return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); - } + private Response byBillingProfileIdWithResponse(String billingAccountId, String billingProfileId, + String startDate, String endDate) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.byBillingProfileId(this.client.getEndpoint(), billingAccountId, billingProfileId, startDate, - endDate, this.client.getApiVersion(), accept, context); + return service.byBillingProfileIdSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + billingProfileId, startDate, endDate, accept, Context.NONE); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. + * @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 the status of the long running operation. + * @return the status of the long running operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusInner> beginByBillingProfileIdAsync( - String billingAccountId, String billingProfileId, String startDate, String endDate) { - Mono>> mono - = byBillingProfileIdWithResponseAsync(billingAccountId, billingProfileId, startDate, endDate); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - OperationStatusInner.class, OperationStatusInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response byBillingProfileIdWithResponse(String billingAccountId, String billingProfileId, + String startDate, String endDate, Context context) { + final String accept = "application/json"; + return service.byBillingProfileIdSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + billingProfileId, startDate, endDate, accept, context); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. - * @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. @@ -452,22 +380,21 @@ private PollerFlux, OperationStatusInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusInner> beginByBillingProfileIdAsync( - String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { - context = this.client.mergeContext(context); + String billingAccountId, String billingProfileId, String startDate, String endDate) { Mono>> mono - = byBillingProfileIdWithResponseAsync(billingAccountId, billingProfileId, startDate, endDate, context); + = byBillingProfileIdWithResponseAsync(billingAccountId, billingProfileId, startDate, endDate); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - OperationStatusInner.class, OperationStatusInner.class, context); + OperationStatusInner.class, OperationStatusInner.class, this.client.getContext()); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -478,18 +405,20 @@ private PollerFlux, OperationStatusInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusInner> beginByBillingProfileId(String billingAccountId, String billingProfileId, String startDate, String endDate) { - return this.beginByBillingProfileIdAsync(billingAccountId, billingProfileId, startDate, endDate) - .getSyncPoller(); + Response response + = byBillingProfileIdWithResponse(billingAccountId, billingProfileId, startDate, endDate); + return this.client.getLroResult(response, + OperationStatusInner.class, OperationStatusInner.class, Context.NONE); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -501,18 +430,20 @@ private PollerFlux, OperationStatusInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusInner> beginByBillingProfileId( String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { - return this.beginByBillingProfileIdAsync(billingAccountId, billingProfileId, startDate, endDate, context) - .getSyncPoller(); + Response response + = byBillingProfileIdWithResponse(billingAccountId, billingProfileId, startDate, endDate, context); + return this.client.getLroResult(response, + OperationStatusInner.class, OperationStatusInner.class, context); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -531,33 +462,10 @@ private Mono byBillingProfileIdAsync(String billingAccount * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. - * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. - * @param startDate Start Date. - * @param endDate End Date. - * @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 status of the long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono byBillingProfileIdAsync(String billingAccountId, String billingProfileId, - String startDate, String endDate, Context context) { - return beginByBillingProfileIdAsync(billingAccountId, billingProfileId, startDate, endDate, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates the reservations details report for provided date range asynchronously by billing profile. The - * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the - * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -568,17 +476,17 @@ private Mono byBillingProfileIdAsync(String billingAccount @ServiceMethod(returns = ReturnType.SINGLE) public OperationStatusInner byBillingProfileId(String billingAccountId, String billingProfileId, String startDate, String endDate) { - return byBillingProfileIdAsync(billingAccountId, billingProfileId, startDate, endDate).block(); + return beginByBillingProfileId(billingAccountId, billingProfileId, startDate, endDate).getFinalResult(); } /** * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -590,6 +498,7 @@ public OperationStatusInner byBillingProfileId(String billingAccountId, String b @ServiceMethod(returns = ReturnType.SINGLE) public OperationStatusInner byBillingProfileId(String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { - return byBillingProfileIdAsync(billingAccountId, billingProfileId, startDate, endDate, context).block(); + return beginByBillingProfileId(billingAccountId, billingProfileId, startDate, endDate, context) + .getFinalResult(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsImpl.java index feceac78ccba..40c6b7d8f3af 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRuleImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRuleImpl.java new file mode 100644 index 000000000000..7976f4326335 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRuleImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.models.MarkupRule; +import com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties; + +public final class MarkupRuleImpl implements MarkupRule { + private MarkupRuleInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + MarkupRuleImpl(MarkupRuleInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager 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 MarkupRuleProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MarkupRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesClientImpl.java new file mode 100644 index 000000000000..40ffd5752e84 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesClientImpl.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.implementation.models.MarkupRulePagedResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MarkupRulesClient. + */ +public final class MarkupRulesClientImpl implements MarkupRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final MarkupRulesService service; + + /** + * The service client containing this operation class. + */ + private final CostManagementManagementClientImpl client; + + /** + * Initializes an instance of MarkupRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MarkupRulesClientImpl(CostManagementManagementClientImpl client) { + this.service + = RestProxy.create(MarkupRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CostManagementManagementClientMarkupRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientMarkupRules") + public interface MarkupRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @PathParam("ruleName") String ruleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MarkupRuleInner resource, Context context); + + @Put("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @PathParam("ruleName") String ruleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MarkupRuleInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{ruleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @PathParam("ruleName") String ruleName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{ruleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @PathParam("ruleName") String ruleName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 markup rule by name for a billing account and billing profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String billingAccountId, String billingProfileId, + String ruleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, ruleName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 markup rule by name for a billing account and billing profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String billingAccountId, String billingProfileId, String ruleName) { + return getWithResponseAsync(billingAccountId, billingProfileId, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 markup rule by name for a billing account and billing profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + billingProfileId, ruleName, accept, context); + } + + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 markup rule by name for a billing account and billing profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarkupRuleInner get(String billingAccountId, String billingProfileId, String ruleName) { + return getWithResponse(billingAccountId, billingProfileId, ruleName, Context.NONE).getValue(); + } + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String billingAccountId, + String billingProfileId, String ruleName, MarkupRuleInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, ruleName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String billingAccountId, String billingProfileId, String ruleName, + MarkupRuleInner resource) { + return createOrUpdateWithResponseAsync(billingAccountId, billingProfileId, ruleName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String billingAccountId, String billingProfileId, + String ruleName, MarkupRuleInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + billingProfileId, ruleName, contentType, accept, resource, context); + } + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarkupRuleInner createOrUpdate(String billingAccountId, String billingProfileId, String ruleName, + MarkupRuleInner resource) { + return createOrUpdateWithResponse(billingAccountId, billingProfileId, ruleName, resource, Context.NONE) + .getValue(); + } + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 billingAccountId, String billingProfileId, + String ruleName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, ruleName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 billingAccountId, String billingProfileId, String ruleName) { + return deleteWithResponseAsync(billingAccountId, billingProfileId, ruleName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + billingProfileId, ruleName, context); + } + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 billingAccountId, String billingProfileId, String ruleName) { + deleteWithResponse(billingAccountId, billingProfileId, ruleName, Context.NONE); + } + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String billingAccountId, String billingProfileId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, 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 all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String billingAccountId, String billingProfileId) { + return new PagedFlux<>(() -> listSinglePageAsync(billingAccountId, billingProfileId), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String billingAccountId, String billingProfileId) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String billingAccountId, String billingProfileId, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingProfileId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String billingAccountId, String billingProfileId) { + return new PagedIterable<>(() -> listSinglePage(billingAccountId, billingProfileId), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String billingAccountId, String billingProfileId, Context context) { + return new PagedIterable<>(() -> listSinglePage(billingAccountId, billingProfileId, context), + nextLink -> listNextSinglePage(nextLink, 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 markup rule list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(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. + * @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 markup rule list result along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @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 markup rule list result along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesImpl.java new file mode 100644 index 000000000000..c7ba9998899b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesImpl.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.http.rest.PagedIterable; +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.costmanagement.fluent.MarkupRulesClient; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.models.MarkupRule; +import com.azure.resourcemanager.costmanagement.models.MarkupRules; + +public final class MarkupRulesImpl implements MarkupRules { + private static final ClientLogger LOGGER = new ClientLogger(MarkupRulesImpl.class); + + private final MarkupRulesClient innerClient; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + public MarkupRulesImpl(MarkupRulesClient innerClient, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(billingAccountId, billingProfileId, ruleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MarkupRuleImpl(inner.getValue(), this.manager())); + } + + public MarkupRule get(String billingAccountId, String billingProfileId, String ruleName) { + MarkupRuleInner inner = this.serviceClient().get(billingAccountId, billingProfileId, ruleName); + if (inner != null) { + return new MarkupRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String billingAccountId, String billingProfileId, + String ruleName, MarkupRuleInner resource, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(billingAccountId, billingProfileId, ruleName, resource, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MarkupRuleImpl(inner.getValue(), this.manager())); + } + + public MarkupRule createOrUpdate(String billingAccountId, String billingProfileId, String ruleName, + MarkupRuleInner resource) { + MarkupRuleInner inner + = this.serviceClient().createOrUpdate(billingAccountId, billingProfileId, ruleName, resource); + if (inner != null) { + return new MarkupRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context) { + return this.serviceClient().deleteWithResponse(billingAccountId, billingProfileId, ruleName, context); + } + + public void delete(String billingAccountId, String billingProfileId, String ruleName) { + this.serviceClient().delete(billingAccountId, billingProfileId, ruleName); + } + + public PagedIterable list(String billingAccountId, String billingProfileId) { + PagedIterable inner = this.serviceClient().list(billingAccountId, billingProfileId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarkupRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String billingAccountId, String billingProfileId, Context context) { + PagedIterable inner = this.serviceClient().list(billingAccountId, billingProfileId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarkupRuleImpl(inner1, this.manager())); + } + + private MarkupRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationStatusImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationStatusImpl.java index 6ea0547346ee..886a7117a160 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationStatusImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationStatusImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsClientImpl.java index dca5b4bc8cdc..fc9657205855 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.costmanagement.fluent.OperationsClient; import com.azure.resourcemanager.costmanagement.fluent.models.CostManagementOperationInner; -import com.azure.resourcemanager.costmanagement.models.OperationListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,31 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(CostManagementClientImpl client) { + OperationsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientOperations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for CostManagementManagementClientOperations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.CostManagement/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.CostManagement/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,11 +81,18 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -87,10 +101,6 @@ Mono> listNext(@PathParam(value = "nextLink", enco */ @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.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -101,57 +111,53 @@ private Mono> listSinglePageAsync() } /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing cost management operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of listing cost management operations as paginated response with {@link PagedFlux}. */ - @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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing cost management operations as paginated response with {@link PagedFlux}. + * @return result of listing cost management operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing cost management operations as paginated response with {@link PagedFlux}. + * @return result of listing cost management operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -159,11 +165,11 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -173,7 +179,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -188,13 +194,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -202,6 +201,24 @@ private Mono> listNextSinglePageAsyn .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing cost management operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -210,23 +227,13 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing cost management operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of listing cost management operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsImpl.java index 70e5a17ce3b7..3b90775beccf 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsClientImpl.java index d36807f16748..08e8c6cb2f21 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -20,12 +20,15 @@ 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.BinaryData; 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.costmanagement.fluent.PriceSheetsClient; import com.azure.resourcemanager.costmanagement.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.costmanagement.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -42,51 +45,87 @@ public final class PriceSheetsClientImpl implements PriceSheetsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of PriceSheetsClientImpl. * * @param client the instance of the service client containing this operation class. */ - PriceSheetsClientImpl(CostManagementClientImpl client) { + PriceSheetsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(PriceSheetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientPriceSheets to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for CostManagementManagementClientPriceSheets to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientPriceSheets") public interface PriceSheetsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download") + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> download(@HostParam("$host") String endpoint, + Mono>> downloadByInvoice(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, @PathParam("invoiceName") String invoiceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download") + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadByBillingProfile(@HostParam("$host") String endpoint, + Response downloadByInvoiceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @PathParam("invoiceName") String invoiceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadByBillingProfile(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response downloadByBillingProfileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadByBillingAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingPeriodName") String billingPeriodName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response downloadByBillingAccountSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingPeriodName") String billingPeriodName, @HeaderParam("Accept") String accept, + Context context); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -95,26 +134,11 @@ Mono>> downloadByBillingProfile(@HostParam("$host") St * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadWithResponseAsync(String billingAccountName, + private Mono>> downloadByInvoiceWithResponseAsync(String billingAccountName, String billingProfileName, String invoiceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.download(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.downloadByInvoice(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -123,90 +147,70 @@ private Mono>> downloadWithResponseAsync(String billin * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. - * @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 URL to download the pricesheet for an invoice along with {@link Response} on successful completion of - * {@link Mono}. + * @return a URL to download the pricesheet for an invoice along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadWithResponseAsync(String billingAccountName, - String billingProfileName, String invoiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } + private Response downloadByInvoiceWithResponse(String billingAccountName, String billingProfileName, + String invoiceName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.download(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, - billingProfileName, invoiceName, accept, context); + return service.downloadByInvoiceSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, + billingProfileName, invoiceName, accept, Context.NONE); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. + * @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 a URL to download the pricesheet for an invoice. + * @return a URL to download the pricesheet for an invoice along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadAsync(String billingAccountName, - String billingProfileName, String invoiceName) { - Mono>> mono - = downloadWithResponseAsync(billingAccountName, billingProfileName, invoiceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response downloadByInvoiceWithResponse(String billingAccountName, String billingProfileName, + String invoiceName, Context context) { + final String accept = "application/json"; + return service.downloadByInvoiceSync(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, + billingProfileName, invoiceName, accept, context); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. - * @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 a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadAsync(String billingAccountName, - String billingProfileName, String invoiceName, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, DownloadUrlInner> + beginDownloadByInvoiceAsync(String billingAccountName, String billingProfileName, String invoiceName) { Mono>> mono - = downloadWithResponseAsync(billingAccountName, billingProfileName, invoiceName, context); + = downloadByInvoiceWithResponseAsync(billingAccountName, billingProfileName, invoiceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DownloadUrlInner.class, DownloadUrlInner.class, context); + DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -214,17 +218,20 @@ private PollerFlux, DownloadUrlInner> beginDownload * @return the {@link SyncPoller} for polling of a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownload(String billingAccountName, + public SyncPoller, DownloadUrlInner> beginDownloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName) { - return this.beginDownloadAsync(billingAccountName, billingProfileName, invoiceName).getSyncPoller(); + Response response + = downloadByInvoiceWithResponse(billingAccountName, billingProfileName, invoiceName); + return this.client.getLroResult(response, DownloadUrlInner.class, + DownloadUrlInner.class, Context.NONE); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -233,17 +240,20 @@ public SyncPoller, DownloadUrlInner> beginDownload( * @return the {@link SyncPoller} for polling of a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownload(String billingAccountName, + public SyncPoller, DownloadUrlInner> beginDownloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName, Context context) { - return this.beginDownloadAsync(billingAccountName, billingProfileName, invoiceName, context).getSyncPoller(); + Response response + = downloadByInvoiceWithResponse(billingAccountName, billingProfileName, invoiceName, context); + return this.client.getLroResult(response, DownloadUrlInner.class, + DownloadUrlInner.class, context); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -251,29 +261,9 @@ public SyncPoller, DownloadUrlInner> beginDownload( * @return a URL to download the pricesheet for an invoice on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadAsync(String billingAccountName, String billingProfileName, + private Mono downloadByInvoiceAsync(String billingAccountName, String billingProfileName, String invoiceName) { - return beginDownloadAsync(billingAccountName, billingProfileName, invoiceName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceName The ID that uniquely identifies an invoice. - * @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 URL to download the pricesheet for an invoice on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadAsync(String billingAccountName, String billingProfileName, - String invoiceName, Context context) { - return beginDownloadAsync(billingAccountName, billingProfileName, invoiceName, context).last() + return beginDownloadByInvoiceAsync(billingAccountName, billingProfileName, invoiceName).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -281,8 +271,8 @@ private Mono downloadAsync(String billingAccountName, String b * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -290,16 +280,17 @@ private Mono downloadAsync(String billingAccountName, String b * @return a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner download(String billingAccountName, String billingProfileName, String invoiceName) { - return downloadAsync(billingAccountName, billingProfileName, invoiceName).block(); + public DownloadUrlInner downloadByInvoice(String billingAccountName, String billingProfileName, + String invoiceName) { + return beginDownloadByInvoice(billingAccountName, billingProfileName, invoiceName).getFinalResult(); } /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -308,19 +299,23 @@ public DownloadUrlInner download(String billingAccountName, String billingProfil * @return a URL to download the pricesheet for an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner download(String billingAccountName, String billingProfileName, String invoiceName, + public DownloadUrlInner downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName, Context context) { - return downloadAsync(billingAccountName, billingProfileName, invoiceName, context).block(); + return beginDownloadByInvoice(billingAccountName, billingProfileName, invoiceName, context).getFinalResult(); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -330,18 +325,6 @@ public DownloadUrlInner download(String billingAccountName, String billingProfil @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> downloadByBillingProfileWithResponseAsync(String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.downloadByBillingProfile(this.client.getEndpoint(), @@ -351,72 +334,67 @@ private Mono>> downloadByBillingProfileWithResponseAsy /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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 URL to download the current month's pricesheet for a billing profile along with {@link Response} on - * successful completion of {@link Mono}. + * @return a URL to download the current month's pricesheet for a billing profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadByBillingProfileWithResponseAsync(String billingAccountName, - String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } + private Response downloadByBillingProfileWithResponse(String billingAccountName, + String billingProfileName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.downloadByBillingProfile(this.client.getEndpoint(), this.client.getApiVersion(), - billingAccountName, billingProfileName, accept, context); + return service.downloadByBillingProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountName, billingProfileName, accept, Context.NONE); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. + * @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 a URL to download the current month's pricesheet for a billing - * profile. + * @return a URL to download the current month's pricesheet for a billing profile along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> - beginDownloadByBillingProfileAsync(String billingAccountName, String billingProfileName) { - Mono>> mono - = downloadByBillingProfileWithResponseAsync(billingAccountName, billingProfileName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response downloadByBillingProfileWithResponse(String billingAccountName, + String billingProfileName, Context context) { + final String accept = "application/json"; + return service.downloadByBillingProfileSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountName, billingProfileName, accept, context); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -424,23 +402,27 @@ private Mono>> downloadByBillingProfileWithResponseAsy * profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> - beginDownloadByBillingProfileAsync(String billingAccountName, String billingProfileName, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, PricesheetDownloadPropertiesInner> + beginDownloadByBillingProfileAsync(String billingAccountName, String billingProfileName) { Mono>> mono - = downloadByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DownloadUrlInner.class, DownloadUrlInner.class, context); + = downloadByBillingProfileWithResponseAsync(billingAccountName, billingProfileName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PricesheetDownloadPropertiesInner.class, + PricesheetDownloadPropertiesInner.class, this.client.getContext()); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -448,19 +430,25 @@ private Mono>> downloadByBillingProfileWithResponseAsy * profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> + public SyncPoller, PricesheetDownloadPropertiesInner> beginDownloadByBillingProfile(String billingAccountName, String billingProfileName) { - return this.beginDownloadByBillingProfileAsync(billingAccountName, billingProfileName).getSyncPoller(); + Response response = downloadByBillingProfileWithResponse(billingAccountName, billingProfileName); + return this.client.getLroResult(response, + PricesheetDownloadPropertiesInner.class, PricesheetDownloadPropertiesInner.class, Context.NONE); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -469,19 +457,26 @@ private Mono>> downloadByBillingProfileWithResponseAsy * profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> + public SyncPoller, PricesheetDownloadPropertiesInner> beginDownloadByBillingProfile(String billingAccountName, String billingProfileName, Context context) { - return this.beginDownloadByBillingProfileAsync(billingAccountName, billingProfileName, context).getSyncPoller(); + Response response + = downloadByBillingProfileWithResponse(billingAccountName, billingProfileName, context); + return this.client.getLroResult(response, + PricesheetDownloadPropertiesInner.class, PricesheetDownloadPropertiesInner.class, context); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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. @@ -489,68 +484,427 @@ private Mono>> downloadByBillingProfileWithResponseAsy * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadByBillingProfileAsync(String billingAccountName, String billingProfileName) { + private Mono downloadByBillingProfileAsync(String billingAccountName, + String billingProfileName) { return beginDownloadByBillingProfileAsync(billingAccountName, billingProfileName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. + * @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 URL to download the current month's pricesheet for a billing profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PricesheetDownloadPropertiesInner downloadByBillingProfile(String billingAccountName, + String billingProfileName) { + return beginDownloadByBillingProfile(billingAccountName, billingProfileName).getFinalResult(); + } + + /** + * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @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 URL to download the current month's pricesheet for a billing profile on successful completion of + * @return a URL to download the current month's pricesheet for a billing profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PricesheetDownloadPropertiesInner downloadByBillingProfile(String billingAccountName, + String billingProfileName, Context context) { + return beginDownloadByBillingProfile(billingAccountName, billingProfileName, context).getFinalResult(); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadByBillingProfileAsync(String billingAccountName, String billingProfileName, + private Mono>> downloadByBillingAccountWithResponseAsync(String billingAccountId, + String billingPeriodName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadByBillingAccount(this.client.getEndpoint(), + this.client.getApiVersion(), billingAccountId, billingPeriodName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response downloadByBillingAccountWithResponse(String billingAccountId, + String billingPeriodName) { + final String accept = "application/json"; + return service.downloadByBillingAccountSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingPeriodName, accept, Context.NONE); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response downloadByBillingAccountWithResponse(String billingAccountId, String billingPeriodName, Context context) { - return beginDownloadByBillingProfileAsync(billingAccountName, billingProfileName, context).last() + final String accept = "application/json"; + return service.downloadByBillingAccountSync(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingPeriodName, accept, context); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> + beginDownloadByBillingAccountAsync(String billingAccountId, String billingPeriodName) { + Mono>> mono + = downloadByBillingAccountWithResponseAsync(billingAccountId, billingPeriodName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OperationStatusInner.class, OperationStatusInner.class, this.client.getContext()); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> + beginDownloadByBillingAccount(String billingAccountId, String billingPeriodName) { + Response response = downloadByBillingAccountWithResponse(billingAccountId, billingPeriodName); + return this.client.getLroResult(response, + OperationStatusInner.class, OperationStatusInner.class, Context.NONE); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> + beginDownloadByBillingAccount(String billingAccountId, String billingPeriodName, Context context) { + Response response + = downloadByBillingAccountWithResponse(billingAccountId, billingPeriodName, context); + return this.client.getLroResult(response, + OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadByBillingAccountAsync(String billingAccountId, + String billingPeriodName) { + return beginDownloadByBillingAccountAsync(billingAccountId, billingPeriodName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. * @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 URL to download the current month's pricesheet for a billing profile. + * @return the status of the long running operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadByBillingProfile(String billingAccountName, String billingProfileName) { - return downloadByBillingProfileAsync(billingAccountName, billingProfileName).block(); + public OperationStatusInner downloadByBillingAccount(String billingAccountId, String billingPeriodName) { + return beginDownloadByBillingAccount(billingAccountId, billingPeriodName).getFinalResult(); } /** - * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. * @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 URL to download the current month's pricesheet for a billing profile. + * @return the status of the long running operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadByBillingProfile(String billingAccountName, String billingProfileName, + public OperationStatusInner downloadByBillingAccount(String billingAccountId, String billingPeriodName, Context context) { - return downloadByBillingProfileAsync(billingAccountName, billingProfileName, context).block(); + return beginDownloadByBillingAccount(billingAccountId, billingPeriodName, context).getFinalResult(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsImpl.java index 5d84b0af12e2..2cbc7df0084c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -8,8 +8,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient; import com.azure.resourcemanager.costmanagement.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.costmanagement.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner; import com.azure.resourcemanager.costmanagement.models.DownloadUrl; +import com.azure.resourcemanager.costmanagement.models.OperationStatus; import com.azure.resourcemanager.costmanagement.models.PriceSheets; +import com.azure.resourcemanager.costmanagement.models.PricesheetDownloadProperties; public final class PriceSheetsImpl implements PriceSheets { private static final ClientLogger LOGGER = new ClientLogger(PriceSheetsImpl.class); @@ -24,8 +28,9 @@ public PriceSheetsImpl(PriceSheetsClient innerClient, this.serviceManager = serviceManager; } - public DownloadUrl download(String billingAccountName, String billingProfileName, String invoiceName) { - DownloadUrlInner inner = this.serviceClient().download(billingAccountName, billingProfileName, invoiceName); + public DownloadUrl downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName) { + DownloadUrlInner inner + = this.serviceClient().downloadByInvoice(billingAccountName, billingProfileName, invoiceName); if (inner != null) { return new DownloadUrlImpl(inner, this.manager()); } else { @@ -33,10 +38,10 @@ public DownloadUrl download(String billingAccountName, String billingProfileName } } - public DownloadUrl download(String billingAccountName, String billingProfileName, String invoiceName, + public DownloadUrl downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName, Context context) { DownloadUrlInner inner - = this.serviceClient().download(billingAccountName, billingProfileName, invoiceName, context); + = this.serviceClient().downloadByInvoice(billingAccountName, billingProfileName, invoiceName, context); if (inner != null) { return new DownloadUrlImpl(inner, this.manager()); } else { @@ -44,20 +49,42 @@ public DownloadUrl download(String billingAccountName, String billingProfileName } } - public DownloadUrl downloadByBillingProfile(String billingAccountName, String billingProfileName) { - DownloadUrlInner inner = this.serviceClient().downloadByBillingProfile(billingAccountName, billingProfileName); + public PricesheetDownloadProperties downloadByBillingProfile(String billingAccountName, String billingProfileName) { + PricesheetDownloadPropertiesInner inner + = this.serviceClient().downloadByBillingProfile(billingAccountName, billingProfileName); if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); + return new PricesheetDownloadPropertiesImpl(inner, this.manager()); } else { return null; } } - public DownloadUrl downloadByBillingProfile(String billingAccountName, String billingProfileName, Context context) { - DownloadUrlInner inner + public PricesheetDownloadProperties downloadByBillingProfile(String billingAccountName, String billingProfileName, + Context context) { + PricesheetDownloadPropertiesInner inner = this.serviceClient().downloadByBillingProfile(billingAccountName, billingProfileName, context); if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); + return new PricesheetDownloadPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus downloadByBillingAccount(String billingAccountId, String billingPeriodName) { + OperationStatusInner inner = this.serviceClient().downloadByBillingAccount(billingAccountId, billingPeriodName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus downloadByBillingAccount(String billingAccountId, String billingPeriodName, + Context context) { + OperationStatusInner inner + = this.serviceClient().downloadByBillingAccount(billingAccountId, billingPeriodName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PricesheetDownloadPropertiesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PricesheetDownloadPropertiesImpl.java new file mode 100644 index 000000000000..001ddf2ce057 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/PricesheetDownloadPropertiesImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner; +import com.azure.resourcemanager.costmanagement.models.MCAPriceSheetProperties; +import com.azure.resourcemanager.costmanagement.models.PricesheetDownloadProperties; +import java.time.OffsetDateTime; + +public final class PricesheetDownloadPropertiesImpl implements PricesheetDownloadProperties { + private PricesheetDownloadPropertiesInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + PricesheetDownloadPropertiesImpl(PricesheetDownloadPropertiesInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime expiryTime() { + return this.innerModel().expiryTime(); + } + + public String downloadUrl() { + return this.innerModel().downloadUrl(); + } + + public MCAPriceSheetProperties downloadFileProperties() { + return this.innerModel().downloadFileProperties(); + } + + public PricesheetDownloadPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesClientImpl.java index bfc4fec526de..a88152e3d9bd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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; @@ -40,43 +39,60 @@ public final class QueriesClientImpl implements QueriesClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of QueriesClientImpl. * * @param client the instance of the service client containing this operation class. */ - QueriesClientImpl(CostManagementClientImpl client) { + QueriesClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(QueriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientQueries to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for CostManagementManagementClientQueries to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientQueries") public interface QueriesService { - @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.CostManagement/query") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> usage(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") QueryDefinition parameters, @HeaderParam("Accept") String accept, - Context context); + Mono> usage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QueryDefinition parameters, Context context); + + @Post("/{scope}/providers/Microsoft.CostManagement/query") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response usageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QueryDefinition parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> usageByExternalCloudProviderType(@HostParam("$host") String endpoint, + Mono> usageByExternalCloudProviderType(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, @PathParam("externalCloudProviderId") String externalCloudProviderId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") QueryDefinition parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QueryDefinition parameters, Context context); + + @Post("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response usageByExternalCloudProviderTypeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("externalCloudProviderType") ExternalCloudProviderType externalCloudProviderType, + @PathParam("externalCloudProviderId") String externalCloudProviderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QueryDefinition parameters, Context context); } /** @@ -102,68 +118,14 @@ Mono> usageByExternalCloudProviderType(@HostParam("$h */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> usageWithResponseAsync(String scope, QueryDefinition parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.usage(this.client.getEndpoint(), scope, this.client.getApiVersion(), - parameters, accept, context)) + .withContext(context -> service.usage(this.client.getEndpoint(), this.client.getApiVersion(), scope, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Query the usage data for scope defined. - * - * @param scope The scope associated with query and export operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of query along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> usageWithResponseAsync(String scope, QueryDefinition parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.usage(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, - context); - } - /** * Query the usage data for scope defined. * @@ -214,7 +176,10 @@ private Mono usageAsync(String scope, QueryDefinition paramete */ @ServiceMethod(returns = ReturnType.SINGLE) public Response usageWithResponse(String scope, QueryDefinition parameters, Context context) { - return usageWithResponseAsync(scope, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.usageSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, accept, + parameters, context); } /** @@ -250,7 +215,7 @@ public QueryResultInner usage(String scope, QueryDefinition parameters) { * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. @@ -260,28 +225,12 @@ public QueryResultInner usage(String scope, QueryDefinition parameters) { private Mono> usageByExternalCloudProviderTypeWithResponseAsync( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, QueryDefinition parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.usageByExternalCloudProviderType(this.client.getEndpoint(), - externalCloudProviderType, externalCloudProviderId, this.client.getApiVersion(), parameters, accept, - context)) + this.client.getApiVersion(), externalCloudProviderType, externalCloudProviderId, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -292,48 +241,7 @@ private Mono> usageByExternalCloudProviderTypeWithRes * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of query along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> usageByExternalCloudProviderTypeWithResponseAsync( - ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, QueryDefinition parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (externalCloudProviderType == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderType is required and cannot be null.")); - } - if (externalCloudProviderId == null) { - return Mono.error( - new IllegalArgumentException("Parameter externalCloudProviderId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.usageByExternalCloudProviderType(this.client.getEndpoint(), externalCloudProviderType, - externalCloudProviderId, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * Query the usage data for external cloud provider type defined. - * - * @param externalCloudProviderType The external cloud provider type associated with dimension/query operations. - * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or - * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. @@ -354,7 +262,7 @@ private Mono usageByExternalCloudProviderTypeAsync( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. @@ -365,8 +273,10 @@ private Mono usageByExternalCloudProviderTypeAsync( public Response usageByExternalCloudProviderTypeWithResponse( ExternalCloudProviderType externalCloudProviderType, String externalCloudProviderId, QueryDefinition parameters, Context context) { - return usageByExternalCloudProviderTypeWithResponseAsync(externalCloudProviderType, externalCloudProviderId, - parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.usageByExternalCloudProviderTypeSync(this.client.getEndpoint(), this.client.getApiVersion(), + externalCloudProviderType, externalCloudProviderId, contentType, accept, parameters, context); } /** @@ -376,7 +286,7 @@ public Response usageByExternalCloudProviderTypeWithResponse( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesImpl.java index a7e777999ec8..494f9a7137d7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -30,12 +30,8 @@ public QueriesImpl(QueriesClient innerClient, public Response usageWithResponse(String scope, QueryDefinition parameters, Context context) { Response inner = this.serviceClient().usageWithResponse(scope, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QueryResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QueryResultImpl(inner.getValue(), this.manager())); } public QueryResult usage(String scope, QueryDefinition parameters) { @@ -53,12 +49,8 @@ public Response usageByExternalCloudProviderTypeWithResponse( Response inner = this.serviceClient() .usageByExternalCloudProviderTypeWithResponse(externalCloudProviderType, externalCloudProviderId, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QueryResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QueryResultImpl(inner.getValue(), this.manager())); } public QueryResult usageByExternalCloudProviderType(ExternalCloudProviderType externalCloudProviderType, diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueryResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueryResultImpl.java index f24b906b7b4f..d0059bcb87fc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueryResultImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueryResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -38,6 +38,14 @@ public String location() { return this.innerModel().location(); } + public String sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -47,14 +55,6 @@ public Map tags() { } } - public String sku() { - return this.innerModel().sku(); - } - - public String etag() { - return this.innerModel().etag(); - } - public String nextLink() { return this.innerModel().nextLink(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ResourceManagerUtils.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ResourceManagerUtils.java index 7b2f552d9eaa..e24ac1e03f45 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ResourceManagerUtils.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionImpl.java index 884bb215186b..e42bc964340c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -175,6 +175,11 @@ public void runByScope() { serviceManager.scheduledActions().runByScope(scope, name); } + public ScheduledActionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + public ScheduledActionImpl withKind(ScheduledActionKind kind) { this.innerModel().withKind(kind); return this; @@ -231,6 +236,6 @@ public ScheduledActionImpl withIfMatch(String ifMatch) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsClientImpl.java index fb5c33f66e83..beeefa8e9da8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -32,8 +32,8 @@ import com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient; import com.azure.resourcemanager.costmanagement.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.costmanagement.fluent.models.ScheduledActionInner; +import com.azure.resourcemanager.costmanagement.implementation.models.ScheduledActionListResult; import com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.costmanagement.models.ScheduledActionListResult; import reactor.core.publisher.Mono; /** @@ -48,811 +48,694 @@ public final class ScheduledActionsClientImpl implements ScheduledActionsClient /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of ScheduledActionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ScheduledActionsClientImpl(CostManagementClientImpl client) { + ScheduledActionsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(ScheduledActionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientScheduledActions to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for CostManagementManagementClientScheduledActions to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientScheduledActions") public interface ScheduledActionsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.CostManagement/scheduledActions") + @Get("/providers/Microsoft.CostManagement/scheduledActions/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.CostManagement/scheduledActions") + @Get("/providers/Microsoft.CostManagement/scheduledActions/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByScope(@HostParam("$host") String endpoint, - @PathParam("scope") String scope, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.CostManagement/scheduledActions/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") ScheduledActionInner scheduledAction, @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduledActionInner scheduledAction, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.CostManagement/scheduledActions/{name}") - @ExpectedResponses({ 200 }) + @Put("/providers/Microsoft.CostManagement/scheduledActions/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduledActionInner scheduledAction, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.CostManagement/scheduledActions/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/providers/Microsoft.CostManagement/scheduledActions/{name}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") - @ExpectedResponses({ 200, 201 }) + @Get("/providers/Microsoft.CostManagement/scheduledActions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateByScope(@HostParam("$host") String endpoint, - @PathParam("scope") String scope, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") ScheduledActionInner scheduledAction, @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.CostManagement/scheduledActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.CostManagement/scheduledActions/{name}/execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> run(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.CostManagement/scheduledActions/{name}/execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response runSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByScope(@HostParam("$host") String endpoint, - @PathParam("scope") String scope, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> getByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Put("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduledActionInner scheduledAction, Context context); + + @Put("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduledActionInner scheduledAction, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByScope(@HostParam("$host") String endpoint, @PathParam("scope") String scope, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> deleteByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.CostManagement/scheduledActions/{name}/execute") + @Get("/{scope}/providers/Microsoft.CostManagement/scheduledActions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> run(@HostParam("$host") String endpoint, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/scheduledActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> runByScope(@HostParam("$host") String endpoint, @PathParam("scope") String scope, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> runByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response runByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.CostManagement/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); + + @Post("/providers/Microsoft.CostManagement/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.CostManagement/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNameAvailabilityByScope( - @HostParam("$host") String endpoint, @PathParam("scope") String scope, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); + + @Post("/{scope}/providers/Microsoft.CostManagement/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilityByScopeSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByScopeNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List all private scheduled actions. + * Get the private scheduled action by name. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. * @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 scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the private scheduled action by name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String name) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all private scheduled actions. + * Get the private scheduled action by name. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @param context The context to associate with this operation. + * @param name Scheduled action name. * @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 scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the private scheduled action by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - 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.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono getAsync(String name) { + return getWithResponseAsync(name).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all private scheduled actions. + * Get the private scheduled action by name. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. + * @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 scheduled actions list result as paginated response with {@link PagedFlux}. + * @return the private scheduled action by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context); } /** - * List all private scheduled actions. + * Get the private scheduled action by name. * + * @param name Scheduled action name. + * @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 scheduled actions list result as paginated response with {@link PagedFlux}. + * @return the private scheduled action by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ScheduledActionInner get(String name) { + return getWithResponse(name, Context.NONE).getValue(); } /** - * List all private scheduled actions. + * Create or update a private scheduled action. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @param context The context to associate with this operation. + * @param name Scheduled action name. + * @param scheduledAction Scheduled action to be created or updated. + * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can + * be specified to achieve optimistic concurrency. * @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 scheduled actions list result as paginated response with {@link PagedFlux}. + * @return scheduled action definition along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String name, + ScheduledActionInner scheduledAction, String ifMatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), name, + ifMatch, contentType, accept, scheduledAction, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all private scheduled actions. + * Create or update a private scheduled action. * + * @param name Scheduled action name. + * @param scheduledAction Scheduled action to be created or updated. + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return scheduled action definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String name, ScheduledActionInner scheduledAction) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(name, scheduledAction, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all private scheduled actions. + * Create or update a private scheduled action. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. + * @param scheduledAction Scheduled action to be created or updated. + * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can + * be specified to achieve optimistic concurrency. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return scheduled action definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String name, ScheduledActionInner scheduledAction, + String ifMatch, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), name, ifMatch, + contentType, accept, scheduledAction, context); } /** - * List all shared scheduled actions within the given scope. + * Create or update a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. + * @param scheduledAction Scheduled action to be created or updated. * @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 scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return scheduled action definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeSinglePageAsync(String scope, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public ScheduledActionInner createOrUpdate(String name, ScheduledActionInner scheduledAction) { + final String ifMatch = null; + return createOrUpdateWithResponse(name, scheduledAction, ifMatch, Context.NONE).getValue(); } /** - * List all shared scheduled actions within the given scope. + * Delete a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @param context The context to associate with this operation. + * @param name Scheduled action name. * @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 scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeSinglePageAsync(String scope, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono> deleteWithResponseAsync(String name) { + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all shared scheduled actions within the given scope. + * Delete a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. * @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 scheduled actions list result as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByScopeAsync(String scope, String filter) { - return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope, filter), - nextLink -> listByScopeNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String name) { + return deleteWithResponseAsync(name).flatMap(ignored -> Mono.empty()); } /** - * List all shared scheduled actions within the given scope. + * Delete a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param name Scheduled action name. + * @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 scheduled actions list result as paginated response with {@link PagedFlux}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByScopeAsync(String scope) { - final String filter = null; - return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope, filter), - nextLink -> listByScopeNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), name, context); } /** - * List all shared scheduled actions within the given scope. + * Delete a private scheduled action. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @param context The context to associate with this operation. + * @param name Scheduled action name. * @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 scheduled actions list result as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByScopeAsync(String scope, String filter, Context context) { - return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope, filter, context), - nextLink -> listByScopeNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String name) { + deleteWithResponse(name, Context.NONE); } /** - * List all shared scheduled actions within the given scope. + * List all private scheduled actions. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByScope(String scope) { - final String filter = null; - return new PagedIterable<>(listByScopeAsync(scope, filter)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all shared scheduled actions within the given scope. + * List all private scheduled actions. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return scheduled actions list result as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByScope(String scope, String filter, Context context) { - return new PagedIterable<>(listByScopeAsync(scope, filter, context)); + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create or update a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. - * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can - * be specified to achieve optimistic concurrency. - * @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 scheduled action definition along with {@link Response} on successful completion of {@link Mono}. + * @return scheduled actions list result as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String name, - ScheduledActionInner scheduledAction, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (scheduledAction == null) { - return Mono - .error(new IllegalArgumentException("Parameter scheduledAction is required and cannot be null.")); - } else { - scheduledAction.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), name, this.client.getApiVersion(), - ifMatch, scheduledAction, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create or update a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. - * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can - * be specified to achieve optimistic concurrency. - * @param context The context to associate with this operation. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. * @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 scheduled action definition along with {@link Response} on successful completion of {@link Mono}. + * @return scheduled actions list result along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String name, - ScheduledActionInner scheduledAction, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (scheduledAction == null) { - return Mono - .error(new IllegalArgumentException("Parameter scheduledAction is required and cannot be null.")); - } else { - scheduledAction.validate(); - } + private PagedResponse listSinglePage(String filter) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), name, this.client.getApiVersion(), ifMatch, - scheduledAction, accept, context); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled action definition on successful completion of {@link Mono}. + * @return scheduled actions list result along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String name, ScheduledActionInner scheduledAction) { - final String ifMatch = null; - return createOrUpdateWithResponseAsync(name, scheduledAction, ifMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. - * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can - * be specified to achieve optimistic concurrency. - * @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 scheduled action definition along with {@link Response}. + * @return scheduled actions list result as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String name, ScheduledActionInner scheduledAction, - String ifMatch, Context context) { - return createOrUpdateWithResponseAsync(name, scheduledAction, ifMatch, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(filter), nextLink -> listNextSinglePage(nextLink)); } /** - * Create or update a private scheduled action. + * List all private scheduled actions. * - * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled action definition. + * @return scheduled actions list result as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduledActionInner createOrUpdate(String name, ScheduledActionInner scheduledAction) { - final String ifMatch = null; - return createOrUpdateWithResponse(name, scheduledAction, ifMatch, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Get the private scheduled action by name. + * Processes a private scheduled action. * * @param name Scheduled action name. * @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 private scheduled action by name along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono> runWithResponseAsync(String name) { return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.run(this.client.getEndpoint(), this.client.getApiVersion(), name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the private scheduled action by name. + * Processes a private scheduled action. * * @param name Scheduled action name. - * @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 private scheduled action by name along with {@link Response} on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context); + private Mono runAsync(String name) { + return runWithResponseAsync(name).flatMap(ignored -> Mono.empty()); } /** - * Get the private scheduled action by name. + * Processes a private scheduled action. * * @param name Scheduled action name. + * @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 private scheduled action by name on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String name) { - return getWithResponseAsync(name).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response runWithResponse(String name, Context context) { + return service.runSync(this.client.getEndpoint(), this.client.getApiVersion(), name, context); } /** - * Get the private scheduled action by name. + * Processes a private scheduled action. * * @param name Scheduled action name. - * @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 private scheduled action by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String name, Context context) { - return getWithResponseAsync(name, context).block(); + public void run(String name) { + runWithResponse(name, Context.NONE); } /** - * Get the private scheduled action by name. + * Get the shared scheduled action from the given scope by name. * + * @param scope undefined. * @param name Scheduled action name. * @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 private scheduled action by name. + * @return the shared scheduled action from the given scope by name along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduledActionInner get(String name) { - return getWithResponse(name, Context.NONE).getValue(); + private Mono> getByScopeWithResponseAsync(String scope, String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a private scheduled action. + * Get the shared scheduled action from the given scope by name. * + * @param scope undefined. * @param name Scheduled action name. * @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}. + * @return the shared scheduled action from the given scope by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono getByScopeAsync(String scope, String name) { + return getByScopeWithResponseAsync(scope, name).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a private scheduled action. + * Get the shared scheduled action from the given scope by name. * + * @param scope undefined. * @param name Scheduled action name. * @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}. + * @return the shared scheduled action from the given scope by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + public Response getByScopeWithResponse(String scope, String name, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context); + return service.getByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, name, accept, + context); } /** - * Delete a private scheduled action. - * - * @param name Scheduled action name. - * @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 name) { - return deleteWithResponseAsync(name).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a private scheduled action. - * - * @param name Scheduled action name. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String name, Context context) { - return deleteWithResponseAsync(name, context).block(); - } - - /** - * Delete a private scheduled action. + * Get the shared scheduled action from the given scope by name. * + * @param scope undefined. * @param name Scheduled action name. * @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 shared scheduled action from the given scope by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String name) { - deleteWithResponse(name, Context.NONE); + public ScheduledActionInner getByScope(String scope, String name) { + return getByScopeWithResponse(scope, name, Context.NONE).getValue(); } /** * Create or update a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param scheduledAction Scheduled action to be created or updated. * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can @@ -865,98 +748,18 @@ public void delete(String name) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateByScopeWithResponseAsync(String scope, String name, ScheduledActionInner scheduledAction, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (scheduledAction == null) { - return Mono - .error(new IllegalArgumentException("Parameter scheduledAction is required and cannot be null.")); - } else { - scheduledAction.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateByScope(this.client.getEndpoint(), scope, name, - this.client.getApiVersion(), ifMatch, scheduledAction, accept, context)) + .withContext(context -> service.createOrUpdateByScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, name, ifMatch, contentType, accept, scheduledAction, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @param scheduledAction Scheduled action to be created or updated. - * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can - * be specified to achieve optimistic concurrency. - * @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 scheduled action definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateByScopeWithResponseAsync(String scope, String name, - ScheduledActionInner scheduledAction, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (scheduledAction == null) { - return Mono - .error(new IllegalArgumentException("Parameter scheduledAction is required and cannot be null.")); - } else { - scheduledAction.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateByScope(this.client.getEndpoint(), scope, name, this.client.getApiVersion(), - ifMatch, scheduledAction, accept, context); - } - - /** - * Create or update a shared scheduled action within the given scope. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param scheduledAction Scheduled action to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -975,20 +778,7 @@ private Mono createOrUpdateByScopeAsync(String scope, Stri /** * Create or update a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param scheduledAction Scheduled action to be created or updated. * @param ifMatch ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can @@ -1002,26 +792,16 @@ private Mono createOrUpdateByScopeAsync(String scope, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateByScopeWithResponse(String scope, String name, ScheduledActionInner scheduledAction, String ifMatch, Context context) { - return createOrUpdateByScopeWithResponseAsync(scope, name, scheduledAction, ifMatch, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, name, + ifMatch, contentType, accept, scheduledAction, context); } /** * Create or update a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param scheduledAction Scheduled action to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1035,194 +815,10 @@ public ScheduledActionInner createOrUpdateByScope(String scope, String name, Sch return createOrUpdateByScopeWithResponse(scope, name, scheduledAction, ifMatch, Context.NONE).getValue(); } - /** - * Get the shared scheduled action from the given scope by name. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @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 shared scheduled action from the given scope by name along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByScopeWithResponseAsync(String scope, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByScope(this.client.getEndpoint(), scope, name, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the shared scheduled action from the given scope by name. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @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 shared scheduled action from the given scope by name along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByScopeWithResponseAsync(String scope, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByScope(this.client.getEndpoint(), scope, name, this.client.getApiVersion(), accept, context); - } - - /** - * Get the shared scheduled action from the given scope by name. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @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 shared scheduled action from the given scope by name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByScopeAsync(String scope, String name) { - return getByScopeWithResponseAsync(scope, name).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the shared scheduled action from the given scope by name. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @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 shared scheduled action from the given scope by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByScopeWithResponse(String scope, String name, Context context) { - return getByScopeWithResponseAsync(scope, name, context).block(); - } - - /** - * Get the shared scheduled action from the given scope by name. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @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 shared scheduled action from the given scope by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduledActionInner getByScope(String scope, String name) { - return getByScopeWithResponse(scope, name, Context.NONE).getValue(); - } - /** * Delete a scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1231,110 +827,31 @@ public ScheduledActionInner getByScope(String scope, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteByScopeWithResponseAsync(String scope, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteByScope(this.client.getEndpoint(), scope, name, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deleteByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. - * @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> deleteByScopeWithResponseAsync(String scope, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteByScope(this.client.getEndpoint(), scope, name, this.client.getApiVersion(), accept, - context); - } - - /** - * Delete a scheduled action within the given scope. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @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 deleteByScopeAsync(String scope, String name) { - return deleteByScopeWithResponseAsync(scope, name).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a scheduled action within the given scope. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @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 deleteByScopeAsync(String scope, String name) { + return deleteByScopeWithResponseAsync(scope, name).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a scheduled action within the given scope. + * + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1344,26 +861,13 @@ private Mono deleteByScopeAsync(String scope, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteByScopeWithResponse(String scope, String name, Context context) { - return deleteByScopeWithResponseAsync(scope, name, context).block(); + return service.deleteByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, name, context); } /** * Delete a scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1375,196 +879,151 @@ public void deleteByScope(String scope, String name) { } /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. * @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}. + * @return scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> listByScopeSinglePageAsync(String scope, String filter) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.run(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. - * @param context The context to associate with this operation. + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. * @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}. + * @return scheduled actions list result as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.run(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByScopeAsync(String scope, String filter) { + return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope, filter), + nextLink -> listByScopeNextSinglePageAsync(nextLink)); } /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. + * @param scope undefined. * @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. + * @return scheduled actions list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope, filter), + nextLink -> listByScopeNextSinglePageAsync(nextLink)); + } + + /** + * List all shared scheduled actions within the given scope. + * + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled actions list result along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono runAsync(String name) { - return runWithResponseAsync(name).flatMap(ignored -> Mono.empty()); + private PagedResponse listByScopeSinglePage(String scope, String filter) { + final String accept = "application/json"; + Response res = service.listByScopeSync(this.client.getEndpoint(), + this.client.getApiVersion(), scope, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. * @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}. + * @return scheduled actions list result along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response runWithResponse(String name, Context context) { - return runWithResponseAsync(name, context).block(); + private PagedResponse listByScopeSinglePage(String scope, String filter, Context context) { + final String accept = "application/json"; + Response res = service.listByScopeSync(this.client.getEndpoint(), + this.client.getApiVersion(), scope, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. + * @param scope undefined. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void run(String name) { - runWithResponse(name, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScope(String scope) { + final String filter = null; + return new PagedIterable<>(() -> listByScopeSinglePage(scope, filter), + nextLink -> listByScopeNextSinglePage(nextLink)); } /** - * Runs a shared scheduled action within the given scope. + * List all shared scheduled actions within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param name Scheduled action name. + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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}. + * @return scheduled actions list result as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runByScopeWithResponseAsync(String scope, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.runByScope(this.client.getEndpoint(), scope, name, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScope(String scope, String filter, Context context) { + return new PagedIterable<>(() -> listByScopeSinglePage(scope, filter, context), + nextLink -> listByScopeNextSinglePage(nextLink, context)); } /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. - * @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> runByScopeWithResponseAsync(String scope, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.runByScope(this.client.getEndpoint(), scope, name, this.client.getApiVersion(), accept, context); + private Mono> runByScopeWithResponseAsync(String scope, String name) { + return FluxUtil.withContext( + context -> service.runByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1579,20 +1038,7 @@ private Mono runByScopeAsync(String scope, String name) { /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1602,26 +1048,13 @@ private Mono runByScopeAsync(String scope, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response runByScopeWithResponse(String scope, String name, Context context) { - return runByScopeWithResponseAsync(scope, name, context).block(); + return service.runByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, name, context); } /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1635,7 +1068,7 @@ public void runByScope(String scope, String name) { /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. @@ -1644,56 +1077,18 @@ public void runByScope(String scope, String name) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), checkNameAvailabilityRequest, accept, context)) + this.client.getApiVersion(), contentType, accept, checkNameAvailabilityRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. - * @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 check availability result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - checkNameAvailabilityRequest, accept, context); - } - - /** - * Checks availability and correctness of the name for a scheduled action. - * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. @@ -1709,7 +1104,7 @@ private Mono> checkNameAvailability /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. @@ -1719,13 +1114,16 @@ private Mono> checkNameAvailability @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityRequest, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, + accept, checkNameAvailabilityRequest, context); } /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. @@ -1763,72 +1161,14 @@ private Mono> checkNameAvailability @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityByScopeWithResponseAsync( String scope, CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailabilityByScope(this.client.getEndpoint(), scope, - this.client.getApiVersion(), checkNameAvailabilityRequest, accept, context)) + .withContext(context -> service.checkNameAvailabilityByScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, contentType, accept, checkNameAvailabilityRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Checks availability and correctness of the name for a scheduled action within the given scope. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. - * @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 check availability result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityByScopeWithResponseAsync( - String scope, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailabilityByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - checkNameAvailabilityRequest, accept, context); - } - /** * Checks availability and correctness of the name for a scheduled action within the given scope. * @@ -1886,7 +1226,10 @@ private Mono checkNameAvailabilityByScopeAsy @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityByScopeWithResponse(String scope, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - return checkNameAvailabilityByScopeWithResponseAsync(scope, checkNameAvailabilityRequest, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilityByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, + contentType, accept, checkNameAvailabilityRequest, context); } /** @@ -1929,13 +1272,6 @@ public CheckNameAvailabilityResponseInner checkNameAvailabilityByScope(String sc */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1943,6 +1279,24 @@ private Mono> listNextSinglePageAsync(String .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. + * @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 scheduled actions list result along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1951,22 +1305,15 @@ private Mono> listNextSinglePageAsync(String * @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 scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return scheduled actions list result along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1980,13 +1327,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByScopeNextSinglePageAsync(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.listByScopeNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1995,6 +1335,24 @@ private Mono> listByScopeNextSinglePageAsync .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. + * @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 scheduled actions list result along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByScopeNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByScopeNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2003,21 +1361,14 @@ private Mono> listByScopeNextSinglePageAsync * @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 scheduled actions list result along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return scheduled actions list result along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeNextSinglePageAsync(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.")); - } + private PagedResponse listByScopeNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByScopeNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsImpl.java index 9915d398b859..e4672fb91fae 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -30,36 +30,27 @@ public ScheduledActionsImpl(ScheduledActionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); - } - - public PagedIterable listByScope(String scope) { - PagedIterable inner = this.serviceClient().listByScope(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); + public Response getWithResponse(String name, Context context) { + Response inner = this.serviceClient().getWithResponse(name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduledActionImpl(inner.getValue(), this.manager())); } - public PagedIterable listByScope(String scope, String filter, Context context) { - PagedIterable inner = this.serviceClient().listByScope(scope, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); + public ScheduledAction get(String name) { + ScheduledActionInner inner = this.serviceClient().get(name); + if (inner != null) { + return new ScheduledActionImpl(inner, this.manager()); + } else { + return null; + } } public Response createOrUpdateWithResponse(String name, ScheduledActionInner scheduledAction, String ifMatch, Context context) { Response inner = this.serviceClient().createOrUpdateWithResponse(name, scheduledAction, ifMatch, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduledActionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduledActionImpl(inner.getValue(), this.manager())); } public ScheduledAction createOrUpdate(String name, ScheduledActionInner scheduledAction) { @@ -71,25 +62,6 @@ public ScheduledAction createOrUpdate(String name, ScheduledActionInner schedule } } - public Response getWithResponse(String name, Context context) { - Response inner = this.serviceClient().getWithResponse(name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduledActionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ScheduledAction get(String name) { - ScheduledActionInner inner = this.serviceClient().get(name); - if (inner != null) { - return new ScheduledActionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response deleteWithResponse(String name, Context context) { return this.serviceClient().deleteWithResponse(name, context); } @@ -98,14 +70,28 @@ public void delete(String name) { this.serviceClient().delete(name); } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); + } + + public Response runWithResponse(String name, Context context) { + return this.serviceClient().runWithResponse(name, context); + } + + public void run(String name) { + this.serviceClient().run(name); + } + public Response getByScopeWithResponse(String scope, String name, Context context) { Response inner = this.serviceClient().getByScopeWithResponse(scope, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduledActionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduledActionImpl(inner.getValue(), this.manager())); } public ScheduledAction getByScope(String scope, String name) { @@ -125,12 +111,14 @@ public void deleteByScope(String scope, String name) { this.serviceClient().deleteByScope(scope, name); } - public Response runWithResponse(String name, Context context) { - return this.serviceClient().runWithResponse(name, context); + public PagedIterable listByScope(String scope) { + PagedIterable inner = this.serviceClient().listByScope(scope); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); } - public void run(String name) { - this.serviceClient().run(name); + public PagedIterable listByScope(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().listByScope(scope, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduledActionImpl(inner1, this.manager())); } public Response runByScopeWithResponse(String scope, String name, Context context) { @@ -145,12 +133,8 @@ public void runByScope(String scope, String name) { checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { Response inner = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); } public CheckNameAvailabilityResponse @@ -168,12 +152,8 @@ public Response checkNameAvailabilityByScopeWithR CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { Response inner = this.serviceClient() .checkNameAvailabilityByScopeWithResponse(scope, checkNameAvailabilityRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); } public CheckNameAvailabilityResponse checkNameAvailabilityByScope(String scope, diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingImpl.java new file mode 100644 index 000000000000..384d59a85455 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; +import com.azure.resourcemanager.costmanagement.models.Setting; +import com.azure.resourcemanager.costmanagement.models.SettingsKind; + +public final class SettingImpl implements Setting { + private SettingInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + SettingImpl(SettingInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager 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 SettingsKind kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsClientImpl.java new file mode 100644 index 000000000000..4aee29f44b8f --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsClientImpl.java @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.costmanagement.fluent.SettingsClient; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner; +import com.azure.resourcemanager.costmanagement.models.SettingType; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SettingsClient. + */ +public final class SettingsClientImpl implements SettingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SettingsService service; + + /** + * The service client containing this operation class. + */ + private final CostManagementManagementClientImpl client; + + /** + * Initializes an instance of SettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SettingsClientImpl(CostManagementManagementClientImpl client) { + this.service = RestProxy.create(SettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CostManagementManagementClientSettings to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientSettings") + public interface SettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/settings/{type}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("type") SettingType type, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/settings/{type}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("type") SettingType type, @HeaderParam("Accept") String accept, Context context); + + @Put("/{scope}/providers/Microsoft.CostManagement/settings/{type}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("type") SettingType type, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SettingInner setting, Context context); + + @Put("/{scope}/providers/Microsoft.CostManagement/settings/{type}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("type") SettingType type, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SettingInner setting, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/settings/{type}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("type") SettingType type, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/settings/{type}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("type") SettingType type, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/settings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/settings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByScopeWithResponseAsync(String scope, SettingType type) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + type, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByScopeAsync(String scope, SettingType type) { + return getByScopeWithResponseAsync(scope, type).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByScopeWithResponse(String scope, SettingType type, Context context) { + final String accept = "application/json"; + return service.getByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, type, accept, + context); + } + + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SettingInner getByScope(String scope, SettingType type) { + return getByScopeWithResponse(scope, type, Context.NONE).getValue(); + } + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByScopeWithResponseAsync(String scope, SettingType type, + SettingInner setting) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateByScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, type, contentType, accept, setting, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByScopeAsync(String scope, SettingType type, SettingInner setting) { + return createOrUpdateByScopeWithResponseAsync(scope, type, setting) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateByScopeWithResponse(String scope, SettingType type, + SettingInner setting, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, type, + contentType, accept, setting, context); + } + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SettingInner createOrUpdateByScope(String scope, SettingType type, SettingInner setting) { + return createOrUpdateByScopeWithResponse(scope, type, setting, Context.NONE).getValue(); + } + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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> deleteByScopeWithResponseAsync(String scope, SettingType type) { + return FluxUtil + .withContext(context -> service.deleteByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + type, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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 deleteByScopeAsync(String scope, SettingType type) { + return deleteByScopeWithResponseAsync(scope, type).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByScopeWithResponse(String scope, SettingType type, Context context) { + return service.deleteByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, type, context); + } + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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 deleteByScope(String scope, SettingType type) { + deleteByScopeWithResponse(scope, type, Context.NONE); + } + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String scope) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String scope) { + return listWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String scope, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); + } + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SettingsListResultInner list(String scope) { + return listWithResponse(scope, Context.NONE).getValue(); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsImpl.java new file mode 100644 index 000000000000..702cde81053b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsImpl.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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.costmanagement.fluent.SettingsClient; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner; +import com.azure.resourcemanager.costmanagement.models.Setting; +import com.azure.resourcemanager.costmanagement.models.SettingType; +import com.azure.resourcemanager.costmanagement.models.Settings; +import com.azure.resourcemanager.costmanagement.models.SettingsListResult; + +public final class SettingsImpl implements Settings { + private static final ClientLogger LOGGER = new ClientLogger(SettingsImpl.class); + + private final SettingsClient innerClient; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + public SettingsImpl(SettingsClient innerClient, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByScopeWithResponse(String scope, SettingType type, Context context) { + Response inner = this.serviceClient().getByScopeWithResponse(scope, type, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingImpl(inner.getValue(), this.manager())); + } + + public Setting getByScope(String scope, SettingType type) { + SettingInner inner = this.serviceClient().getByScope(scope, type); + if (inner != null) { + return new SettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateByScopeWithResponse(String scope, SettingType type, SettingInner setting, + Context context) { + Response inner + = this.serviceClient().createOrUpdateByScopeWithResponse(scope, type, setting, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingImpl(inner.getValue(), this.manager())); + } + + public Setting createOrUpdateByScope(String scope, SettingType type, SettingInner setting) { + SettingInner inner = this.serviceClient().createOrUpdateByScope(scope, type, setting); + if (inner != null) { + return new SettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByScopeWithResponse(String scope, SettingType type, Context context) { + return this.serviceClient().deleteByScopeWithResponse(scope, type, context); + } + + public void deleteByScope(String scope, SettingType type) { + this.serviceClient().deleteByScope(scope, type); + } + + public Response listWithResponse(String scope, Context context) { + Response inner = this.serviceClient().listWithResponse(scope, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingsListResultImpl(inner.getValue(), this.manager())); + } + + public SettingsListResult list(String scope) { + SettingsListResultInner inner = this.serviceClient().list(scope); + if (inner != null) { + return new SettingsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private SettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsListResultImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsListResultImpl.java new file mode 100644 index 000000000000..f32d99ff792a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsListResultImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation; + +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner; +import com.azure.resourcemanager.costmanagement.models.Setting; +import com.azure.resourcemanager.costmanagement.models.SettingsListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SettingsListResultImpl implements SettingsListResult { + private SettingsListResultInner innerObject; + + private final com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager; + + SettingsListResultImpl(SettingsListResultInner innerObject, + com.azure.resourcemanager.costmanagement.CostManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new SettingImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public SettingsListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.costmanagement.CostManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewImpl.java index 6f9d3e48357e..82a21c3a7f93 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.costmanagement.fluent.models.ViewInner; import com.azure.resourcemanager.costmanagement.models.AccumulatedType; @@ -41,6 +42,10 @@ public String etag() { return this.innerModel().etag(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -212,6 +217,11 @@ public ViewImpl withScope(String scope) { return this; } + public ViewImpl withModifiedOn(OffsetDateTime modifiedOn) { + this.innerModel().withModifiedOn(modifiedOn); + return this; + } + public ViewImpl withDateRange(String dateRange) { this.innerModel().withDateRange(dateRange); return this; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsClientImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsClientImpl.java index 975425669adb..0d6188f328be 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsClientImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.costmanagement.fluent.ViewsClient; import com.azure.resourcemanager.costmanagement.fluent.models.ViewInner; -import com.azure.resourcemanager.costmanagement.models.ViewListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.ViewListResult; import reactor.core.publisher.Mono; /** @@ -45,85 +45,147 @@ public final class ViewsClientImpl implements ViewsClient { /** * The service client containing this operation class. */ - private final CostManagementClientImpl client; + private final CostManagementManagementClientImpl client; /** * Initializes an instance of ViewsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ViewsClientImpl(CostManagementClientImpl client) { + ViewsClientImpl(CostManagementManagementClientImpl client) { this.service = RestProxy.create(ViewsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for CostManagementClientViews to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for CostManagementManagementClientViews to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "CostManagementClient") + @Host("{endpoint}") + @ServiceInterface(name = "CostManagementManagementClientViews") public interface ViewsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.CostManagement/views") + @Get("/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.CostManagement/views") + @Get("/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByScope(@HostParam("$host") String endpoint, - @PathParam("scope") String scope, @QueryParam("api-version") String apiVersion, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.CostManagement/views/{viewName}") - @ExpectedResponses({ 200 }) + @Put("/providers/Microsoft.CostManagement/views/{viewName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ViewInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, - @BodyParam("application/json") ViewInner parameters, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ViewInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.CostManagement/views/{viewName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("viewName") String viewName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.CostManagement/views") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.CostManagement/views") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByScope(@HostParam("$host") String endpoint, @PathParam("scope") String scope, - @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, - @HeaderParam("Accept") String accept, Context context); + Mono> getByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/views/{viewName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); + @Put("/{scope}/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateByScope(@HostParam("$host") String endpoint, - @PathParam("scope") String scope, @QueryParam("api-version") String apiVersion, - @PathParam("viewName") String viewName, @BodyParam("application/json") ViewInner parameters, - @HeaderParam("Accept") String accept, Context context); + Mono> createOrUpdateByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("viewName") String viewName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ViewInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/{scope}/providers/Microsoft.CostManagement/views/{viewName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("viewName") String viewName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ViewInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/{scope}/providers/Microsoft.CostManagement/views/{viewName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByScope(@HostParam("$host") String endpoint, @PathParam("scope") String scope, - @QueryParam("api-version") String apiVersion, @PathParam("viewName") String viewName, + Mono> deleteByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("viewName") String viewName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.CostManagement/views/{viewName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("viewName") String viewName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/views") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.CostManagement/views") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByScopeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -131,296 +193,28 @@ Mono> deleteByScope(@HostParam("$host") String endpoint, @PathPar @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByScopeNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all views by tenant and object. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), 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())); - } + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * Lists all views by tenant and object. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all views by tenant and object. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all views by tenant and object. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all views by tenant and object. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all views by tenant and object. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeSinglePageAsync(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.listByScope(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())); - } - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeSinglePageAsync(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.listByScope(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)); - } - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByScopeAsync(String scope) { - return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope), - nextLink -> listByScopeNextSinglePageAsync(nextLink)); - } - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByScopeAsync(String scope, Context context) { - return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope, context), - nextLink -> listByScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByScope(String scope) { - return new PagedIterable<>(listByScopeAsync(scope)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByScopeNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByScope(String scope, Context context) { - return new PagedIterable<>(listByScopeAsync(scope, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByScopeNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -434,43 +228,12 @@ public PagedIterable listByScope(String scope, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String viewName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext( context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the view by view name. - * - * @param viewName View name. - * @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 view by view name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String viewName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), viewName, accept, context); - } - /** * Gets the view by view name. * @@ -497,7 +260,8 @@ private Mono getAsync(String viewName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String viewName, Context context) { - return getWithResponseAsync(viewName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), viewName, accept, context); } /** @@ -528,59 +292,14 @@ public ViewInner get(String viewName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String viewName, ViewInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - viewName, parameters, accept, context)) + viewName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may - * obtain the latest eTag by performing a get operation. Create operation does not require eTag. - * - * @param viewName View name. - * @param parameters Parameters supplied to the CreateOrUpdate View operation. - * @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 states and configurations of Cost Analysis along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String viewName, ViewInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), viewName, parameters, - accept, context); - } - /** * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. @@ -611,7 +330,10 @@ private Mono createOrUpdateAsync(String viewName, ViewInner parameter */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String viewName, ViewInner parameters, Context context) { - return createOrUpdateWithResponseAsync(viewName, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), viewName, contentType, + accept, parameters, context); } /** @@ -641,44 +363,12 @@ public ViewInner createOrUpdate(String viewName, ViewInner parameters) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String viewName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), viewName, - accept, context)) + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), viewName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * The operation to delete a view. - * - * @param viewName View name. - * @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 viewName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), viewName, accept, context); - } - /** * The operation to delete a view. * @@ -705,7 +395,7 @@ private Mono deleteAsync(String viewName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String viewName, Context context) { - return deleteWithResponseAsync(viewName, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), viewName, context); } /** @@ -722,65 +412,100 @@ public void delete(String viewName) { } /** - * Gets the view for the defined scope by view name. + * Lists all views by tenant and object. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param viewName View name. - * @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 view for the defined scope by view name along with {@link Response} on successful completion of - * {@link Mono}. + * @return result of listing views along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByScopeWithResponseAsync(String scope, String viewName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - viewName, accept, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Lists all views by tenant and object. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all views by tenant and object. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all views by tenant and object. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all views by tenant and object. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all views by tenant and object. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. - * @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. @@ -788,39 +513,18 @@ private Mono> getByScopeWithResponseAsync(String scope, Stri * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByScopeWithResponseAsync(String scope, String viewName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } + private Mono> getByScopeWithResponseAsync(String scope, String viewName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), viewName, accept, - context); + return FluxUtil + .withContext(context -> service.getByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + viewName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -835,19 +539,7 @@ private Mono getByScopeAsync(String scope, String viewName) { /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -857,25 +549,15 @@ private Mono getByScopeAsync(String scope, String viewName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByScopeWithResponse(String scope, String viewName, Context context) { - return getByScopeWithResponseAsync(scope, viewName, context).block(); + final String accept = "application/json"; + return service.getByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, viewName, accept, + context); } /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -891,19 +573,7 @@ public ViewInner getByScope(String scope, String viewName) { * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param parameters Parameters supplied to the CreateOrUpdate View operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -915,25 +585,11 @@ public ViewInner getByScope(String scope, String viewName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateByScopeWithResponseAsync(String scope, String viewName, ViewInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateByScope(this.client.getEndpoint(), scope, - this.client.getApiVersion(), viewName, parameters, accept, context)) + .withContext(context -> service.createOrUpdateByScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, viewName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -941,69 +597,7 @@ private Mono> createOrUpdateByScopeWithResponseAsync(String * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param viewName View name. - * @param parameters Parameters supplied to the CreateOrUpdate View operation. - * @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 states and configurations of Cost Analysis along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateByScopeWithResponseAsync(String scope, String viewName, - ViewInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), viewName, - parameters, accept, context); - } - - /** - * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may - * obtain the latest eTag by performing a get operation. Create operation does not require eTag. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param parameters Parameters supplied to the CreateOrUpdate View operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1021,19 +615,7 @@ private Mono createOrUpdateByScopeAsync(String scope, String viewName * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param parameters Parameters supplied to the CreateOrUpdate View operation. * @param context The context to associate with this operation. @@ -1045,26 +627,17 @@ private Mono createOrUpdateByScopeAsync(String scope, String viewName @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateByScopeWithResponse(String scope, String viewName, ViewInner parameters, Context context) { - return createOrUpdateByScopeWithResponseAsync(scope, viewName, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, + viewName, contentType, accept, parameters, context); } /** * The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may * obtain the latest eTag by performing a get operation. Create operation does not require eTag. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param parameters Parameters supplied to the CreateOrUpdate View operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1080,19 +653,7 @@ public ViewInner createOrUpdateByScope(String scope, String viewName, ViewInner /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1101,143 +662,158 @@ public ViewInner createOrUpdateByScope(String scope, String viewName, ViewInner */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteByScopeWithResponseAsync(String scope, String viewName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - viewName, accept, context)) + .withContext(context -> service.deleteByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + viewName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. - * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByScopeWithResponseAsync(String scope, String viewName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (viewName == null) { - return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteByScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), viewName, accept, - context); + private Mono deleteByScopeAsync(String scope, String viewName) { + return deleteByScopeWithResponseAsync(scope, viewName).flatMap(ignored -> Mono.empty()); } /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. + * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByScopeAsync(String scope, String viewName) { - return deleteByScopeWithResponseAsync(scope, viewName).flatMap(ignored -> Mono.empty()); + public Response deleteByScopeWithResponse(String scope, String viewName, Context context) { + return service.deleteByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, viewName, + context); } /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. - * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByScopeWithResponse(String scope, String viewName, Context context) { - return deleteByScopeWithResponseAsync(scope, viewName, context).block(); + public void deleteByScope(String scope, String viewName) { + deleteByScopeWithResponse(scope, viewName, Context.NONE); } /** - * The operation to delete a view. + * Lists all views at the given scope. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param viewName View name. + * @param scope undefined. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteByScope(String scope, String viewName) { - deleteByScopeWithResponse(scope, viewName, Context.NONE); + private Mono> listByScopeSinglePageAsync(String scope) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByScopeAsync(String scope) { + return new PagedFlux<>(() -> listByScopeSinglePageAsync(scope), + nextLink -> listByScopeNextSinglePageAsync(nextLink)); + } + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByScopeSinglePage(String scope) { + final String accept = "application/json"; + Response res = service.listByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), + scope, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByScopeSinglePage(String scope, Context context) { + final String accept = "application/json"; + Response res + = service.listByScopeSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScope(String scope) { + return new PagedIterable<>(() -> listByScopeSinglePage(scope), nextLink -> listByScopeNextSinglePage(nextLink)); + } + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScope(String scope, Context context) { + return new PagedIterable<>(() -> listByScopeSinglePage(scope, context), + nextLink -> listByScopeNextSinglePage(nextLink, context)); } /** @@ -1251,13 +827,6 @@ public void deleteByScope(String scope, String viewName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1265,6 +834,23 @@ private Mono> listNextSinglePageAsync(String nextLink) .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1273,22 +859,14 @@ private Mono> listNextSinglePageAsync(String nextLink) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return result of listing views along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1302,13 +880,6 @@ private Mono> listNextSinglePageAsync(String nextLink, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByScopeNextSinglePageAsync(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.listByScopeNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1317,6 +888,24 @@ private Mono> listByScopeNextSinglePageAsync(String nex .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByScopeNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByScopeNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1325,21 +914,14 @@ private Mono> listByScopeNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return result of listing views along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByScopeNextSinglePageAsync(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.")); - } + private PagedResponse listByScopeNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByScopeNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByScopeNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsImpl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsImpl.java index de31477501ed..ba0c3a30bf09 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsImpl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.implementation; @@ -27,34 +27,10 @@ public ViewsImpl(ViewsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); - } - - public PagedIterable listByScope(String scope) { - PagedIterable inner = this.serviceClient().listByScope(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); - } - - public PagedIterable listByScope(String scope, Context context) { - PagedIterable inner = this.serviceClient().listByScope(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); - } - public Response getWithResponse(String viewName, Context context) { Response inner = this.serviceClient().getWithResponse(viewName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ViewImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ViewImpl(inner.getValue(), this.manager())); } public View get(String viewName) { @@ -68,12 +44,8 @@ public View get(String viewName) { public Response createOrUpdateWithResponse(String viewName, ViewInner parameters, Context context) { Response inner = this.serviceClient().createOrUpdateWithResponse(viewName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ViewImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ViewImpl(inner.getValue(), this.manager())); } public View createOrUpdate(String viewName, ViewInner parameters) { @@ -93,14 +65,20 @@ public void delete(String viewName) { this.serviceClient().delete(viewName); } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); + } + public Response getByScopeWithResponse(String scope, String viewName, Context context) { Response inner = this.serviceClient().getByScopeWithResponse(scope, viewName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ViewImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ViewImpl(inner.getValue(), this.manager())); } public View getByScope(String scope, String viewName) { @@ -120,6 +98,16 @@ public void deleteByScope(String scope, String viewName) { this.serviceClient().deleteByScope(scope, viewName); } + public PagedIterable listByScope(String scope) { + PagedIterable inner = this.serviceClient().listByScope(scope); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); + } + + public PagedIterable listByScope(String scope, Context context) { + PagedIterable inner = this.serviceClient().listByScope(scope, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ViewImpl(inner1, this.manager())); + } + public View getById(String id) { String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, "/{scope}/providers/Microsoft.CostManagement/views/{viewName}", "scope"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationsListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitRecommendationsListResult.java similarity index 84% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationsListResult.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitRecommendationsListResult.java index 86ef93af4c27..74cbebd0b115 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationsListResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitRecommendationsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.costmanagement.models; +package com.azure.resourcemanager.costmanagement.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,14 +24,14 @@ public final class BenefitRecommendationsListResult implements JsonSerializable< private List value; /* - * The link (URL) to the next page of results. + * The link (url) to the next page of results. */ private String nextLink; /** * Creates an instance of BenefitRecommendationsListResult class. */ - public BenefitRecommendationsListResult() { + private BenefitRecommendationsListResult() { } /** @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: The link (URL) to the next page of results. + * Get the nextLink property: The link (url) to the next page of results. * * @return the nextLink value. */ @@ -52,23 +52,13 @@ public String nextLink() { return this.nextLink; } - /** - * 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.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitUtilizationSummariesListResult.java similarity index 88% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesListResult.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitUtilizationSummariesListResult.java index d7ba7805352e..4c1860d3f969 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesListResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitUtilizationSummariesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.costmanagement.models; +package com.azure.resourcemanager.costmanagement.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -32,7 +32,7 @@ public final class BenefitUtilizationSummariesListResult /** * Creates an instance of BenefitUtilizationSummariesListResult class. */ - public BenefitUtilizationSummariesListResult() { + private BenefitUtilizationSummariesListResult() { } /** @@ -53,23 +53,13 @@ public String nextLink() { return this.nextLink; } - /** - * 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.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BudgetsListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BudgetsListResult.java new file mode 100644 index 000000000000..371852896cef --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BudgetsListResult.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of listing budgets. It contains a list of available budgets in the scope provided. + */ +@Immutable +public final class BudgetsListResult implements JsonSerializable { + /* + * The list of budgets. + */ + private List value; + + /* + * The link (url) to the next page of results.\r\nIt's null for now, added for future use. + */ + private String nextLink; + + /** + * Creates an instance of BudgetsListResult class. + */ + private BudgetsListResult() { + } + + /** + * Get the value property: The list of budgets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results.\r\nIt's null for now, added for future + * use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetsListResult 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 BudgetsListResult. + */ + public static BudgetsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetsListResult deserializedBudgetsListResult = new BudgetsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BudgetInner.fromJson(reader1)); + deserializedBudgetsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBudgetsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetsListResult; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/CostAllocationRuleList.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/CostAllocationRuleList.java new file mode 100644 index 000000000000..4403ba6aab4a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/CostAllocationRuleList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of listing cost allocation rules. It contains a list of available rules in the billing account or enterprise + * enrollment provided. + */ +@Immutable +public final class CostAllocationRuleList implements JsonSerializable { + /* + * The list of cost allocation rules. + */ + private List value; + + /* + * URL to get the next set of rule list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of CostAllocationRuleList class. + */ + private CostAllocationRuleList() { + } + + /** + * Get the value property: The list of cost allocation rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of rule list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 CostAllocationRuleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationRuleList 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 CostAllocationRuleList. + */ + public static CostAllocationRuleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationRuleList deserializedCostAllocationRuleList = new CostAllocationRuleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CostAllocationRuleDefinitionInner.fromJson(reader1)); + deserializedCostAllocationRuleList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCostAllocationRuleList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationRuleList; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DimensionsListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/DimensionsListResult.java similarity index 78% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DimensionsListResult.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/DimensionsListResult.java index 9bf78897dc83..0223e45f3d0b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DimensionsListResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/DimensionsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.costmanagement.models; +package com.azure.resourcemanager.costmanagement.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class DimensionsListResult implements JsonSerializable value; + /* + * The link (url) to the next page of results. + */ + private String nextLink; + /** * Creates an instance of DimensionsListResult class. */ - public DimensionsListResult() { + private DimensionsListResult() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Validates the instance. + * Get the nextLink property: The link (url) to the next page of results. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } /** @@ -55,6 +58,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -76,6 +80,8 @@ public static DimensionsListResult fromJson(JsonReader jsonReader) throws IOExce if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> DimensionInner.fromJson(reader1)); deserializedDimensionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDimensionsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/MarkupRulePagedResponse.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/MarkupRulePagedResponse.java new file mode 100644 index 000000000000..2719f6a5465b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/MarkupRulePagedResponse.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Markup rule list result. It contains a list of Markup rules. + */ +@Immutable +public final class MarkupRulePagedResponse implements JsonSerializable { + /* + * The list of markup rules. + */ + private List value; + + /* + * The link (url) to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of MarkupRulePagedResponse class. + */ + private MarkupRulePagedResponse() { + } + + /** + * Get the value property: The list of markup rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 MarkupRulePagedResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarkupRulePagedResponse 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 MarkupRulePagedResponse. + */ + public static MarkupRulePagedResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarkupRulePagedResponse deserializedMarkupRulePagedResponse = new MarkupRulePagedResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MarkupRuleInner.fromJson(reader1)); + deserializedMarkupRulePagedResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMarkupRulePagedResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarkupRulePagedResponse; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/OperationListResult.java similarity index 88% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationListResult.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/OperationListResult.java index 19840b3a74ad..2d16b1b9d399 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationListResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.costmanagement.models; +package com.azure.resourcemanager.costmanagement.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -32,7 +32,7 @@ public final class OperationListResult implements JsonSerializable e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ScheduledActionListResult.java similarity index 87% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionListResult.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ScheduledActionListResult.java index 46fc48b39ec0..8155a152b909 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionListResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ScheduledActionListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.costmanagement.models; +package com.azure.resourcemanager.costmanagement.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -31,7 +31,7 @@ public final class ScheduledActionListResult implements JsonSerializable e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ViewListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ViewListResult.java similarity index 86% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ViewListResult.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ViewListResult.java index d2c6d0eb9670..24d73e1dc843 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ViewListResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ViewListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.costmanagement.models; +package com.azure.resourcemanager.costmanagement.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -31,7 +31,7 @@ public final class ViewListResult implements JsonSerializable { /** * Creates an instance of ViewListResult class. */ - public ViewListResult() { + private ViewListResult() { } /** @@ -52,23 +52,13 @@ public String nextLink() { return this.nextLink; } - /** - * 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.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/package-info.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/package-info.java index ad1e7e149db1..21febc32fc69 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/package-info.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for CostManagementClient. + * Package containing the implementations for CostManagement. * CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.costmanagement.implementation; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AccumulatedType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AccumulatedType.java index 484540373fe8..55d2e38e2cb0 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AccumulatedType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AccumulatedType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ActionType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ActionType.java index 1f9283172d55..360ef56b832e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ActionType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** - * Static value Internal for ActionType. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alert.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alert.java index 145d3639e383..22a66416426e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alert.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alert.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.AlertInner; /** @@ -39,6 +40,13 @@ public interface Alert { */ String etag(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the definition property: defines the type of alert. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCategory.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCategory.java index aec0d9affd64..3f619b7888ab 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCategory.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCriteria.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCriteria.java index c34bb8a95fe3..b0639cd1b8a3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCriteria.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCriteria.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertOperator.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertOperator.java index d23f341b6c19..6d4d5eeb85c8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertOperator.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertOperator.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDefinition.java index 0b7b38fb813e..44bd36086807 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDefinition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -97,14 +97,6 @@ public AlertPropertiesDefinition withCriteria(AlertCriteria criteria) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDetails.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDetails.java index 0d5a13f40dc9..f19566f7ce1c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDetails.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -574,14 +574,6 @@ public AlertPropertiesDetails withInvoicingThreshold(BigDecimal invoicingThresho return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -596,7 +588,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("resourceFilter", this.resourceFilter, (writer, element) -> writer.writeUntyped(element)); jsonWriter.writeArrayField("meterFilter", this.meterFilter, (writer, element) -> writer.writeUntyped(element)); - jsonWriter.writeUntypedField("tagFilter", this.tagFilter); + if (this.tagFilter != null) { + jsonWriter.writeUntypedField("tagFilter", this.tagFilter); + } jsonWriter.writeNumberField("threshold", this.threshold); jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); jsonWriter.writeNumberField("amount", this.amount); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertSource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertSource.java index 17bc74790a48..a6ccbeedcfea 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertSource.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertSource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertStatus.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertStatus.java index 12eee1cc9001..cdc0c82b7f26 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertStatus.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertTimeGrainType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertTimeGrainType.java index b5c387b025cd..2a75281b4c38 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertTimeGrainType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertTimeGrainType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertType.java index b47cf7307097..e4050b1030dd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alerts.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alerts.java index 6b7cc670ca96..2ec9d41943ca 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alerts.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Alerts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,95 +12,59 @@ */ public interface Alerts { /** - * Lists the alerts for scope defined. + * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param alertId Alert ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts along with {@link Response}. + * @return the alert for the scope by alert ID along with {@link Response}. */ - Response listWithResponse(String scope, Context context); + Response getWithResponse(String scope, String alertId, Context context); /** - * Lists the alerts for scope defined. + * Gets the alert for the scope by alert ID. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param alertId Alert ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of alerts. + * @return the alert for the scope by alert ID. */ - AlertsResult list(String scope); + Alert get(String scope, String alertId); /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param parameters Parameters supplied to the Dismiss Alert operation. * @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 alert for the scope by alert ID along with {@link Response}. + * @return an individual alert along with {@link Response}. */ - Response getWithResponse(String scope, String alertId, Context context); + Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, Context context); /** - * Gets the alert for the scope by alert ID. + * Dismisses the specified alert. * - * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param alertId Alert ID. + * @param parameters Parameters supplied to the Dismiss Alert 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 alert for the scope by alert ID. + * @return an individual alert. */ - Alert get(String scope, String alertId); + Alert dismiss(String scope, String alertId, DismissAlertPayload parameters); /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -113,18 +77,16 @@ public interface Alerts { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert operation. * @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 an individual alert along with {@link Response}. + * @return result of alerts along with {@link Response}. */ - Response dismissWithResponse(String scope, String alertId, DismissAlertPayload parameters, Context context); + Response listWithResponse(String scope, Context context); /** - * Dismisses the specified alert. + * Lists the alerts for scope defined. * * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, @@ -137,14 +99,12 @@ public interface Alerts { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param alertId Alert ID. - * @param parameters Parameters supplied to the Dismiss Alert 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 an individual alert. + * @return result of alerts. */ - Alert dismiss(String scope, String alertId, DismissAlertPayload parameters); + AlertsResult list(String scope); /** * Lists the Alerts for external cloud provider type defined. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertsResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertsResult.java index a9c73a13c1f3..d82897d27928 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertsResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AlertsResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AllSavingsBenefitDetails.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AllSavingsBenefitDetails.java index 40ffde7b3cc0..6489ca28055c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AllSavingsBenefitDetails.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AllSavingsBenefitDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -68,7 +68,7 @@ public final class AllSavingsBenefitDetails implements JsonSerializable { /** * Creates an instance of AllSavingsList class. */ - public AllSavingsList() { + private AllSavingsList() { } /** @@ -51,17 +51,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AsyncOperationStatusProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AsyncOperationStatusProperties.java new file mode 100644 index 000000000000..c6e43b6417f7 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/AsyncOperationStatusProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * Object representing the report url and valid until date of the async report generated. + */ +@Immutable +public final class AsyncOperationStatusProperties implements JsonSerializable { + /* + * Sas url to the async benefit utilization summaries report. Will be empty if the report is in Running or Failed + * state. + */ + private BenefitUtilizationSummaryReportSchema reportUrl; + + /* + * Sas url to async benefit utilization summaries report in secondary storage in case of primary outage. Will be + * empty if the report is in Running or Failed state. + */ + private BenefitUtilizationSummaryReportSchema secondaryReportUrl; + + /* + * The date that the sas url provided in reportUrl expires. + */ + private OffsetDateTime validUntil; + + /** + * Creates an instance of AsyncOperationStatusProperties class. + */ + private AsyncOperationStatusProperties() { + } + + /** + * Get the reportUrl property: Sas url to the async benefit utilization summaries report. Will be empty if the + * report is in Running or Failed state. + * + * @return the reportUrl value. + */ + public BenefitUtilizationSummaryReportSchema reportUrl() { + return this.reportUrl; + } + + /** + * Get the secondaryReportUrl property: Sas url to async benefit utilization summaries report in secondary storage + * in case of primary outage. Will be empty if the report is in Running or Failed state. + * + * @return the secondaryReportUrl value. + */ + public BenefitUtilizationSummaryReportSchema secondaryReportUrl() { + return this.secondaryReportUrl; + } + + /** + * Get the validUntil property: The date that the sas url provided in reportUrl expires. + * + * @return the validUntil value. + */ + public OffsetDateTime validUntil() { + return this.validUntil; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("reportUrl", this.reportUrl == null ? null : this.reportUrl.toString()); + jsonWriter.writeStringField("secondaryReportUrl", + this.secondaryReportUrl == null ? null : this.secondaryReportUrl.toString()); + jsonWriter.writeStringField("validUntil", + this.validUntil == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.validUntil)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AsyncOperationStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AsyncOperationStatusProperties 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 AsyncOperationStatusProperties. + */ + public static AsyncOperationStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AsyncOperationStatusProperties deserializedAsyncOperationStatusProperties + = new AsyncOperationStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("reportUrl".equals(fieldName)) { + deserializedAsyncOperationStatusProperties.reportUrl + = BenefitUtilizationSummaryReportSchema.fromString(reader.getString()); + } else if ("secondaryReportUrl".equals(fieldName)) { + deserializedAsyncOperationStatusProperties.secondaryReportUrl + = BenefitUtilizationSummaryReportSchema.fromString(reader.getString()); + } else if ("validUntil".equals(fieldName)) { + deserializedAsyncOperationStatusProperties.validUntil = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAsyncOperationStatusProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitKind.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitKind.java index a968f233f15e..5ac711116959 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitKind.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,17 +12,17 @@ */ public final class BenefitKind extends ExpandableStringEnum { /** - * Static value IncludedQuantity for BenefitKind. + * Benefit is IncludedQuantity. */ public static final BenefitKind INCLUDED_QUANTITY = fromString("IncludedQuantity"); /** - * Static value Reservation for BenefitKind. + * Benefit is Reservation. */ public static final BenefitKind RESERVATION = fromString("Reservation"); /** - * Static value SavingsPlan for BenefitKind. + * Benefit is SavingsPlan. */ public static final BenefitKind SAVINGS_PLAN = fromString("SavingsPlan"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationModel.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationModel.java index 8c23fb9c953e..d021b4ad9e33 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationModel.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationModel.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.BenefitRecommendationModelInner; /** @@ -38,6 +39,13 @@ public interface BenefitRecommendationModel { */ BenefitKind kind(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the properties property: The properties of the benefit recommendations. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationProperties.java index c747c1d499b4..a51cb4e298e7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,12 +17,12 @@ /** * The properties of the benefit recommendations. */ -@Fluent +@Immutable public class BenefitRecommendationProperties implements JsonSerializable { /* * Benefit scope. For example, Single or Shared. */ - private Scope scope = Scope.fromString("BenefitRecommendationProperties"); + private Scope scope = Scope.fromString("benefitRecommendationProperties"); /* * The first usage date used for looking back for computing the recommendations. @@ -89,7 +89,7 @@ public class BenefitRecommendationProperties implements JsonSerializable listByBillingAccountId(String billingAc /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -54,8 +54,8 @@ PagedIterable listByBillingAccountId(String billingAc /** * Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param grainParameter Grain. * @param filter Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. * @param context The context to associate with this operation. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesOperationStatus.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesOperationStatus.java new file mode 100644 index 000000000000..771ef4a680d8 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesOperationStatus.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner; + +/** + * An immutable client-side representation of BenefitUtilizationSummariesOperationStatus. + */ +public interface BenefitUtilizationSummariesOperationStatus { + /** + * Gets the input property: Input given to create the benefit utilization summaries report. + * + * @return the input value. + */ + BenefitUtilizationSummariesRequest input(); + + /** + * Gets the status property: The status of the creation of the benefit utilization summaries report. + * + * @return the status value. + */ + OperationStatusType status(); + + /** + * Gets the properties property: Contains sas url to the async benefit utilization summaries report and a date that + * the url is valid until. These values will be empty if the report is in a Running or Failed state. + * + * @return the properties value. + */ + AsyncOperationStatusProperties properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner object. + * + * @return the inner object. + */ + BenefitUtilizationSummariesOperationStatusInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesRequest.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesRequest.java new file mode 100644 index 000000000000..01875c09d1c2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesRequest.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * Properties of an async benefit utilization summaries request. + */ +@Fluent +public final class BenefitUtilizationSummariesRequest implements JsonSerializable { + /* + * Billing account the benefit utilization summaries report is for. Required for billing account and billing profile + * scopes. Not supported for any benefit scopes. + */ + private String billingAccountId; + + /* + * Billing profile id the benefit utilization summaries report is for. Required for billing profile scope. Not + * supported for billing account or any benefit scopes. + */ + private String billingProfileId; + + /* + * Benefit order id the benefit utilization summaries report is for. Required for benefit order and benefit id + * scopes. Not supported for any billing scopes. + */ + private String benefitOrderId; + + /* + * Benefit id the benefit utilization summaries report is for. Required for benefit id scope. Not supported for + * benefit order or any billing scopes. + */ + private String benefitId; + + /* + * The grain the summaries data is served at in the report. Accepted values are 'Daily' or 'Monthly'. + */ + private Grain grain; + + /* + * The start date of the summaries data that will be served in the report. + */ + private OffsetDateTime startDate; + + /* + * The end date of the summaries data that will be served in the report. + */ + private OffsetDateTime endDate; + + /* + * The type of benefit data requested. Required for billing account and billing profile scopes. Implied and not to + * be passed at benefit scopes. Supported values are Reservation and SavingsPlan + */ + private BenefitKind kind; + + /** + * Creates an instance of BenefitUtilizationSummariesRequest class. + */ + public BenefitUtilizationSummariesRequest() { + } + + /** + * Get the billingAccountId property: Billing account the benefit utilization summaries report is for. Required for + * billing account and billing profile scopes. Not supported for any benefit scopes. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Set the billingAccountId property: Billing account the benefit utilization summaries report is for. Required for + * billing account and billing profile scopes. Not supported for any benefit scopes. + * + * @param billingAccountId the billingAccountId value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withBillingAccountId(String billingAccountId) { + this.billingAccountId = billingAccountId; + return this; + } + + /** + * Get the billingProfileId property: Billing profile id the benefit utilization summaries report is for. Required + * for billing profile scope. Not supported for billing account or any benefit scopes. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Set the billingProfileId property: Billing profile id the benefit utilization summaries report is for. Required + * for billing profile scope. Not supported for billing account or any benefit scopes. + * + * @param billingProfileId the billingProfileId value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withBillingProfileId(String billingProfileId) { + this.billingProfileId = billingProfileId; + return this; + } + + /** + * Get the benefitOrderId property: Benefit order id the benefit utilization summaries report is for. Required for + * benefit order and benefit id scopes. Not supported for any billing scopes. + * + * @return the benefitOrderId value. + */ + public String benefitOrderId() { + return this.benefitOrderId; + } + + /** + * Set the benefitOrderId property: Benefit order id the benefit utilization summaries report is for. Required for + * benefit order and benefit id scopes. Not supported for any billing scopes. + * + * @param benefitOrderId the benefitOrderId value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withBenefitOrderId(String benefitOrderId) { + this.benefitOrderId = benefitOrderId; + return this; + } + + /** + * Get the benefitId property: Benefit id the benefit utilization summaries report is for. Required for benefit id + * scope. Not supported for benefit order or any billing scopes. + * + * @return the benefitId value. + */ + public String benefitId() { + return this.benefitId; + } + + /** + * Set the benefitId property: Benefit id the benefit utilization summaries report is for. Required for benefit id + * scope. Not supported for benefit order or any billing scopes. + * + * @param benefitId the benefitId value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withBenefitId(String benefitId) { + this.benefitId = benefitId; + return this; + } + + /** + * Get the grain property: The grain the summaries data is served at in the report. Accepted values are 'Daily' or + * 'Monthly'. + * + * @return the grain value. + */ + public Grain grain() { + return this.grain; + } + + /** + * Set the grain property: The grain the summaries data is served at in the report. Accepted values are 'Daily' or + * 'Monthly'. + * + * @param grain the grain value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withGrain(Grain grain) { + this.grain = grain; + return this; + } + + /** + * Get the startDate property: The start date of the summaries data that will be served in the report. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Set the startDate property: The start date of the summaries data that will be served in the report. + * + * @param startDate the startDate value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the endDate property: The end date of the summaries data that will be served in the report. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.endDate; + } + + /** + * Set the endDate property: The end date of the summaries data that will be served in the report. + * + * @param endDate the endDate value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get the kind property: The type of benefit data requested. Required for billing account and billing profile + * scopes. Implied and not to be passed at benefit scopes. Supported values are Reservation and SavingsPlan. + * + * @return the kind value. + */ + public BenefitKind kind() { + return this.kind; + } + + /** + * Set the kind property: The type of benefit data requested. Required for billing account and billing profile + * scopes. Implied and not to be passed at benefit scopes. Supported values are Reservation and SavingsPlan. + * + * @param kind the kind value to set. + * @return the BenefitUtilizationSummariesRequest object itself. + */ + public BenefitUtilizationSummariesRequest withKind(BenefitKind kind) { + this.kind = kind; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("grain", this.grain == null ? null : this.grain.toString()); + jsonWriter.writeStringField("startDate", + this.startDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDate)); + jsonWriter.writeStringField("endDate", + this.endDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDate)); + jsonWriter.writeStringField("billingAccountId", this.billingAccountId); + jsonWriter.writeStringField("billingProfileId", this.billingProfileId); + jsonWriter.writeStringField("benefitOrderId", this.benefitOrderId); + jsonWriter.writeStringField("benefitId", this.benefitId); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BenefitUtilizationSummariesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BenefitUtilizationSummariesRequest 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 BenefitUtilizationSummariesRequest. + */ + public static BenefitUtilizationSummariesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BenefitUtilizationSummariesRequest deserializedBenefitUtilizationSummariesRequest + = new BenefitUtilizationSummariesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("grain".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.grain = Grain.fromString(reader.getString()); + } else if ("startDate".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.startDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDate".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.endDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("billingAccountId".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.billingAccountId = reader.getString(); + } else if ("billingProfileId".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.billingProfileId = reader.getString(); + } else if ("benefitOrderId".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.benefitOrderId = reader.getString(); + } else if ("benefitId".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.benefitId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedBenefitUtilizationSummariesRequest.kind = BenefitKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBenefitUtilizationSummariesRequest; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummary.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummary.java index 77b9c6cf1782..1e8510adda01 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummary.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummary.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummaryInner; /** @@ -38,6 +39,13 @@ public interface BenefitUtilizationSummary { */ BenefitKind kind(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummaryInner object. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaryProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaryProperties.java index 2ae9c1a9d058..ef7a44028a96 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaryProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaryProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -16,7 +16,7 @@ /** * The properties of a benefit utilization summary. */ -@Fluent +@Immutable public class BenefitUtilizationSummaryProperties implements JsonSerializable { /* * ARM SKU name. For example, 'Compute_Savings_Plan' for savings plan. @@ -47,7 +47,7 @@ public class BenefitUtilizationSummaryProperties implements JsonSerializable { + /** + * Static value Kind for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema KIND = fromString("Kind"); + + /** + * Static value AvgUtilizationPercentage for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema AVG_UTILIZATION_PERCENTAGE + = fromString("AvgUtilizationPercentage"); + + /** + * Static value BenefitOrderId for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema BENEFIT_ORDER_ID = fromString("BenefitOrderId"); + + /** + * Static value BenefitId for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema BENEFIT_ID = fromString("BenefitId"); + + /** + * Static value BenefitType for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema BENEFIT_TYPE = fromString("BenefitType"); + + /** + * Static value MaxUtilizationPercentage for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema MAX_UTILIZATION_PERCENTAGE + = fromString("MaxUtilizationPercentage"); + + /** + * Static value MinUtilizationPercentage for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema MIN_UTILIZATION_PERCENTAGE + = fromString("MinUtilizationPercentage"); + + /** + * Static value UsageDate for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema USAGE_DATE = fromString("UsageDate"); + + /** + * Static value UtilizedPercentage for BenefitUtilizationSummaryReportSchema. + */ + public static final BenefitUtilizationSummaryReportSchema UTILIZED_PERCENTAGE = fromString("UtilizedPercentage"); + + /** + * Creates a new instance of BenefitUtilizationSummaryReportSchema value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BenefitUtilizationSummaryReportSchema() { + } + + /** + * Creates or finds a BenefitUtilizationSummaryReportSchema from its string representation. + * + * @param name a name to look for. + * @return the corresponding BenefitUtilizationSummaryReportSchema. + */ + public static BenefitUtilizationSummaryReportSchema fromString(String name) { + return fromString(name, BenefitUtilizationSummaryReportSchema.class); + } + + /** + * Gets known BenefitUtilizationSummaryReportSchema values. + * + * @return known BenefitUtilizationSummaryReportSchema values. + */ + public static Collection values() { + return values(BenefitUtilizationSummaryReportSchema.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BlobInfo.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BlobInfo.java index 2cd372d945ef..48035e440a2f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BlobInfo.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BlobInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The blob information generated by this operation. */ -@Fluent +@Immutable public final class BlobInfo implements JsonSerializable { /* * Link to the blob to download file. @@ -29,7 +29,7 @@ public final class BlobInfo implements JsonSerializable { /** * Creates an instance of BlobInfo class. */ - public BlobInfo() { + private BlobInfo() { } /** @@ -41,17 +41,6 @@ public String blobLink() { return this.blobLink; } - /** - * Set the blobLink property: Link to the blob to download file. - * - * @param blobLink the blobLink value to set. - * @return the BlobInfo object itself. - */ - public BlobInfo withBlobLink(String blobLink) { - this.blobLink = blobLink; - return this; - } - /** * Get the byteCount property: Bytes in the blob. * @@ -61,25 +50,6 @@ public Long byteCount() { return this.byteCount; } - /** - * Set the byteCount property: Bytes in the blob. - * - * @param byteCount the byteCount value to set. - * @return the BlobInfo object itself. - */ - public BlobInfo withByteCount(Long byteCount) { - this.byteCount = byteCount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Budget.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Budget.java new file mode 100644 index 000000000000..ad00cb3bbd74 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Budget.java @@ -0,0 +1,606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; +import java.util.Map; + +/** + * An immutable client-side representation of Budget. + */ +public interface Budget { + /** + * 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 eTag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the eTag value. + */ + String eTag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * + * @return the category value. + */ + CategoryType category(); + + /** + * Gets the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * + * @return the amount value. + */ + Double amount(); + + /** + * Gets the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @return the timeGrain value. + */ + TimeGrainType timeGrain(); + + /** + * Gets the timePeriod property: The time period that defines the active period of the budget. The budget will + * evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * + * @return the timePeriod value. + */ + BudgetTimePeriod timePeriod(); + + /** + * Gets the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @return the filter value. + */ + BudgetFilter filter(); + + /** + * Gets the currentSpend property: The current amount of cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + * + * @return the currentSpend value. + */ + CurrentSpend currentSpend(); + + /** + * Gets the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 + * notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not + * applicable. + * + * @return the notifications value. + */ + Map notifications(); + + /** + * Gets the forecastSpend property: The forecasted cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + * + * @return the forecastSpend value. + */ + ForecastSpend forecastSpend(); + + /** + * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner object. + * + * @return the inner object. + */ + BudgetInner innerModel(); + + /** + * The entirety of the Budget definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** + * The Budget definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Budget definition. + */ + interface Blank extends WithScope { + } + + /** + * The stage of the Budget definition allowing to specify parent resource. + */ + interface WithScope { + /** + * Specifies scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @return the next definition stage. + */ + WithCreate withExistingScope(String scope); + } + + /** + * The stage of the Budget 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.WithETag, DefinitionStages.WithCategory, + DefinitionStages.WithAmount, DefinitionStages.WithTimeGrain, DefinitionStages.WithTimePeriod, + DefinitionStages.WithFilter, DefinitionStages.WithNotifications { + /** + * Executes the create request. + * + * @return the created resource. + */ + Budget create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Budget create(Context context); + } + + /** + * The stage of the Budget definition allowing to specify eTag. + */ + interface WithETag { + /** + * Specifies the eTag property: eTag of the resource. To handle concurrent update scenario, this field will + * be used to determine whether the user is updating the latest version or not.. + * + * @param eTag eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * @return the next definition stage. + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the Budget definition allowing to specify category. + */ + interface WithCategory { + /** + * Specifies the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.. + * + * @param category The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * @return the next definition stage. + */ + WithCreate withCategory(CategoryType category); + } + + /** + * The stage of the Budget definition allowing to specify amount. + */ + interface WithAmount { + /** + * Specifies the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost.. + * + * @param amount The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * @return the next definition stage. + */ + WithCreate withAmount(Double amount); + } + + /** + * The stage of the Budget definition allowing to specify timeGrain. + */ + interface WithTimeGrain { + /** + * Specifies the timeGrain property: The time covered by a budget. Tracking of the amount will be reset + * based on the time grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization.. + * + * @param timeGrain The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * @return the next definition stage. + */ + WithCreate withTimeGrain(TimeGrainType timeGrain); + } + + /** + * The stage of the Budget definition allowing to specify timePeriod. + */ + interface WithTimePeriod { + /** + * Specifies the timePeriod property: The time period that defines the active period of the budget. The + * budget will evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization.. + * + * @param timePeriod The time period that defines the active period of the budget. The budget will evaluate + * data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * @return the next definition stage. + */ + WithCreate withTimePeriod(BudgetTimePeriod timePeriod); + } + + /** + * The stage of the Budget definition allowing to specify filter. + */ + interface WithFilter { + /** + * Specifies the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization.. + * + * @param filter May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * @return the next definition stage. + */ + WithCreate withFilter(BudgetFilter filter); + } + + /** + * The stage of the Budget definition allowing to specify notifications. + */ + interface WithNotifications { + /** + * Specifies the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: + * Actual and 5 notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType + * is not applicable.. + * + * @param notifications Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: + * Actual and 5 notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType + * is not applicable. + * @return the next definition stage. + */ + WithCreate withNotifications(Map notifications); + } + } + + /** + * Begins update for the Budget resource. + * + * @return the stage of resource update. + */ + Budget.Update update(); + + /** + * The template for Budget update. + */ + interface Update + extends UpdateStages.WithETag, UpdateStages.WithCategory, UpdateStages.WithAmount, UpdateStages.WithTimeGrain, + UpdateStages.WithTimePeriod, UpdateStages.WithFilter, UpdateStages.WithNotifications { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Budget apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Budget apply(Context context); + } + + /** + * The Budget update stages. + */ + interface UpdateStages { + /** + * The stage of the Budget update allowing to specify eTag. + */ + interface WithETag { + /** + * Specifies the eTag property: eTag of the resource. To handle concurrent update scenario, this field will + * be used to determine whether the user is updating the latest version or not.. + * + * @param eTag eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * @return the next definition stage. + */ + Update withETag(String eTag); + } + + /** + * The stage of the Budget update allowing to specify category. + */ + interface WithCategory { + /** + * Specifies the category property: The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.. + * + * @param category The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + * @return the next definition stage. + */ + Update withCategory(CategoryType category); + } + + /** + * The stage of the Budget update allowing to specify amount. + */ + interface WithAmount { + /** + * Specifies the amount property: The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost.. + * + * @param amount The total amount of cost to track with the budget. + * + * Supported for CategoryType(s): Cost. + * + * Required for CategoryType(s): Cost. + * @return the next definition stage. + */ + Update withAmount(Double amount); + } + + /** + * The stage of the Budget update allowing to specify timeGrain. + */ + interface WithTimeGrain { + /** + * Specifies the timeGrain property: The time covered by a budget. Tracking of the amount will be reset + * based on the time grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization.. + * + * @param timeGrain The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * @return the next definition stage. + */ + Update withTimeGrain(TimeGrainType timeGrain); + } + + /** + * The stage of the Budget update allowing to specify timePeriod. + */ + interface WithTimePeriod { + /** + * Specifies the timePeriod property: The time period that defines the active period of the budget. The + * budget will evaluate data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization.. + * + * @param timePeriod The time period that defines the active period of the budget. The budget will evaluate + * data on or after the startDate and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + * @return the next definition stage. + */ + Update withTimePeriod(BudgetTimePeriod timePeriod); + } + + /** + * The stage of the Budget update allowing to specify filter. + */ + interface WithFilter { + /** + * Specifies the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization.. + * + * @param filter May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * @return the next definition stage. + */ + Update withFilter(BudgetFilter filter); + } + + /** + * The stage of the Budget update allowing to specify notifications. + */ + interface WithNotifications { + /** + * Specifies the notifications property: Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: + * Actual and 5 notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType + * is not applicable.. + * + * @param notifications Dictionary of notifications associated with the budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: + * Actual and 5 notifications with thresholdType: Forecasted. + * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType + * is not applicable. + * @return the next definition stage. + */ + Update withNotifications(Map notifications); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Budget refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Budget refresh(Context context); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetComparisonExpression.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetComparisonExpression.java new file mode 100644 index 000000000000..9969945a25ea --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetComparisonExpression.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * The comparison expression to be used in the budgets. + */ +@Fluent +public final class BudgetComparisonExpression implements JsonSerializable { + /* + * The name of the column to use in comparison. + */ + private String name; + + /* + * The operator to use for comparison. + */ + private BudgetOperatorType operator; + + /* + * Array of values to use for comparison + */ + private List values; + + /** + * Creates an instance of BudgetComparisonExpression class. + */ + public BudgetComparisonExpression() { + } + + /** + * Get the name property: The name of the column to use in comparison. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the column to use in comparison. + * + * @param name the name value to set. + * @return the BudgetComparisonExpression object itself. + */ + public BudgetComparisonExpression withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operator property: The operator to use for comparison. + * + * @return the operator value. + */ + public BudgetOperatorType operator() { + return this.operator; + } + + /** + * Set the operator property: The operator to use for comparison. + * + * @param operator the operator value to set. + * @return the BudgetComparisonExpression object itself. + */ + public BudgetComparisonExpression withOperator(BudgetOperatorType operator) { + this.operator = operator; + return this; + } + + /** + * Get the values property: Array of values to use for comparison. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Array of values to use for comparison. + * + * @param values the values value to set. + * @return the BudgetComparisonExpression object itself. + */ + public BudgetComparisonExpression withValues(List values) { + this.values = values; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetComparisonExpression from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetComparisonExpression 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 BudgetComparisonExpression. + */ + public static BudgetComparisonExpression fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetComparisonExpression deserializedBudgetComparisonExpression = new BudgetComparisonExpression(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedBudgetComparisonExpression.name = reader.getString(); + } else if ("operator".equals(fieldName)) { + deserializedBudgetComparisonExpression.operator = BudgetOperatorType.fromString(reader.getString()); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedBudgetComparisonExpression.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetComparisonExpression; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilter.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilter.java new file mode 100644 index 000000000000..d4012014f60d --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilter.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * May be used to filter budgets by user-specified dimensions and/or tags. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ +@Fluent +public final class BudgetFilter implements JsonSerializable { + /* + * The logical "AND" expression. Must have at least 2 items. + * + * Supported for CategoryType(s): Cost. + */ + private List and; + + /* + * Has comparison expression for a dimension. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported dimension names for **CategoryType: ReservationUtilization** + * - ReservationId + * - ReservedResourceType + */ + private BudgetComparisonExpression dimensions; + + /* + * Has comparison expression for a tag. + * + * Supported for CategoryType(s): Cost. + */ + private BudgetComparisonExpression tags; + + /** + * Creates an instance of BudgetFilter class. + */ + public BudgetFilter() { + } + + /** + * Get the and property: The logical "AND" expression. Must have at least 2 items. + * + * Supported for CategoryType(s): Cost. + * + * @return the and value. + */ + public List and() { + return this.and; + } + + /** + * Set the and property: The logical "AND" expression. Must have at least 2 items. + * + * Supported for CategoryType(s): Cost. + * + * @param and the and value to set. + * @return the BudgetFilter object itself. + */ + public BudgetFilter withAnd(List and) { + this.and = and; + return this; + } + + /** + * Get the dimensions property: Has comparison expression for a dimension. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported dimension names for **CategoryType: ReservationUtilization** + * - ReservationId + * - ReservedResourceType. + * + * @return the dimensions value. + */ + public BudgetComparisonExpression dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Has comparison expression for a dimension. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported dimension names for **CategoryType: ReservationUtilization** + * - ReservationId + * - ReservedResourceType. + * + * @param dimensions the dimensions value to set. + * @return the BudgetFilter object itself. + */ + public BudgetFilter withDimensions(BudgetComparisonExpression dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the tags property: Has comparison expression for a tag. + * + * Supported for CategoryType(s): Cost. + * + * @return the tags value. + */ + public BudgetComparisonExpression tags() { + return this.tags; + } + + /** + * Set the tags property: Has comparison expression for a tag. + * + * Supported for CategoryType(s): Cost. + * + * @param tags the tags value to set. + * @return the BudgetFilter object itself. + */ + public BudgetFilter withTags(BudgetComparisonExpression tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("and", this.and, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dimensions", this.dimensions); + jsonWriter.writeJsonField("tags", this.tags); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetFilter 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 BudgetFilter. + */ + public static BudgetFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetFilter deserializedBudgetFilter = new BudgetFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("and".equals(fieldName)) { + List and + = reader.readArray(reader1 -> BudgetFilterProperties.fromJson(reader1)); + deserializedBudgetFilter.and = and; + } else if ("dimensions".equals(fieldName)) { + deserializedBudgetFilter.dimensions = BudgetComparisonExpression.fromJson(reader); + } else if ("tags".equals(fieldName)) { + deserializedBudgetFilter.tags = BudgetComparisonExpression.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetFilter; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilterProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilterProperties.java new file mode 100644 index 000000000000..baa578f87fd9 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilterProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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 Dimensions or Tags to filter a budget by. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ +@Fluent +public final class BudgetFilterProperties implements JsonSerializable { + /* + * Has comparison expression for a dimension. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported dimension names for **CategoryType: ReservationUtilization** + * - ReservationId + * - ReservedResourceType + */ + private BudgetComparisonExpression dimensions; + + /* + * Has comparison expression for a tag. + * + * Supported for CategoryType(s): Cost. + */ + private BudgetComparisonExpression tags; + + /** + * Creates an instance of BudgetFilterProperties class. + */ + public BudgetFilterProperties() { + } + + /** + * Get the dimensions property: Has comparison expression for a dimension. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported dimension names for **CategoryType: ReservationUtilization** + * - ReservationId + * - ReservedResourceType. + * + * @return the dimensions value. + */ + public BudgetComparisonExpression dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Has comparison expression for a dimension. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported dimension names for **CategoryType: ReservationUtilization** + * - ReservationId + * - ReservedResourceType. + * + * @param dimensions the dimensions value to set. + * @return the BudgetFilterProperties object itself. + */ + public BudgetFilterProperties withDimensions(BudgetComparisonExpression dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the tags property: Has comparison expression for a tag. + * + * Supported for CategoryType(s): Cost. + * + * @return the tags value. + */ + public BudgetComparisonExpression tags() { + return this.tags; + } + + /** + * Set the tags property: Has comparison expression for a tag. + * + * Supported for CategoryType(s): Cost. + * + * @param tags the tags value to set. + * @return the BudgetFilterProperties object itself. + */ + public BudgetFilterProperties withTags(BudgetComparisonExpression tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dimensions", this.dimensions); + jsonWriter.writeJsonField("tags", this.tags); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetFilterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetFilterProperties 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 BudgetFilterProperties. + */ + public static BudgetFilterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetFilterProperties deserializedBudgetFilterProperties = new BudgetFilterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensions".equals(fieldName)) { + deserializedBudgetFilterProperties.dimensions = BudgetComparisonExpression.fromJson(reader); + } else if ("tags".equals(fieldName)) { + deserializedBudgetFilterProperties.tags = BudgetComparisonExpression.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetFilterProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetNotificationOperatorType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetNotificationOperatorType.java new file mode 100644 index 000000000000..f52b26d6d8af --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetNotificationOperatorType.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The comparison operator. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported operators for **CategoryType: Cost** + * - GreaterThan + * - GreaterThanOrEqualTo + * + * Supported operators for **CategoryType: ReservationUtilization** + * - LessThan. + */ +public final class BudgetNotificationOperatorType extends ExpandableStringEnum { + /** + * Notification will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended + * to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to + * missing of your alert. This OperatorType will be deprecated in future. + * + * Supported for CategoryType(s): Cost. + */ + public static final BudgetNotificationOperatorType EQUAL_TO = fromString("EqualTo"); + + /** + * Notification will be triggered if the evaluated cost is greater than the threshold value. Note: This is the + * recommended OperatorType while configuring Budget Alert. + * + * Supported for CategoryType(s): Cost. + */ + public static final BudgetNotificationOperatorType GREATER_THAN = fromString("GreaterThan"); + + /** + * Notification will be triggered if the evaluated cost is greater than or equal to the threshold value. + * + * Supported for CategoryType(s): Cost. + */ + public static final BudgetNotificationOperatorType GREATER_THAN_OR_EQUAL_TO = fromString("GreaterThanOrEqualTo"); + + /** + * Notification will be triggered if any Reservations in the scope of the Reservation Utilization Alert Rule have a + * utilization less than the threshold percentage. + * + * Supported for CategoryType(s): ReservationUtilization. + */ + public static final BudgetNotificationOperatorType LESS_THAN = fromString("LessThan"); + + /** + * Creates a new instance of BudgetNotificationOperatorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BudgetNotificationOperatorType() { + } + + /** + * Creates or finds a BudgetNotificationOperatorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BudgetNotificationOperatorType. + */ + public static BudgetNotificationOperatorType fromString(String name) { + return fromString(name, BudgetNotificationOperatorType.class); + } + + /** + * Gets known BudgetNotificationOperatorType values. + * + * @return known BudgetNotificationOperatorType values. + */ + public static Collection values() { + return values(BudgetNotificationOperatorType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetOperatorType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetOperatorType.java new file mode 100644 index 000000000000..04fa4e60a879 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetOperatorType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operator to use for comparison. + */ +public final class BudgetOperatorType extends ExpandableStringEnum { + /** + * Static value In for BudgetOperatorType. + */ + public static final BudgetOperatorType IN = fromString("In"); + + /** + * Creates a new instance of BudgetOperatorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BudgetOperatorType() { + } + + /** + * Creates or finds a BudgetOperatorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BudgetOperatorType. + */ + public static BudgetOperatorType fromString(String name) { + return fromString(name, BudgetOperatorType.class); + } + + /** + * Gets known BudgetOperatorType values. + * + * @return known BudgetOperatorType values. + */ + public static Collection values() { + return values(BudgetOperatorType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetTimePeriod.java new file mode 100644 index 000000000000..c90a78ab8a11 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetTimePeriod.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate + * and will expire on the endDate. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Required for CategoryType(s): Cost, ReservationUtilization. + */ +@Fluent +public final class BudgetTimePeriod implements JsonSerializable { + /* + * The start date for the budget. + * + * - Constraints for **CategoryType: Cost** - Must be first of the month and should be less than the end date. + * Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past + * start date should be selected within the timegrain period. + * + * - Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current date and less than + * the end date. + */ + private OffsetDateTime startDate; + + /* + * The end date for the budget. + * + * - Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to 10 years from the + * start date. + * + * - Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3 years after the start + * date. + */ + private OffsetDateTime endDate; + + /** + * Creates an instance of BudgetTimePeriod class. + */ + public BudgetTimePeriod() { + } + + /** + * Get the startDate property: The start date for the budget. + * + * - Constraints for **CategoryType: Cost** - Must be first of the month and should be less than the end date. + * Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past + * start date should be selected within the timegrain period. + * + * - Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current date and less than + * the end date. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Set the startDate property: The start date for the budget. + * + * - Constraints for **CategoryType: Cost** - Must be first of the month and should be less than the end date. + * Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past + * start date should be selected within the timegrain period. + * + * - Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current date and less than + * the end date. + * + * @param startDate the startDate value to set. + * @return the BudgetTimePeriod object itself. + */ + public BudgetTimePeriod withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the endDate property: The end date for the budget. + * + * - Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to 10 years from the + * start date. + * + * - Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3 years after the start + * date. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.endDate; + } + + /** + * Set the endDate property: The end date for the budget. + * + * - Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to 10 years from the + * start date. + * + * - Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3 years after the start + * date. + * + * @param endDate the endDate value to set. + * @return the BudgetTimePeriod object itself. + */ + public BudgetTimePeriod withEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startDate", + this.startDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDate)); + jsonWriter.writeStringField("endDate", + this.endDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BudgetTimePeriod from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BudgetTimePeriod 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 BudgetTimePeriod. + */ + public static BudgetTimePeriod fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BudgetTimePeriod deserializedBudgetTimePeriod = new BudgetTimePeriod(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startDate".equals(fieldName)) { + deserializedBudgetTimePeriod.startDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDate".equals(fieldName)) { + deserializedBudgetTimePeriod.endDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBudgetTimePeriod; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Budgets.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Budgets.java new file mode 100644 index 000000000000..ae284f124f41 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Budgets.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Budgets. + */ +public interface Budgets { + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 budget for the scope by budget name along with {@link Response}. + */ + Response getWithResponse(String scope, String budgetName, Context context); + + /** + * Gets the budget for the scope by budget name. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the budget for the scope by budget name. + */ + Budget get(String scope, String budgetName); + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 Response}. + */ + Response deleteByResourceGroupWithResponse(String scope, String budgetName, Context context); + + /** + * The operation to delete a budget. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param budgetName Budget Name. + * @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 scope, String budgetName); + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope); + + /** + * Lists all budgets for the defined scope. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' + * only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing budgets as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String filter, Context context); + + /** + * Gets the budget for the scope by budget name. + * + * @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. + * @return the budget for the scope by budget name along with {@link Response}. + */ + Budget getById(String id); + + /** + * Gets the budget for the scope by budget name. + * + * @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. + * @return the budget for the scope by budget name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete a budget. + * + * @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); + + /** + * The operation to delete a budget. + * + * @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. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Budget resource. + * + * @param name resource name. + * @return the first stage of the new Budget definition. + */ + Budget.DefinitionStages.Blank define(String name); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CategoryType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CategoryType.java new file mode 100644 index 000000000000..665a80d65fea --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CategoryType.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The category of the budget. + * - 'Cost' defines a Budget. + * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule. + */ +public final class CategoryType extends ExpandableStringEnum { + /** + * A Budget that evaluates monetary cost of Azure resources against an amount, and alerts based on a configured + * notification threshold. + */ + public static final CategoryType COST = fromString("Cost"); + + /** + * An Alert Rule that evaluates the utilization percentage of Azure Reservations, and alerts based on a configured + * notification threshold. + */ + public static final CategoryType RESERVATION_UTILIZATION = fromString("ReservationUtilization"); + + /** + * Creates a new instance of CategoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoryType() { + } + + /** + * Creates or finds a CategoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoryType. + */ + public static CategoryType fromString(String name) { + return fromString(name, CategoryType.class); + } + + /** + * Gets known CategoryType values. + * + * @return known CategoryType values. + */ + public static Collection values() { + return values(CategoryType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ChartType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ChartType.java index 660d09bbf32c..2f7f4e614f9c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ChartType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ChartType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityReason.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityReason.java index 8f21a7c5ec77..56f10f133fe4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityReason.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityReason.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * The reason why the given name is not available. + * Possible reasons for a name not being available. */ public final class CheckNameAvailabilityReason extends ExpandableStringEnum { /** - * Static value Invalid for CheckNameAvailabilityReason. + * Name is invalid. */ public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); /** - * Static value AlreadyExists for CheckNameAvailabilityReason. + * Name already exists. */ public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityRequest.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityRequest.java index aa338b3c52a0..6d24d2df6a8a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityRequest.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -72,14 +72,6 @@ public CheckNameAvailabilityRequest withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityResponse.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityResponse.java index ab7708de2ed4..3d38bbf59836 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityResponse.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -25,7 +25,7 @@ public interface CheckNameAvailabilityResponse { CheckNameAvailabilityReason reason(); /** - * Gets the message property: Detailed reason why the given name is available. + * Gets the message property: Detailed reason why the given name is not available. * * @return the message value. */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CommonExportProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CommonExportProperties.java index 56239d2a8d33..ab417686a281 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CommonExportProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CommonExportProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,7 +12,7 @@ */ public interface CommonExportProperties { /** - * Gets the format property: The format of the export being delivered. Currently only 'Csv' is supported. + * Gets the format property: The format of the export being delivered. * * @return the format value. */ @@ -41,13 +41,36 @@ public interface CommonExportProperties { /** * Gets the partitionData property: If set to true, exported data will be partitioned by size and placed in a blob - * directory together with a manifest file. Note: this option is currently available only for Microsoft Customer - * Agreement commerce scopes. + * directory together with a manifest file. * * @return the partitionData value. */ Boolean partitionData(); + /** + * Gets the dataOverwriteBehavior property: Allow customers to select overwrite data(OverwritePreviousReport) for + * exports. This setting will enable overwrite data for the same month in customer storage account. By default set + * to CreateNewReport. + * + * @return the dataOverwriteBehavior value. + */ + DataOverwriteBehaviorType dataOverwriteBehavior(); + + /** + * Gets the compressionMode property: Allow customers to select compress data for exports. This setting will enable + * destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. + * + * @return the compressionMode value. + */ + CompressionModeType compressionMode(); + + /** + * Gets the exportDescription property: The export description set by customer at time of export creation/update. + * + * @return the exportDescription value. + */ + String exportDescription(); + /** * Gets the nextRunTimeEstimate property: If the export has an active schedule, provides an estimate of the next run * time. @@ -56,6 +79,14 @@ public interface CommonExportProperties { */ OffsetDateTime nextRunTimeEstimate(); + /** + * Gets the systemSuspensionContext property: The export suspension reason if export is in SystemSuspended state. + * This is not populated currently. + * + * @return the systemSuspensionContext value. + */ + ExportSuspensionContext systemSuspensionContext(); + /** * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.CommonExportPropertiesInner object. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CompressionModeType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CompressionModeType.java new file mode 100644 index 000000000000..4220b294afba --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CompressionModeType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allow customers to select compress data for exports. This setting will enable destination file compression scheme at + * runtime. By default set to None. Gzip is for csv and snappy for parquet. + */ +public final class CompressionModeType extends ExpandableStringEnum { + /** + * Static value gzip for CompressionModeType. + */ + public static final CompressionModeType GZIP = fromString("gzip"); + + /** + * Static value snappy for CompressionModeType. + */ + public static final CompressionModeType SNAPPY = fromString("snappy"); + + /** + * Static value none for CompressionModeType. + */ + public static final CompressionModeType NONE = fromString("none"); + + /** + * Creates a new instance of CompressionModeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CompressionModeType() { + } + + /** + * Creates or finds a CompressionModeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CompressionModeType. + */ + public static CompressionModeType fromString(String name) { + return fromString(name, CompressionModeType.class); + } + + /** + * Gets known CompressionModeType values. + * + * @return known CompressionModeType values. + */ + public static Collection values() { + return values(CompressionModeType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationPolicyType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationPolicyType.java new file mode 100644 index 000000000000..edb3b51f2e3b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationPolicyType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Method to use for allocating cost. FixedProportion indicates that cost will be split based on specified percentage + * values. + */ +public final class CostAllocationPolicyType extends ExpandableStringEnum { + /** + * Static value FixedProportion for CostAllocationPolicyType. + */ + public static final CostAllocationPolicyType FIXED_PROPORTION = fromString("FixedProportion"); + + /** + * Creates a new instance of CostAllocationPolicyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CostAllocationPolicyType() { + } + + /** + * Creates or finds a CostAllocationPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CostAllocationPolicyType. + */ + public static CostAllocationPolicyType fromString(String name) { + return fromString(name, CostAllocationPolicyType.class); + } + + /** + * Gets known CostAllocationPolicyType values. + * + * @return known CostAllocationPolicyType values. + */ + public static Collection values() { + return values(CostAllocationPolicyType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationProportion.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationProportion.java new file mode 100644 index 000000000000..92e869f3405c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationProportion.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * Target resources and allocation. + */ +@Fluent +public final class CostAllocationProportion implements JsonSerializable { + /* + * Target resource for cost allocation + */ + private String name; + + /* + * Percentage of source cost to allocate to this resource. This value can be specified to two decimal places and the + * total percentage of all resources in this rule must sum to 100.00. + */ + private double percentage; + + /** + * Creates an instance of CostAllocationProportion class. + */ + public CostAllocationProportion() { + } + + /** + * Get the name property: Target resource for cost allocation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Target resource for cost allocation. + * + * @param name the name value to set. + * @return the CostAllocationProportion object itself. + */ + public CostAllocationProportion withName(String name) { + this.name = name; + return this; + } + + /** + * Get the percentage property: Percentage of source cost to allocate to this resource. This value can be specified + * to two decimal places and the total percentage of all resources in this rule must sum to 100.00. + * + * @return the percentage value. + */ + public double percentage() { + return this.percentage; + } + + /** + * Set the percentage property: Percentage of source cost to allocate to this resource. This value can be specified + * to two decimal places and the total percentage of all resources in this rule must sum to 100.00. + * + * @param percentage the percentage value to set. + * @return the CostAllocationProportion object itself. + */ + public CostAllocationProportion withPercentage(double percentage) { + this.percentage = percentage; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeDoubleField("percentage", this.percentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationProportion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationProportion 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 CostAllocationProportion. + */ + public static CostAllocationProportion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationProportion deserializedCostAllocationProportion = new CostAllocationProportion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCostAllocationProportion.name = reader.getString(); + } else if ("percentage".equals(fieldName)) { + deserializedCostAllocationProportion.percentage = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationProportion; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResource.java new file mode 100644 index 000000000000..06cd6008bcf3 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResource.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * Common values for resources for cost allocation. + */ +@Fluent +public class CostAllocationResource implements JsonSerializable { + /* + * Type of resources contained in this cost allocation rule + */ + private CostAllocationResourceType resourceType; + + /* + * If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, + * this must be a valid Azure tag + */ + private String name; + + /** + * Creates an instance of CostAllocationResource class. + */ + public CostAllocationResource() { + } + + /** + * Get the resourceType property: Type of resources contained in this cost allocation rule. + * + * @return the resourceType value. + */ + public CostAllocationResourceType resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Type of resources contained in this cost allocation rule. + * + * @param resourceType the resourceType value to set. + * @return the CostAllocationResource object itself. + */ + public CostAllocationResource withResourceType(CostAllocationResourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the name property: If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If + * resource type is tag, this must be a valid Azure tag. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If + * resource type is tag, this must be a valid Azure tag. + * + * @param name the name value to set. + * @return the CostAllocationResource object itself. + */ + public CostAllocationResource withName(String name) { + this.name = name; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationResource 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 CostAllocationResource. + */ + public static CostAllocationResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationResource deserializedCostAllocationResource = new CostAllocationResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedCostAllocationResource.resourceType + = CostAllocationResourceType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedCostAllocationResource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationResource; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResourceType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResourceType.java new file mode 100644 index 000000000000..9a60a22e3b09 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResourceType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Category of resource to use for allocation. + */ +public final class CostAllocationResourceType extends ExpandableStringEnum { + /** + * Indicates an Azure dimension such as a subscription id or resource group name is being used for allocation. + */ + public static final CostAllocationResourceType DIMENSION = fromString("Dimension"); + + /** + * Allocates cost based on Azure Tag key value pairs. + */ + public static final CostAllocationResourceType TAG = fromString("Tag"); + + /** + * Creates a new instance of CostAllocationResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CostAllocationResourceType() { + } + + /** + * Creates or finds a CostAllocationResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CostAllocationResourceType. + */ + public static CostAllocationResourceType fromString(String name) { + return fromString(name, CostAllocationResourceType.class); + } + + /** + * Gets known CostAllocationResourceType values. + * + * @return known CostAllocationResourceType values. + */ + public static Collection values() { + return values(CostAllocationResourceType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityRequest.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityRequest.java new file mode 100644 index 000000000000..e9f3db345b73 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityRequest.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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 cost allocation rule check name availability request. + */ +@Fluent +public final class CostAllocationRuleCheckNameAvailabilityRequest + implements JsonSerializable { + /* + * Rule name + */ + private String name; + + /* + * Resource type. This is expected to be Microsoft.CostManagement/costAllocationRules + */ + private String type; + + /** + * Creates an instance of CostAllocationRuleCheckNameAvailabilityRequest class. + */ + public CostAllocationRuleCheckNameAvailabilityRequest() { + } + + /** + * Get the name property: Rule name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Rule name. + * + * @param name the name value to set. + * @return the CostAllocationRuleCheckNameAvailabilityRequest object itself. + */ + public CostAllocationRuleCheckNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. This is expected to be Microsoft.CostManagement/costAllocationRules. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. This is expected to be Microsoft.CostManagement/costAllocationRules. + * + * @param type the type value to set. + * @return the CostAllocationRuleCheckNameAvailabilityRequest object itself. + */ + public CostAllocationRuleCheckNameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationRuleCheckNameAvailabilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationRuleCheckNameAvailabilityRequest 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 CostAllocationRuleCheckNameAvailabilityRequest. + */ + public static CostAllocationRuleCheckNameAvailabilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationRuleCheckNameAvailabilityRequest deserializedCostAllocationRuleCheckNameAvailabilityRequest + = new CostAllocationRuleCheckNameAvailabilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCostAllocationRuleCheckNameAvailabilityRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCostAllocationRuleCheckNameAvailabilityRequest.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationRuleCheckNameAvailabilityRequest; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityResponse.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityResponse.java new file mode 100644 index 000000000000..6255c03d2099 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner; + +/** + * An immutable client-side representation of CostAllocationRuleCheckNameAvailabilityResponse. + */ +public interface CostAllocationRuleCheckNameAvailabilityResponse { + /** + * Gets the nameAvailable property: Whether this rule name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason this name is not available. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the message property: Error message if the name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner + * com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner + * object. + * + * @return the inner object. + */ + CostAllocationRuleCheckNameAvailabilityResponseInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDefinition.java new file mode 100644 index 000000000000..56345b42fcbb --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDefinition.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; + +/** + * An immutable client-side representation of CostAllocationRuleDefinition. + */ +public interface CostAllocationRuleDefinition { + /** + * 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 properties property: Cost allocation rule properties. + * + * @return the properties value. + */ + CostAllocationRuleProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner object. + * + * @return the inner object. + */ + CostAllocationRuleDefinitionInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDetails.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDetails.java new file mode 100644 index 000000000000..3f197616cda5 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDetails.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * Resource details of the cost allocation rule. + */ +@Fluent +public final class CostAllocationRuleDetails implements JsonSerializable { + /* + * Source resources for cost allocation. At this time, this list can contain no more than one element. + */ + private List sourceResources; + + /* + * Target resources for cost allocation. At this time, this list can contain no more than one element. + */ + private List targetResources; + + /** + * Creates an instance of CostAllocationRuleDetails class. + */ + public CostAllocationRuleDetails() { + } + + /** + * Get the sourceResources property: Source resources for cost allocation. At this time, this list can contain no + * more than one element. + * + * @return the sourceResources value. + */ + public List sourceResources() { + return this.sourceResources; + } + + /** + * Set the sourceResources property: Source resources for cost allocation. At this time, this list can contain no + * more than one element. + * + * @param sourceResources the sourceResources value to set. + * @return the CostAllocationRuleDetails object itself. + */ + public CostAllocationRuleDetails withSourceResources(List sourceResources) { + this.sourceResources = sourceResources; + return this; + } + + /** + * Get the targetResources property: Target resources for cost allocation. At this time, this list can contain no + * more than one element. + * + * @return the targetResources value. + */ + public List targetResources() { + return this.targetResources; + } + + /** + * Set the targetResources property: Target resources for cost allocation. At this time, this list can contain no + * more than one element. + * + * @param targetResources the targetResources value to set. + * @return the CostAllocationRuleDetails object itself. + */ + public CostAllocationRuleDetails withTargetResources(List targetResources) { + this.targetResources = targetResources; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sourceResources", this.sourceResources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("targetResources", this.targetResources, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationRuleDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationRuleDetails 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 CostAllocationRuleDetails. + */ + public static CostAllocationRuleDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationRuleDetails deserializedCostAllocationRuleDetails = new CostAllocationRuleDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceResources".equals(fieldName)) { + List sourceResources + = reader.readArray(reader1 -> SourceCostAllocationResource.fromJson(reader1)); + deserializedCostAllocationRuleDetails.sourceResources = sourceResources; + } else if ("targetResources".equals(fieldName)) { + List targetResources + = reader.readArray(reader1 -> TargetCostAllocationResource.fromJson(reader1)); + deserializedCostAllocationRuleDetails.targetResources = targetResources; + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationRuleDetails; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleProperties.java new file mode 100644 index 000000000000..a744af3e969b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleProperties.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * The properties of a cost allocation rule. + */ +@Fluent +public final class CostAllocationRuleProperties implements JsonSerializable { + /* + * Description of a cost allocation rule. + */ + private String description; + + /* + * Resource information for the cost allocation rule + */ + private CostAllocationRuleDetails details; + + /* + * Status of the rule + */ + private RuleStatus status; + + /* + * Time at which the rule was created. Rules that change cost for the same resource are applied in order of + * creation. + */ + private OffsetDateTime createdDate; + + /* + * Time at which the rule was last updated. + */ + private OffsetDateTime updatedDate; + + /** + * Creates an instance of CostAllocationRuleProperties class. + */ + public CostAllocationRuleProperties() { + } + + /** + * Get the description property: Description of a cost allocation rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of a cost allocation rule. + * + * @param description the description value to set. + * @return the CostAllocationRuleProperties object itself. + */ + public CostAllocationRuleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the details property: Resource information for the cost allocation rule. + * + * @return the details value. + */ + public CostAllocationRuleDetails details() { + return this.details; + } + + /** + * Set the details property: Resource information for the cost allocation rule. + * + * @param details the details value to set. + * @return the CostAllocationRuleProperties object itself. + */ + public CostAllocationRuleProperties withDetails(CostAllocationRuleDetails details) { + this.details = details; + return this; + } + + /** + * Get the status property: Status of the rule. + * + * @return the status value. + */ + public RuleStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the rule. + * + * @param status the status value to set. + * @return the CostAllocationRuleProperties object itself. + */ + public CostAllocationRuleProperties withStatus(RuleStatus status) { + this.status = status; + return this; + } + + /** + * Get the createdDate property: Time at which the rule was created. Rules that change cost for the same resource + * are applied in order of creation. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: Time at which the rule was last updated. + * + * @return the updatedDate value. + */ + public OffsetDateTime updatedDate() { + return this.updatedDate; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("details", this.details); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostAllocationRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostAllocationRuleProperties 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 CostAllocationRuleProperties. + */ + public static CostAllocationRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostAllocationRuleProperties deserializedCostAllocationRuleProperties = new CostAllocationRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("details".equals(fieldName)) { + deserializedCostAllocationRuleProperties.details = CostAllocationRuleDetails.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedCostAllocationRuleProperties.status = RuleStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedCostAllocationRuleProperties.description = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + deserializedCostAllocationRuleProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + deserializedCostAllocationRuleProperties.updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedCostAllocationRuleProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRules.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRules.java new file mode 100644 index 000000000000..c5055b4586ea --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRules.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; + +/** + * Resource collection API of CostAllocationRules. + */ +public interface CostAllocationRules { + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cost allocation rule by rule name and billing account or enterprise enrollment along with + * {@link Response}. + */ + Response getWithResponse(String billingAccountId, String ruleName, Context context); + + /** + * Get a cost allocation rule by rule name and billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cost allocation rule by rule name and billing account or enterprise enrollment. + */ + CostAllocationRuleDefinition get(String billingAccountId, String ruleName); + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition along with {@link Response}. + */ + Response createOrUpdateWithResponse(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule, Context context); + + /** + * Create/Update a rule to allocate cost between different resources within a billing account or enterprise + * enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @param costAllocationRule Cost allocation rule to be created or updated. + * @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 cost allocation rule model definition. + */ + CostAllocationRuleDefinition createOrUpdate(String billingAccountId, String ruleName, + CostAllocationRuleDefinitionInner costAllocationRule); + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 Response}. + */ + Response deleteByResourceGroupWithResponse(String billingAccountId, String ruleName, Context context); + + /** + * Delete cost allocation rule for billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param ruleName Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters + * other than '_' and '-'. The max length is 260 characters. + * @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 billingAccountId, String ruleName); + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String billingAccountId); + + /** + * Get the list of all cost allocation rules for a billing account or enterprise enrollment. + * + * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all cost allocation rules for a billing account or enterprise enrollment as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String billingAccountId, Context context); + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse(String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest, Context context); + + /** + * Checks availability and correctness of a name for a cost allocation rule. + * + * @param billingAccountId BillingAccount ID. + * @param costAllocationRuleCheckNameAvailabilityRequest Cost allocation rule to be created or updated. + * @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 cost allocation rule check name availability response. + */ + CostAllocationRuleCheckNameAvailabilityResponse checkNameAvailability(String billingAccountId, + CostAllocationRuleCheckNameAvailabilityRequest costAllocationRuleCheckNameAvailabilityRequest); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsDataFormat.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsDataFormat.java index 2eed827db474..a3db37b55c37 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsDataFormat.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsDataFormat.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,7 +12,7 @@ */ public final class CostDetailsDataFormat extends ExpandableStringEnum { /** - * Static value Csv for CostDetailsDataFormat. + * Csv data format. */ public static final CostDetailsDataFormat CSV = fromString("Csv"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsMetricType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsMetricType.java index 8bdb58bcb618..ac5ad2089696 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsMetricType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsMetricType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,12 +12,12 @@ */ public final class CostDetailsMetricType extends ExpandableStringEnum { /** - * Static value ActualCost for CostDetailsMetricType. + * Actual cost data. */ public static final CostDetailsMetricType ACTUAL_COST = fromString("ActualCost"); /** - * Static value AmortizedCost for CostDetailsMetricType. + * Amortized cost data. */ public static final CostDetailsMetricType AMORTIZED_COST = fromString("AmortizedCost"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsOperationResults.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsOperationResults.java index d0903f1f1ab4..3560c430bba1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsOperationResults.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsOperationResults.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsStatusType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsStatusType.java index 6f4ff13de17f..a7f8b8393c57 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsStatusType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsStatusType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,17 +12,17 @@ */ public final class CostDetailsStatusType extends ExpandableStringEnum { /** - * Static value Completed for CostDetailsStatusType. + * Operation is Completed. */ public static final CostDetailsStatusType COMPLETED = fromString("Completed"); /** - * Static value NoDataFound for CostDetailsStatusType. + * Operation is Completed and no cost data found. */ public static final CostDetailsStatusType NO_DATA_FOUND = fromString("NoDataFound"); /** - * Static value Failed for CostDetailsStatusType. + * Operation Failed. */ public static final CostDetailsStatusType FAILED = fromString("Failed"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsTimePeriod.java index 44026a1c90c4..9a7eb39bd707 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsTimePeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsTimePeriod.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -74,24 +73,6 @@ public CostDetailsTimePeriod withEnd(String end) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (start() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property start in model CostDetailsTimePeriod")); - } - if (end() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property end in model CostDetailsTimePeriod")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CostDetailsTimePeriod.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementOperation.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementOperation.java index 40a3feea83c5..c756d638ff0c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementOperation.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -20,7 +20,7 @@ public interface CostManagementOperation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface CostManagementOperation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementProxyResource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementProxyResource.java index 76834308767e..5f658a5829e6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementProxyResource.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementProxyResource.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -14,93 +14,115 @@ /** * The Resource model definition. */ -@Fluent -public class CostManagementProxyResource extends ProxyResource { +@Immutable +public class CostManagementProxyResource implements JsonSerializable { /* - * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user - * is updating the latest version or not. + * Resource Id. */ - private String etag; + private String id; /* - * The type of the resource. + * Resource name. */ - private String type; + private String name; /* - * The name of the resource. + * Resource type. */ - private String name; + private String type; /* - * Fully qualified resource Id for the resource. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user + * is updating the latest version or not. */ - private String id; + private String etag; /** * Creates an instance of CostManagementProxyResource class. */ - public CostManagementProxyResource() { + protected CostManagementProxyResource() { } /** - * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. + * Get the id property: Resource Id. * - * @return the etag value. + * @return the id value. */ - public String etag() { - return this.etag; + public String id() { + return this.id; } /** - * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. + * Set the id property: Resource Id. * - * @param etag the etag value to set. + * @param id the id value to set. * @return the CostManagementProxyResource object itself. */ - public CostManagementProxyResource withEtag(String etag) { - this.etag = etag; + CostManagementProxyResource withId(String id) { + this.id = id; return this; } /** - * Get the type property: The type of the resource. + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the CostManagementProxyResource object itself. + */ + CostManagementProxyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. * * @return the type value. */ - @Override public String type() { return this.type; } /** - * Get the name property: The name of the resource. + * Set the type property: Resource type. * - * @return the name value. + * @param type the type value to set. + * @return the CostManagementProxyResource object itself. */ - @Override - public String name() { - return this.name; + CostManagementProxyResource withType(String type) { + this.type = type; + return this; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. * - * @return the id value. + * @return the etag value. */ - @Override - public String id() { - return this.id; + public String etag() { + return this.etag; } /** - * Validates the instance. + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param etag the etag value to set. + * @return the CostManagementProxyResource object itself. */ - public void validate() { + CostManagementProxyResource withEtag(String etag) { + this.etag = etag; + return this; } /** @@ -119,7 +141,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CostManagementProxyResource 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 CostManagementProxyResource. */ public static CostManagementProxyResource fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementResource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementResource.java index b0951366f33c..bdd5ec674542 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementResource.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementResource.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -15,133 +15,187 @@ /** * The Resource model definition. */ -@Fluent -public class CostManagementResource extends Resource { +@Immutable +public class CostManagementResource implements JsonSerializable { /* - * SKU of the resource. + * Resource Id. */ - private String sku; + private String id; /* - * ETag of the resource. + * Resource name. */ - private String etag; + private String name; /* - * The type of the resource. + * Resource type. */ private String type; /* - * The name of the resource. + * Location of the resource. */ - private String name; + private String location; /* - * Fully qualified resource Id for the resource. + * SKU of the resource. */ - private String id; + private String sku; + + /* + * ETag of the resource. + */ + private String etag; + + /* + * Resource tags. + */ + private Map tags; /** * Creates an instance of CostManagementResource class. */ - public CostManagementResource() { + protected CostManagementResource() { } /** - * Get the sku property: SKU of the resource. + * Get the id property: Resource Id. * - * @return the sku value. + * @return the id value. */ - public String sku() { - return this.sku; + public String id() { + return this.id; } /** - * Set the sku property: SKU of the resource. + * Set the id property: Resource Id. * - * @param sku the sku value to set. + * @param id the id value to set. * @return the CostManagementResource object itself. */ - CostManagementResource withSku(String sku) { - this.sku = sku; + CostManagementResource withId(String id) { + this.id = id; return this; } /** - * Get the etag property: ETag of the resource. + * Get the name property: Resource name. * - * @return the etag value. + * @return the name value. */ - public String etag() { - return this.etag; + public String name() { + return this.name; } /** - * Set the etag property: ETag of the resource. + * Set the name property: Resource name. * - * @param etag the etag value to set. + * @param name the name value to set. * @return the CostManagementResource object itself. */ - CostManagementResource withEtag(String etag) { - this.etag = etag; + CostManagementResource withName(String name) { + this.name = name; return this; } /** - * Get the type property: The type of the resource. + * Get the type property: Resource type. * * @return the type value. */ - @Override public String type() { return this.type; } /** - * Get the name property: The name of the resource. + * Set the type property: Resource type. * - * @return the name value. + * @param type the type value to set. + * @return the CostManagementResource object itself. */ - @Override - public String name() { - return this.name; + CostManagementResource withType(String type) { + this.type = type; + return this; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the location property: Location of the resource. * - * @return the id value. + * @return the location value. */ - @Override - public String id() { - return this.id; + public String location() { + return this.location; } /** - * {@inheritDoc} + * Set the location property: Location of the resource. + * + * @param location the location value to set. + * @return the CostManagementResource object itself. */ - @Override - public CostManagementResource withLocation(String location) { - super.withLocation(location); + CostManagementResource withLocation(String location) { + this.location = location; return this; } /** - * {@inheritDoc} + * Get the sku property: SKU of the resource. + * + * @return the sku value. */ - @Override - public CostManagementResource withTags(Map tags) { - super.withTags(tags); + public String sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the resource. + * + * @param sku the sku value to set. + * @return the CostManagementResource object itself. + */ + CostManagementResource withSku(String sku) { + this.sku = sku; return this; } /** - * Validates the instance. + * Get the etag property: ETag of the resource. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the etag value. */ - public void validate() { + public String etag() { + return this.etag; + } + + /** + * Set the etag property: ETag of the resource. + * + * @param etag the etag value to set. + * @return the CostManagementResource object itself. + */ + CostManagementResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * 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 CostManagementResource object itself. + */ + CostManagementResource withTags(Map tags) { + this.tags = tags; + return this; } /** @@ -150,8 +204,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -161,7 +213,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CostManagementResource 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 CostManagementResource. */ public static CostManagementResource fromJson(JsonReader jsonReader) throws IOException { @@ -178,14 +229,14 @@ public static CostManagementResource fromJson(JsonReader jsonReader) throws IOEx } else if ("type".equals(fieldName)) { deserializedCostManagementResource.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedCostManagementResource.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCostManagementResource.withTags(tags); + deserializedCostManagementResource.location = reader.getString(); } else if ("sku".equals(fieldName)) { deserializedCostManagementResource.sku = reader.getString(); } else if ("eTag".equals(fieldName)) { deserializedCostManagementResource.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCostManagementResource.tags = tags; } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CultureCode.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CultureCode.java new file mode 100644 index 000000000000..a193e7ad97d7 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CultureCode.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Language in which the recipient will receive the notification, + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ +public final class CultureCode extends ExpandableStringEnum { + /** + * Static value en-us for CultureCode. + */ + public static final CultureCode EN_US = fromString("en-us"); + + /** + * Static value ja-jp for CultureCode. + */ + public static final CultureCode JA_JP = fromString("ja-jp"); + + /** + * Static value zh-cn for CultureCode. + */ + public static final CultureCode ZH_CN = fromString("zh-cn"); + + /** + * Static value de-de for CultureCode. + */ + public static final CultureCode DE_DE = fromString("de-de"); + + /** + * Static value es-es for CultureCode. + */ + public static final CultureCode ES_ES = fromString("es-es"); + + /** + * Static value fr-fr for CultureCode. + */ + public static final CultureCode FR_FR = fromString("fr-fr"); + + /** + * Static value it-it for CultureCode. + */ + public static final CultureCode IT_IT = fromString("it-it"); + + /** + * Static value ko-kr for CultureCode. + */ + public static final CultureCode KO_KR = fromString("ko-kr"); + + /** + * Static value pt-br for CultureCode. + */ + public static final CultureCode PT_BR = fromString("pt-br"); + + /** + * Static value ru-ru for CultureCode. + */ + public static final CultureCode RU_RU = fromString("ru-ru"); + + /** + * Static value zh-tw for CultureCode. + */ + public static final CultureCode ZH_TW = fromString("zh-tw"); + + /** + * Static value cs-cz for CultureCode. + */ + public static final CultureCode CS_CZ = fromString("cs-cz"); + + /** + * Static value pl-pl for CultureCode. + */ + public static final CultureCode PL_PL = fromString("pl-pl"); + + /** + * Static value tr-tr for CultureCode. + */ + public static final CultureCode TR_TR = fromString("tr-tr"); + + /** + * Static value da-dk for CultureCode. + */ + public static final CultureCode DA_DK = fromString("da-dk"); + + /** + * Static value en-gb for CultureCode. + */ + public static final CultureCode EN_GB = fromString("en-gb"); + + /** + * Static value hu-hu for CultureCode. + */ + public static final CultureCode HU_HU = fromString("hu-hu"); + + /** + * Static value nb-no for CultureCode. + */ + public static final CultureCode NB_NO = fromString("nb-no"); + + /** + * Static value nl-nl for CultureCode. + */ + public static final CultureCode NL_NL = fromString("nl-nl"); + + /** + * Static value pt-pt for CultureCode. + */ + public static final CultureCode PT_PT = fromString("pt-pt"); + + /** + * Static value sv-se for CultureCode. + */ + public static final CultureCode SV_SE = fromString("sv-se"); + + /** + * Creates a new instance of CultureCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CultureCode() { + } + + /** + * Creates or finds a CultureCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CultureCode. + */ + public static CultureCode fromString(String name) { + return fromString(name, CultureCode.class); + } + + /** + * Gets known CultureCode values. + * + * @return known CultureCode values. + */ + public static Collection values() { + return values(CultureCode.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CurrentSpend.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CurrentSpend.java new file mode 100644 index 000000000000..3fea864fef77 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CurrentSpend.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Immutable; +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 current amount of cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + */ +@Immutable +public final class CurrentSpend implements JsonSerializable { + /* + * The total amount of cost which is being tracked by the budget. + */ + private Double amount; + + /* + * The unit of measure for the budget amount. + */ + private String unit; + + /** + * Creates an instance of CurrentSpend class. + */ + private CurrentSpend() { + } + + /** + * Get the amount property: The total amount of cost which is being tracked by the budget. + * + * @return the amount value. + */ + public Double amount() { + return this.amount; + } + + /** + * Get the unit property: The unit of measure for the budget amount. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CurrentSpend from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CurrentSpend 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 CurrentSpend. + */ + public static CurrentSpend fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CurrentSpend deserializedCurrentSpend = new CurrentSpend(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amount".equals(fieldName)) { + deserializedCurrentSpend.amount = reader.getNullable(JsonReader::getDouble); + } else if ("unit".equals(fieldName)) { + deserializedCurrentSpend.unit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCurrentSpend; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CustomerMetadata.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CustomerMetadata.java new file mode 100644 index 000000000000..2e13b5e194c1 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/CustomerMetadata.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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 customer billing metadata. + */ +@Fluent +public final class CustomerMetadata implements JsonSerializable { + /* + * Customer billing account id + */ + private String billingAccountId; + + /* + * Customer billing profile id + */ + private String billingProfileId; + + /** + * Creates an instance of CustomerMetadata class. + */ + public CustomerMetadata() { + } + + /** + * Get the billingAccountId property: Customer billing account id. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Set the billingAccountId property: Customer billing account id. + * + * @param billingAccountId the billingAccountId value to set. + * @return the CustomerMetadata object itself. + */ + public CustomerMetadata withBillingAccountId(String billingAccountId) { + this.billingAccountId = billingAccountId; + return this; + } + + /** + * Get the billingProfileId property: Customer billing profile id. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Set the billingProfileId property: Customer billing profile id. + * + * @param billingProfileId the billingProfileId value to set. + * @return the CustomerMetadata object itself. + */ + public CustomerMetadata withBillingProfileId(String billingProfileId) { + this.billingProfileId = billingProfileId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("billingAccountId", this.billingAccountId); + jsonWriter.writeStringField("billingProfileId", this.billingProfileId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomerMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomerMetadata 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 CustomerMetadata. + */ + public static CustomerMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomerMetadata deserializedCustomerMetadata = new CustomerMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("billingAccountId".equals(fieldName)) { + deserializedCustomerMetadata.billingAccountId = reader.getString(); + } else if ("billingProfileId".equals(fieldName)) { + deserializedCustomerMetadata.billingProfileId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomerMetadata; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DataOverwriteBehaviorType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DataOverwriteBehaviorType.java new file mode 100644 index 000000000000..2428d3d1cf84 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DataOverwriteBehaviorType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allow customers to select overwrite data(OverwritePreviousReport) for exports. This setting will enable overwrite + * data for the same month in customer storage account. By default set to CreateNewReport. + */ +public final class DataOverwriteBehaviorType extends ExpandableStringEnum { + /** + * Static value OverwritePreviousReport for DataOverwriteBehaviorType. + */ + public static final DataOverwriteBehaviorType OVERWRITE_PREVIOUS_REPORT = fromString("OverwritePreviousReport"); + + /** + * Static value CreateNewReport for DataOverwriteBehaviorType. + */ + public static final DataOverwriteBehaviorType CREATE_NEW_REPORT = fromString("CreateNewReport"); + + /** + * Creates a new instance of DataOverwriteBehaviorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataOverwriteBehaviorType() { + } + + /** + * Creates or finds a DataOverwriteBehaviorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataOverwriteBehaviorType. + */ + public static DataOverwriteBehaviorType fromString(String name) { + return fromString(name, DataOverwriteBehaviorType.class); + } + + /** + * Gets known DataOverwriteBehaviorType values. + * + * @return known DataOverwriteBehaviorType values. + */ + public static Collection values() { + return values(DataOverwriteBehaviorType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DaysOfWeek.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DaysOfWeek.java index a87abebbc27c..744c6628e9a9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DaysOfWeek.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DaysOfWeek.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DestinationType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DestinationType.java new file mode 100644 index 000000000000..d6d4a43c8a9c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DestinationType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The export delivery destination type. Currently only 'AzureBlob' is supported. + */ +public final class DestinationType extends ExpandableStringEnum { + /** + * Static value AzureBlob for DestinationType. + */ + public static final DestinationType AZURE_BLOB = fromString("AzureBlob"); + + /** + * Creates a new instance of DestinationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DestinationType() { + } + + /** + * Creates or finds a DestinationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationType. + */ + public static DestinationType fromString(String name) { + return fromString(name, DestinationType.class); + } + + /** + * Gets known DestinationType values. + * + * @return known DestinationType values. + */ + public static Collection values() { + return values(DestinationType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimension.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimension.java index f66e1af2df14..b9dc2b65c2ab 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimension.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimension.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -14,40 +14,33 @@ */ public interface Dimension { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Resource Id. * * @return the id value. */ String id(); /** - * Gets the name property: The name of the resource. + * Gets the name property: Resource name. * * @return the name value. */ String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the location property: Location of the resource. * * @return the location value. */ String location(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the sku property: SKU of the resource. * @@ -62,6 +55,13 @@ public interface Dimension { */ String etag(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the description property: Dimension description. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimensions.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimensions.java index 644c9b83719f..e48b96ca3038 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimensions.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Dimensions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DismissAlertPayload.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DismissAlertPayload.java index 20de1bed3323..9745139f3d57 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DismissAlertPayload.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DismissAlertPayload.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -290,17 +290,6 @@ public DismissAlertPayload withStatusModificationTime(String statusModificationT return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DownloadUrl.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DownloadUrl.java index 5532b30d16be..3e2540001991 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DownloadUrl.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/DownloadUrl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionStatus.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionStatus.java index 5be7941327eb..cdf632237602 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionStatus.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionType.java index ad66b3a5054e..f94728df1df9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Export.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Export.java index 13ad604f9f1a..a7cd2663d82a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Export.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Export.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.costmanagement.fluent.models.ExportExecutionListResultInner; import com.azure.resourcemanager.costmanagement.fluent.models.ExportInner; @@ -35,6 +37,21 @@ public interface Export { */ String type(); + /** + * Gets the identity property: The managed identity associated with Export. + * + * @return the identity value. + */ + SystemAssignedServiceIdentity identity(); + + /** + * Gets the location property: The location of the Export's managed identity. Only required when utilizing managed + * identity. + * + * @return the location value. + */ + String location(); + /** * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. @@ -43,6 +60,13 @@ public interface Export { */ String etag(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the schedule property: Has schedule information for the export. * @@ -51,7 +75,7 @@ public interface Export { ExportSchedule schedule(); /** - * Gets the format property: The format of the export being delivered. Currently only 'Csv' is supported. + * Gets the format property: The format of the export being delivered. * * @return the format value. */ @@ -80,13 +104,36 @@ public interface Export { /** * Gets the partitionData property: If set to true, exported data will be partitioned by size and placed in a blob - * directory together with a manifest file. Note: this option is currently available only for Microsoft Customer - * Agreement commerce scopes. + * directory together with a manifest file. * * @return the partitionData value. */ Boolean partitionData(); + /** + * Gets the dataOverwriteBehavior property: Allow customers to select overwrite data(OverwritePreviousReport) for + * exports. This setting will enable overwrite data for the same month in customer storage account. By default set + * to CreateNewReport. + * + * @return the dataOverwriteBehavior value. + */ + DataOverwriteBehaviorType dataOverwriteBehavior(); + + /** + * Gets the compressionMode property: Allow customers to select compress data for exports. This setting will enable + * destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. + * + * @return the compressionMode value. + */ + CompressionModeType compressionMode(); + + /** + * Gets the exportDescription property: The export description set by customer at time of export creation/update. + * + * @return the exportDescription value. + */ + String exportDescription(); + /** * Gets the nextRunTimeEstimate property: If the export has an active schedule, provides an estimate of the next run * time. @@ -95,6 +142,28 @@ public interface Export { */ OffsetDateTime nextRunTimeEstimate(); + /** + * Gets the systemSuspensionContext property: The export suspension reason if export is in SystemSuspended state. + * This is not populated currently. + * + * @return the systemSuspensionContext value. + */ + ExportSuspensionContext systemSuspensionContext(); + + /** + * 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.costmanagement.fluent.models.ExportInner object. * @@ -125,21 +194,7 @@ interface WithScope { /** * Specifies scope. * - * @param scope The scope associated with export operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for - * Department scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @return the next definition stage. */ WithCreate withExistingScope(String scope); @@ -149,9 +204,11 @@ interface WithScope { * The stage of the Export 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.WithEtag, DefinitionStages.WithSchedule, - DefinitionStages.WithFormat, DefinitionStages.WithDeliveryInfo, DefinitionStages.WithDefinition, - DefinitionStages.WithRunHistory, DefinitionStages.WithPartitionData { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithIdentity, + DefinitionStages.WithEtag, DefinitionStages.WithSchedule, DefinitionStages.WithFormat, + DefinitionStages.WithDeliveryInfo, DefinitionStages.WithDefinition, DefinitionStages.WithRunHistory, + DefinitionStages.WithPartitionData, DefinitionStages.WithDataOverwriteBehavior, + DefinitionStages.WithCompressionMode, DefinitionStages.WithExportDescription { /** * Executes the create request. * @@ -168,6 +225,42 @@ interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithSch Export create(Context context); } + /** + * The stage of the Export definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the Export's managed identity. Only required when utilizing managed + * identity. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the Export's managed identity. Only required when utilizing managed + * identity. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the Export definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity associated with Export. + * + * @param identity The managed identity associated with Export. + * @return the next definition stage. + */ + WithCreate withIdentity(SystemAssignedServiceIdentity identity); + } + /** * The stage of the Export definition allowing to specify etag. */ @@ -201,10 +294,9 @@ interface WithSchedule { */ interface WithFormat { /** - * Specifies the format property: The format of the export being delivered. Currently only 'Csv' is - * supported.. + * Specifies the format property: The format of the export being delivered.. * - * @param format The format of the export being delivered. Currently only 'Csv' is supported. + * @param format The format of the export being delivered. * @return the next definition stage. */ WithCreate withFormat(FormatType format); @@ -255,16 +347,62 @@ interface WithRunHistory { interface WithPartitionData { /** * Specifies the partitionData property: If set to true, exported data will be partitioned by size and - * placed in a blob directory together with a manifest file. Note: this option is currently available only - * for Microsoft Customer Agreement commerce scopes.. + * placed in a blob directory together with a manifest file.. * * @param partitionData If set to true, exported data will be partitioned by size and placed in a blob - * directory together with a manifest file. Note: this option is currently available only for Microsoft - * Customer Agreement commerce scopes. + * directory together with a manifest file. * @return the next definition stage. */ WithCreate withPartitionData(Boolean partitionData); } + + /** + * The stage of the Export definition allowing to specify dataOverwriteBehavior. + */ + interface WithDataOverwriteBehavior { + /** + * Specifies the dataOverwriteBehavior property: Allow customers to select overwrite + * data(OverwritePreviousReport) for exports. This setting will enable overwrite data for the same month in + * customer storage account. By default set to CreateNewReport.. + * + * @param dataOverwriteBehavior Allow customers to select overwrite data(OverwritePreviousReport) for + * exports. This setting will enable overwrite data for the same month in customer storage account. By + * default set to CreateNewReport. + * @return the next definition stage. + */ + WithCreate withDataOverwriteBehavior(DataOverwriteBehaviorType dataOverwriteBehavior); + } + + /** + * The stage of the Export definition allowing to specify compressionMode. + */ + interface WithCompressionMode { + /** + * Specifies the compressionMode property: Allow customers to select compress data for exports. This setting + * will enable destination file compression scheme at runtime. By default set to None. Gzip is for csv and + * snappy for parquet.. + * + * @param compressionMode Allow customers to select compress data for exports. This setting will enable + * destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for + * parquet. + * @return the next definition stage. + */ + WithCreate withCompressionMode(CompressionModeType compressionMode); + } + + /** + * The stage of the Export definition allowing to specify exportDescription. + */ + interface WithExportDescription { + /** + * Specifies the exportDescription property: The export description set by customer at time of export + * creation/update.. + * + * @param exportDescription The export description set by customer at time of export creation/update. + * @return the next definition stage. + */ + WithCreate withExportDescription(String exportDescription); + } } /** @@ -277,9 +415,10 @@ interface WithPartitionData { /** * The template for Export update. */ - interface Update extends UpdateStages.WithEtag, UpdateStages.WithSchedule, UpdateStages.WithFormat, - UpdateStages.WithDeliveryInfo, UpdateStages.WithDefinition, UpdateStages.WithRunHistory, - UpdateStages.WithPartitionData { + interface Update extends UpdateStages.WithIdentity, UpdateStages.WithEtag, UpdateStages.WithSchedule, + UpdateStages.WithFormat, UpdateStages.WithDeliveryInfo, UpdateStages.WithDefinition, + UpdateStages.WithRunHistory, UpdateStages.WithPartitionData, UpdateStages.WithDataOverwriteBehavior, + UpdateStages.WithCompressionMode, UpdateStages.WithExportDescription { /** * Executes the update request. * @@ -300,6 +439,19 @@ interface Update extends UpdateStages.WithEtag, UpdateStages.WithSchedule, Updat * The Export update stages. */ interface UpdateStages { + /** + * The stage of the Export update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity associated with Export. + * + * @param identity The managed identity associated with Export. + * @return the next definition stage. + */ + Update withIdentity(SystemAssignedServiceIdentity identity); + } + /** * The stage of the Export update allowing to specify etag. */ @@ -333,10 +485,9 @@ interface WithSchedule { */ interface WithFormat { /** - * Specifies the format property: The format of the export being delivered. Currently only 'Csv' is - * supported.. + * Specifies the format property: The format of the export being delivered.. * - * @param format The format of the export being delivered. Currently only 'Csv' is supported. + * @param format The format of the export being delivered. * @return the next definition stage. */ Update withFormat(FormatType format); @@ -387,16 +538,62 @@ interface WithRunHistory { interface WithPartitionData { /** * Specifies the partitionData property: If set to true, exported data will be partitioned by size and - * placed in a blob directory together with a manifest file. Note: this option is currently available only - * for Microsoft Customer Agreement commerce scopes.. + * placed in a blob directory together with a manifest file.. * * @param partitionData If set to true, exported data will be partitioned by size and placed in a blob - * directory together with a manifest file. Note: this option is currently available only for Microsoft - * Customer Agreement commerce scopes. + * directory together with a manifest file. * @return the next definition stage. */ Update withPartitionData(Boolean partitionData); } + + /** + * The stage of the Export update allowing to specify dataOverwriteBehavior. + */ + interface WithDataOverwriteBehavior { + /** + * Specifies the dataOverwriteBehavior property: Allow customers to select overwrite + * data(OverwritePreviousReport) for exports. This setting will enable overwrite data for the same month in + * customer storage account. By default set to CreateNewReport.. + * + * @param dataOverwriteBehavior Allow customers to select overwrite data(OverwritePreviousReport) for + * exports. This setting will enable overwrite data for the same month in customer storage account. By + * default set to CreateNewReport. + * @return the next definition stage. + */ + Update withDataOverwriteBehavior(DataOverwriteBehaviorType dataOverwriteBehavior); + } + + /** + * The stage of the Export update allowing to specify compressionMode. + */ + interface WithCompressionMode { + /** + * Specifies the compressionMode property: Allow customers to select compress data for exports. This setting + * will enable destination file compression scheme at runtime. By default set to None. Gzip is for csv and + * snappy for parquet.. + * + * @param compressionMode Allow customers to select compress data for exports. This setting will enable + * destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for + * parquet. + * @return the next definition stage. + */ + Update withCompressionMode(CompressionModeType compressionMode); + } + + /** + * The stage of the Export update allowing to specify exportDescription. + */ + interface WithExportDescription { + /** + * Specifies the exportDescription property: The export description set by customer at time of export + * creation/update.. + * + * @param exportDescription The export description set by customer at time of export creation/update. + * @return the next definition stage. + */ + Update withExportDescription(String exportDescription); + } } /** @@ -417,13 +614,14 @@ interface WithPartitionData { /** * The operation to run an export. * + * @param parameters Parameters supplied to the Execute Export operation. * @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 Response}. */ - Response executeWithResponse(Context context); + Response executeWithResponse(ExportRunRequest parameters, Context context); /** * The operation to run an export. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDataset.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDataset.java index 5d04f4fe72e4..f61ab583a2a5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDataset.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDataset.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -17,7 +17,7 @@ @Fluent public final class ExportDataset implements JsonSerializable { /* - * The granularity of rows in the export. Currently only 'Daily' is supported. + * The granularity of rows in the export. Currently 'Daily' is supported for most cases. */ private GranularityType granularity; @@ -33,7 +33,8 @@ public ExportDataset() { } /** - * Get the granularity property: The granularity of rows in the export. Currently only 'Daily' is supported. + * Get the granularity property: The granularity of rows in the export. Currently 'Daily' is supported for most + * cases. * * @return the granularity value. */ @@ -42,7 +43,8 @@ public GranularityType granularity() { } /** - * Set the granularity property: The granularity of rows in the export. Currently only 'Daily' is supported. + * Set the granularity property: The granularity of rows in the export. Currently 'Daily' is supported for most + * cases. * * @param granularity the granularity value to set. * @return the ExportDataset object itself. @@ -72,17 +74,6 @@ public ExportDataset withConfiguration(ExportDatasetConfiguration configuration) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDatasetConfiguration.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDatasetConfiguration.java index 8ceac3b0e353..709ed20ba8ae 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDatasetConfiguration.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDatasetConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -13,8 +13,7 @@ import java.util.List; /** - * The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will - * include all available columns. + * This is on path to deprecation and will not be supported going forward. */ @Fluent public final class ExportDatasetConfiguration implements JsonSerializable { @@ -24,6 +23,17 @@ public final class ExportDatasetConfiguration implements JsonSerializable columns; + /* + * The data version for the selected for the export. If not provided then the export will default to latest data + * version. + */ + private String dataVersion; + + /* + * Filters associated with the data sets. + */ + private List filters; + /** * Creates an instance of ExportDatasetConfiguration class. */ @@ -53,11 +63,45 @@ public ExportDatasetConfiguration withColumns(List columns) { } /** - * Validates the instance. + * Get the dataVersion property: The data version for the selected for the export. If not provided then the export + * will default to latest data version. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the dataVersion value. */ - public void validate() { + public String dataVersion() { + return this.dataVersion; + } + + /** + * Set the dataVersion property: The data version for the selected for the export. If not provided then the export + * will default to latest data version. + * + * @param dataVersion the dataVersion value to set. + * @return the ExportDatasetConfiguration object itself. + */ + public ExportDatasetConfiguration withDataVersion(String dataVersion) { + this.dataVersion = dataVersion; + return this; + } + + /** + * Get the filters property: Filters associated with the data sets. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: Filters associated with the data sets. + * + * @param filters the filters value to set. + * @return the ExportDatasetConfiguration object itself. + */ + public ExportDatasetConfiguration withFilters(List filters) { + this.filters = filters; + return this; } /** @@ -67,6 +111,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dataVersion", this.dataVersion); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -88,6 +134,11 @@ public static ExportDatasetConfiguration fromJson(JsonReader jsonReader) throws if ("columns".equals(fieldName)) { List columns = reader.readArray(reader1 -> reader1.getString()); deserializedExportDatasetConfiguration.columns = columns; + } else if ("dataVersion".equals(fieldName)) { + deserializedExportDatasetConfiguration.dataVersion = reader.getString(); + } else if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> FilterItems.fromJson(reader1)); + deserializedExportDatasetConfiguration.filters = filters; } else { reader.skipChildren(); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDefinition.java index 7ac51da9cad8..50119189d81c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDefinition.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -128,30 +127,6 @@ public ExportDefinition withDataSet(ExportDataset dataSet) { 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 ExportDefinition")); - } - if (timeframe() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property timeframe in model ExportDefinition")); - } - if (timePeriod() != null) { - timePeriod().validate(); - } - if (dataSet() != null) { - dataSet().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ExportDefinition.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDeliveryDestination.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDeliveryDestination.java index 964f58c755d1..aee63f9e0db7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDeliveryDestination.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDeliveryDestination.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -29,6 +28,11 @@ */ @Fluent public final class ExportDeliveryDestination implements JsonSerializable { + /* + * The export delivery destination type. Currently only 'AzureBlob' is supported. + */ + private DestinationType type; + /* * The resource id of the storage account where exports will be delivered. This is not required if a sasToken and * storageAccount are specified. @@ -65,6 +69,26 @@ public final class ExportDeliveryDestination implements JsonSerializable { + /* + * Has time period for pulling data for the export. + */ + private ExportTimePeriod timePeriod; + + /** + * Creates an instance of ExportRunRequest class. + */ + public ExportRunRequest() { + } + + /** + * Get the timePeriod property: Has time period for pulling data for the export. + * + * @return the timePeriod value. + */ + public ExportTimePeriod timePeriod() { + return this.timePeriod; + } + + /** + * Set the timePeriod property: Has time period for pulling data for the export. + * + * @param timePeriod the timePeriod value to set. + * @return the ExportRunRequest object itself. + */ + public ExportRunRequest withTimePeriod(ExportTimePeriod timePeriod) { + this.timePeriod = timePeriod; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("timePeriod", this.timePeriod); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportRunRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportRunRequest 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 ExportRunRequest. + */ + public static ExportRunRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExportRunRequest deserializedExportRunRequest = new ExportRunRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timePeriod".equals(fieldName)) { + deserializedExportRunRequest.timePeriod = ExportTimePeriod.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExportRunRequest; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSchedule.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSchedule.java index 06c991243931..0c79ce30b582 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSchedule.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSchedule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -17,7 +17,8 @@ @Fluent public final class ExportSchedule implements JsonSerializable { /* - * The status of the export's schedule. If 'Inactive', the export's schedule is paused. + * The status of the export's schedule. If 'Inactive', the export's schedule is paused. To enable export set the + * status to be Active and then make a PUT request. */ private StatusType status; @@ -39,7 +40,8 @@ public ExportSchedule() { } /** - * Get the status property: The status of the export's schedule. If 'Inactive', the export's schedule is paused. + * Get the status property: The status of the export's schedule. If 'Inactive', the export's schedule is paused. To + * enable export set the status to be Active and then make a PUT request. * * @return the status value. */ @@ -48,7 +50,8 @@ public StatusType status() { } /** - * Set the status property: The status of the export's schedule. If 'Inactive', the export's schedule is paused. + * Set the status property: The status of the export's schedule. If 'Inactive', the export's schedule is paused. To + * enable export set the status to be Active and then make a PUT request. * * @param status the status value to set. * @return the ExportSchedule object itself. @@ -100,17 +103,6 @@ public ExportSchedule withRecurrencePeriod(ExportRecurrencePeriod recurrencePeri return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recurrencePeriod() != null) { - recurrencePeriod().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSuspensionContext.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSuspensionContext.java new file mode 100644 index 000000000000..29a09447315c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSuspensionContext.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * The properties of the export run. This is not populated currently. + */ +@Immutable +public final class ExportSuspensionContext implements JsonSerializable { + /* + * The code for export suspension. + */ + private String suspensionCode; + + /* + * The detailed reason for export suspension. + */ + private String suspensionReason; + + /* + * The time when the export was suspended. + */ + private OffsetDateTime suspensionTime; + + /** + * Creates an instance of ExportSuspensionContext class. + */ + private ExportSuspensionContext() { + } + + /** + * Get the suspensionCode property: The code for export suspension. + * + * @return the suspensionCode value. + */ + public String suspensionCode() { + return this.suspensionCode; + } + + /** + * Get the suspensionReason property: The detailed reason for export suspension. + * + * @return the suspensionReason value. + */ + public String suspensionReason() { + return this.suspensionReason; + } + + /** + * Get the suspensionTime property: The time when the export was suspended. + * + * @return the suspensionTime value. + */ + public OffsetDateTime suspensionTime() { + return this.suspensionTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("suspensionCode", this.suspensionCode); + jsonWriter.writeStringField("suspensionReason", this.suspensionReason); + jsonWriter.writeStringField("suspensionTime", + this.suspensionTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.suspensionTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportSuspensionContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportSuspensionContext 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 ExportSuspensionContext. + */ + public static ExportSuspensionContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExportSuspensionContext deserializedExportSuspensionContext = new ExportSuspensionContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("suspensionCode".equals(fieldName)) { + deserializedExportSuspensionContext.suspensionCode = reader.getString(); + } else if ("suspensionReason".equals(fieldName)) { + deserializedExportSuspensionContext.suspensionReason = reader.getString(); + } else if ("suspensionTime".equals(fieldName)) { + deserializedExportSuspensionContext.suspensionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedExportSuspensionContext; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportTimePeriod.java index eec93f2e0d77..891cbeb5c3ed 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportTimePeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportTimePeriod.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -17,7 +16,7 @@ /** * The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date - * range is 3 months. + * range is 1 calendar month. */ @Fluent public final class ExportTimePeriod implements JsonSerializable { @@ -77,24 +76,6 @@ public ExportTimePeriod withTo(OffsetDateTime to) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (from() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property from in model ExportTimePeriod")); - } - if (to() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property to in model ExportTimePeriod")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ExportTimePeriod.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportType.java index c8b9873670ad..b4cb0046f4ff 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExportType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,7 +8,8 @@ import java.util.Collection; /** - * The type of the query. + * The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet + * provide data for charges or amortization for service reservations. */ public final class ExportType extends ExpandableStringEnum { /** @@ -26,6 +27,31 @@ public final class ExportType extends ExpandableStringEnum { */ public static final ExportType AMORTIZED_COST = fromString("AmortizedCost"); + /** + * Static value FocusCost for ExportType. + */ + public static final ExportType FOCUS_COST = fromString("FocusCost"); + + /** + * Static value PriceSheet for ExportType. + */ + public static final ExportType PRICE_SHEET = fromString("PriceSheet"); + + /** + * Static value ReservationTransactions for ExportType. + */ + public static final ExportType RESERVATION_TRANSACTIONS = fromString("ReservationTransactions"); + + /** + * Static value ReservationRecommendations for ExportType. + */ + public static final ExportType RESERVATION_RECOMMENDATIONS = fromString("ReservationRecommendations"); + + /** + * Static value ReservationDetails for ExportType. + */ + public static final ExportType RESERVATION_DETAILS = fromString("ReservationDetails"); + /** * Creates a new instance of ExportType value. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Exports.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Exports.java index e475441c6189..a0c3d1f76303 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Exports.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Exports.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,101 +12,60 @@ */ public interface Exports { /** - * The operation to list all exports at the given scope. + * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param exportName Export Name. * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last run of each export. + * will return information for the last 10 runs of the export. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports along with {@link Response}. + * @return an export resource along with {@link Response}. */ - Response listWithResponse(String scope, String expand, Context context); + Response getWithResponse(String scope, String exportName, String expand, Context context); /** - * The operation to list all exports at the given scope. + * The operation to get the export for the defined scope by export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing exports. + * @return an export resource. */ - ExportListResult list(String scope); + Export get(String scope, String exportName); /** - * The operation to get the export for the defined scope by export name. + * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. - * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and - * will return information for the last 10 runs of the export. * @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 an export resource along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String scope, String exportName, String expand, Context context); + Response deleteByResourceGroupWithResponse(String scope, String exportName, Context context); /** - * The operation to get the export for the defined scope by export name. + * The operation to delete a export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an export resource. */ - Export get(String scope, String exportName); + void deleteByResourceGroup(String scope, String exportName); /** - * The operation to delete a export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -117,19 +76,20 @@ public interface Exports { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. + * @param expand May be used to expand the properties within an export. Currently only 'runHistory' is supported and + * will return information for the last run of each export. * @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 Response}. + * @return result of listing exports along with {@link Response}. */ - Response deleteByResourceGroupWithResponse(String scope, String exportName, Context context); + Response listWithResponse(String scope, String expand, Context context); /** - * The operation to delete a export. + * The operation to list all exports at the given scope. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + * @param scope The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department @@ -140,50 +100,31 @@ public interface Exports { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing exports. */ - void deleteByResourceGroup(String scope, String exportName); + ExportListResult list(String scope); /** * The operation to run an export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. + * @param parameters Parameters supplied to the Execute Export operation. * @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 Response}. */ - Response executeWithResponse(String scope, String exportName, Context context); + Response executeWithResponse(String scope, String exportName, ExportRunRequest parameters, Context context); /** * The operation to run an export. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -194,17 +135,7 @@ public interface Exports { /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -218,17 +149,7 @@ Response getExecutionHistoryWithResponse(String scope /** * The operation to get the run history of an export for the defined scope and export name. * - * @param scope The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management - * Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param exportName Export Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExternalCloudProviderType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExternalCloudProviderType.java index 3669f74db5ef..eb0773744310 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExternalCloudProviderType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ExternalCloudProviderType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileDestination.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileDestination.java index 58fcd6479c44..9fee219c0eb8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileDestination.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileDestination.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -48,14 +48,6 @@ public FileDestination withFileFormats(List fileFormats) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileFormat.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileFormat.java index aae1af9dc26c..0641bf7c935b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileFormat.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FileFormat.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItemNames.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItemNames.java new file mode 100644 index 000000000000..10b5eb4ba956 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItemNames.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The name of the filter. This is currently only supported for Export Definition type of ReservationRecommendations. + * Supported names are ['ReservationScope', 'LookBackPeriod', 'ResourceType']. + */ +public final class FilterItemNames extends ExpandableStringEnum { + /** + * Static value ReservationScope for FilterItemNames. + */ + public static final FilterItemNames RESERVATION_SCOPE = fromString("ReservationScope"); + + /** + * Static value ResourceType for FilterItemNames. + */ + public static final FilterItemNames RESOURCE_TYPE = fromString("ResourceType"); + + /** + * Static value LookBackPeriod for FilterItemNames. + */ + public static final FilterItemNames LOOK_BACK_PERIOD = fromString("LookBackPeriod"); + + /** + * Creates a new instance of FilterItemNames value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FilterItemNames() { + } + + /** + * Creates or finds a FilterItemNames from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterItemNames. + */ + public static FilterItemNames fromString(String name) { + return fromString(name, FilterItemNames.class); + } + + /** + * Gets known FilterItemNames values. + * + * @return known FilterItemNames values. + */ + public static Collection values() { + return values(FilterItemNames.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItems.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItems.java new file mode 100644 index 000000000000..2bc50f26c7d8 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItems.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * Will contain the filter name and value to operate on. This is currently only supported for Export Definition type of + * ReservationRecommendations. + */ +@Fluent +public final class FilterItems implements JsonSerializable { + /* + * The name of the filter. This is currently only supported for Export Definition type of + * ReservationRecommendations. Supported names are ['ReservationScope', 'LookBackPeriod', 'ResourceType'] + */ + private FilterItemNames name; + + /* + * Value to filter by. Currently values supported per name are, for 'ReservationScope' supported values are + * ['Single', 'Shared'], for 'LookBackPeriod' supported values are ['Last7Days', 'Last30Days', 'Last60Days'] and for + * 'ResourceType' supported values are ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', + * 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', + * 'AzureDataExplorer', 'VMwareCloudSimple']. + */ + private String value; + + /** + * Creates an instance of FilterItems class. + */ + public FilterItems() { + } + + /** + * Get the name property: The name of the filter. This is currently only supported for Export Definition type of + * ReservationRecommendations. Supported names are ['ReservationScope', 'LookBackPeriod', 'ResourceType']. + * + * @return the name value. + */ + public FilterItemNames name() { + return this.name; + } + + /** + * Set the name property: The name of the filter. This is currently only supported for Export Definition type of + * ReservationRecommendations. Supported names are ['ReservationScope', 'LookBackPeriod', 'ResourceType']. + * + * @param name the name value to set. + * @return the FilterItems object itself. + */ + public FilterItems withName(FilterItemNames name) { + this.name = name; + return this; + } + + /** + * Get the value property: Value to filter by. Currently values supported per name are, for 'ReservationScope' + * supported values are ['Single', 'Shared'], for 'LookBackPeriod' supported values are ['Last7Days', 'Last30Days', + * 'Last60Days'] and for 'ResourceType' supported values are ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', + * 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', + * 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple']. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value to filter by. Currently values supported per name are, for 'ReservationScope' + * supported values are ['Single', 'Shared'], for 'LookBackPeriod' supported values are ['Last7Days', 'Last30Days', + * 'Last60Days'] and for 'ResourceType' supported values are ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', + * 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', + * 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple']. + * + * @param value the value value to set. + * @return the FilterItems object itself. + */ + public FilterItems withValue(String value) { + this.value = value; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FilterItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FilterItems 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 FilterItems. + */ + public static FilterItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FilterItems deserializedFilterItems = new FilterItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFilterItems.name = FilterItemNames.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedFilterItems.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFilterItems; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastAggregation.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastAggregation.java index f695c413c9bf..1140a4dd8c08 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastAggregation.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastAggregation.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -73,24 +72,6 @@ public ForecastAggregation withFunction(FunctionType function) { 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 ForecastAggregation")); - } - if (function() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property function in model ForecastAggregation")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForecastAggregation.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastColumn.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastColumn.java index f4e2aa0808fa..efee376ebd73 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastColumn.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastColumn.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Forecast column properties. */ -@Fluent +@Immutable public final class ForecastColumn implements JsonSerializable { /* * The name of column. @@ -29,7 +29,7 @@ public final class ForecastColumn implements JsonSerializable { /** * Creates an instance of ForecastColumn class. */ - public ForecastColumn() { + private ForecastColumn() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of column. - * - * @param name the name value to set. - * @return the ForecastColumn object itself. - */ - public ForecastColumn withName(String name) { - this.name = name; - return this; - } - /** * Get the type property: The type of column. * @@ -61,25 +50,6 @@ public String type() { return this.type; } - /** - * Set the type property: The type of column. - * - * @param type the type value to set. - * @return the ForecastColumn object itself. - */ - public ForecastColumn withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastComparisonExpression.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastComparisonExpression.java index 7592fafb0de0..9982493eb4f1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastComparisonExpression.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastComparisonExpression.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -99,31 +98,6 @@ public ForecastComparisonExpression withValues(List values) { 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 ForecastComparisonExpression")); - } - if (operator() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property operator in model ForecastComparisonExpression")); - } - if (values() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property values in model ForecastComparisonExpression")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForecastComparisonExpression.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDataset.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDataset.java index 6f9f4e6513a6..45cc0138ce35 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDataset.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDataset.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -130,32 +129,6 @@ public ForecastDataset withFilter(ForecastFilter filter) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - if (aggregation() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property aggregation in model ForecastDataset")); - } else { - aggregation().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (filter() != null) { - filter().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForecastDataset.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDatasetConfiguration.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDatasetConfiguration.java index eaa86d19be1c..fef915bdfa96 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDatasetConfiguration.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDatasetConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -51,14 +51,6 @@ public ForecastDatasetConfiguration withColumns(List columns) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDefinition.java index 23f11c5a5f00..f0ea013527f0 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDefinition.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -175,33 +174,6 @@ public ForecastDefinition withIncludeFreshPartialCost(Boolean includeFreshPartia 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 ForecastDefinition")); - } - if (timeframe() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property timeframe in model ForecastDefinition")); - } - if (timePeriod() != null) { - timePeriod().validate(); - } - if (dataset() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property dataset in model ForecastDefinition")); - } else { - dataset().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForecastDefinition.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastFilter.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastFilter.java index fd3ac634a2cf..049db8c7529e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastFilter.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -123,26 +123,6 @@ public ForecastFilter withTags(ForecastComparisonExpression tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (and() != null) { - and().forEach(e -> e.validate()); - } - if (or() != null) { - or().forEach(e -> e.validate()); - } - if (dimensions() != null) { - dimensions().validate(); - } - if (tags() != null) { - tags().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastOperatorType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastOperatorType.java index 44a98bb3d3cc..28a05b7bf85e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastOperatorType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastOperatorType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastResult.java index c396a8c949a7..60ab21433948 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -13,40 +13,33 @@ */ public interface ForecastResult { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Resource Id. * * @return the id value. */ String id(); /** - * Gets the name property: The name of the resource. + * Gets the name property: Resource name. * * @return the name value. */ String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the location property: Location of the resource. * * @return the location value. */ String location(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the sku property: SKU of the resource. * @@ -61,6 +54,13 @@ public interface ForecastResult { */ String etag(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the nextLink property: The link (url) to the next page of results. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastSpend.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastSpend.java new file mode 100644 index 000000000000..5ed258fcbbd5 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastSpend.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Immutable; +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 forecasted cost which is being tracked for a budget. + * + * Supported for CategoryType(s): Cost. + */ +@Immutable +public final class ForecastSpend implements JsonSerializable { + /* + * The forecasted cost for the total time period which is being tracked by the budget. This value is only provided + * if the budget contains a forecast alert type. + */ + private Double amount; + + /* + * The unit of measure for the budget amount. + */ + private String unit; + + /** + * Creates an instance of ForecastSpend class. + */ + private ForecastSpend() { + } + + /** + * Get the amount property: The forecasted cost for the total time period which is being tracked by the budget. This + * value is only provided if the budget contains a forecast alert type. + * + * @return the amount value. + */ + public Double amount() { + return this.amount; + } + + /** + * Get the unit property: The unit of measure for the budget amount. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForecastSpend from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForecastSpend 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 ForecastSpend. + */ + public static ForecastSpend fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForecastSpend deserializedForecastSpend = new ForecastSpend(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amount".equals(fieldName)) { + deserializedForecastSpend.amount = reader.getNullable(JsonReader::getDouble); + } else if ("unit".equals(fieldName)) { + deserializedForecastSpend.unit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedForecastSpend; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimePeriod.java index ac5b3c9d1f20..42de894288dc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimePeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimePeriod.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -76,24 +75,6 @@ public ForecastTimePeriod withTo(OffsetDateTime to) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (from() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property from in model ForecastTimePeriod")); - } - if (to() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property to in model ForecastTimePeriod")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForecastTimePeriod.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimeframe.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimeframe.java index c2235c31c61e..3d14803fa1e8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimeframe.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimeframe.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastType.java index 86a2e5bfc191..083f357446ae 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Forecasts.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Forecasts.java index f1b1c478e8c8..395252d8376a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Forecasts.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Forecasts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -67,7 +67,7 @@ Response usageWithResponse(String scope, ForecastDefinition para * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support * 'ne', 'or', or 'not'. @@ -87,7 +87,7 @@ Response externalCloudProviderUsageWithResponse(ExternalCloudPro * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Forecast Config operation. + * @param parameters The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FormatType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FormatType.java index 021ff492dc1d..e19d45c75537 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FormatType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FormatType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The format of the export being delivered. Currently only 'Csv' is supported. + * The format of the export being delivered. */ public final class FormatType extends ExpandableStringEnum { /** @@ -16,6 +16,11 @@ public final class FormatType extends ExpandableStringEnum { */ public static final FormatType CSV = fromString("Csv"); + /** + * Static value Parquet for FormatType. + */ + public static final FormatType PARQUET = fromString("Parquet"); + /** * Creates a new instance of FormatType value. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Frequency.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Frequency.java new file mode 100644 index 000000000000..133a36201881 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Frequency.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a + * threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when + * timeGrain: Last7Days, Monthly when timeGrain: Last30Days). + * + * Supported for CategoryType(s): ReservationUtilization. + */ +public final class Frequency extends ExpandableStringEnum { + /** + * After the threshold breaches and an Alert is fired, no further alerts will be sent until the next calendar day. + */ + public static final Frequency DAILY = fromString("Daily"); + + /** + * After the threshold breaches and an Alert is fired, no further alerts will be sent for 7 calendar days. + */ + public static final Frequency WEEKLY = fromString("Weekly"); + + /** + * After the threshold breaches and an Alert is fired, no further alerts will be sent for 30 calendar days. + */ + public static final Frequency MONTHLY = fromString("Monthly"); + + /** + * Creates a new instance of Frequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Frequency() { + } + + /** + * Creates or finds a Frequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding Frequency. + */ + public static Frequency fromString(String name) { + return fromString(name, Frequency.class); + } + + /** + * Gets known Frequency values. + * + * @return known Frequency values. + */ + public static Collection values() { + return values(Frequency.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionName.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionName.java index 5500294cda50..940ef3d1ef86 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionName.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionType.java index 1f295e5270f6..89f70273048e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateBenefitUtilizationSummariesReports.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateBenefitUtilizationSummariesReports.java new file mode 100644 index 000000000000..6052d4a776aa --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateBenefitUtilizationSummariesReports.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of GenerateBenefitUtilizationSummariesReports. + */ +public interface GenerateBenefitUtilizationSummariesReports { + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account. This API supports + * only enrollment accounts. + * + * @param billingAccountId BillingAccount ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByBillingAccount(String billingAccountId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided billing account and billing + * profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByBillingProfile(String billingAccountId, + String billingProfileId, BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, + Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation order. + * + * @param reservationOrderId Reservation Order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByReservationOrderId(String reservationOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByReservationId(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided reservation. + * + * @param reservationOrderId Reservation Order ID. + * @param reservationId Reservation ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateByReservationId(String reservationOrderId, String reservationId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan order. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateBySavingsPlanOrderId(String savingsPlanOrderId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest); + + /** + * Triggers generation of a benefit utilization summaries report for the provided savings plan. + * + * @param savingsPlanOrderId Savings plan order ID. + * @param savingsPlanId Savings plan ID. + * @param benefitUtilizationSummariesRequest Async Benefit Utilization Summary report to be created. + * @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 status of a benefit utilization summaries report. + */ + BenefitUtilizationSummariesOperationStatus generateBySavingsPlanId(String savingsPlanOrderId, String savingsPlanId, + BenefitUtilizationSummariesRequest benefitUtilizationSummariesRequest, Context context); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReportRequestDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReportRequestDefinition.java index 78abc9843e2f..f3e91a4740ea 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReportRequestDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReportRequestDefinition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -152,17 +152,6 @@ public GenerateCostDetailsReportRequestDefinition withInvoiceId(String invoiceId return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timePeriod() != null) { - timePeriod().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReports.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReports.java index a4d0765cf0a5..ea841431af83 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReports.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReports.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -10,6 +10,35 @@ * Resource collection API of GenerateCostDetailsReports. */ public interface GenerateCostDetailsReports { + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation. + */ + CostDetailsOperationResults getOperationResults(String scope, String operationId); + + /** + * Get the result of the specified operation. This link is provided in the CostDetails creation request response + * Location header. + * + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. + * @param operationId The target operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the specified operation. + */ + CostDetailsOperationResults getOperationResults(String scope, String operationId, Context context); + /** * This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details * report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a @@ -20,10 +49,11 @@ public interface GenerateCostDetailsReports { * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -42,10 +72,11 @@ public interface GenerateCostDetailsReports { * report generation operation completes, the polling endpoint will provide a 200 response along with details on the * report blob(s) that are available for download. The details on the file(s) available for download will be * available in the polling response body. To Understand cost details (formerly known as usage details) fields found - * in files ,see https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields. + * in files ,see + * https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields. * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource + * Group and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes. * @param parameters Parameters supplied to the Create cost details operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,33 +86,4 @@ public interface GenerateCostDetailsReports { */ CostDetailsOperationResults createOperation(String scope, GenerateCostDetailsReportRequestDefinition parameters, Context context); - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation. - */ - CostDetailsOperationResults getOperationResults(String scope, String operationId); - - /** - * Get the result of the specified operation. This link is provided in the CostDetails creation request response - * Location header. - * - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. - * @param operationId The target operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of the specified operation. - */ - CostDetailsOperationResults getOperationResults(String scope, String operationId, Context context); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportDefinition.java index f50c4f9c54ef..7179a268ef0d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportDefinition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -164,17 +164,6 @@ public GenerateDetailedCostReportDefinition withCustomerId(String customerId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (timePeriod() != null) { - timePeriod().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportMetricType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportMetricType.java index 080cd09e2bb7..008d619b7dd2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportMetricType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportMetricType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResult.java index 72f7914c1c01..9fa5d07a025c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResult.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.costmanagement.fluent.models.GenerateDetailedCostReportOperationResultInner; import java.time.OffsetDateTime; @@ -12,26 +13,33 @@ */ public interface GenerateDetailedCostReportOperationResult { /** - * Gets the id property: The ARM resource id of the long running operation. + * 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 long running operation. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: The type of the long running operation. + * Gets the type property: The type of the resource. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the expiryTime property: The time at which report URL becomes invalid/expires in UTC e.g. * 2020-12-08T05:55:59.4394737Z. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResults.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResults.java index ccd13c0006ce..dac1afb2c9f7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResults.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResults.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -15,8 +15,7 @@ public interface GenerateDetailedCostReportOperationResults { * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -29,8 +28,7 @@ public interface GenerateDetailedCostReportOperationResults { * the initial request. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatus.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatus.java index 29c00a586b00..f4b4958066a5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatus.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -16,8 +16,7 @@ public interface GenerateDetailedCostReportOperationStatus { * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -32,8 +31,7 @@ Response getWithResponse(String ope * request response header. * * @param operationId The target operation Id. - * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For - * details, see https://aka.ms/costmgmt/scopes. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatuses.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatuses.java index 59e0ba761efd..e84d703c2671 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatuses.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatuses.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; +import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.costmanagement.fluent.models.GenerateDetailedCostReportOperationStatusesInner; import java.time.OffsetDateTime; @@ -13,19 +14,26 @@ */ public interface GenerateDetailedCostReportOperationStatuses { /** - * Gets the id property: The ID of the long running operation. + * 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 long running operation. + * 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 status property: The status of the long running operation. * @@ -48,18 +56,18 @@ public interface GenerateDetailedCostReportOperationStatuses { String endTime(); /** - * Gets the type property: The type of the long running operation. + * Gets the error property: The details of the error. * - * @return the type value. + * @return the error value. */ - String type(); + ManagementError error(); /** - * Gets the error property: The details of the error. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the error value. + * @return the systemData value. */ - ManagementError error(); + SystemData systemData(); /** * Gets the expiryTime property: The time at which report URL becomes invalid/expires in UTC e.g. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportTimePeriod.java index 2189fbf1e3fe..a781f99e7918 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportTimePeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportTimePeriod.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -74,26 +73,6 @@ public GenerateDetailedCostReportTimePeriod withEnd(String end) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (start() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property start in model GenerateDetailedCostReportTimePeriod")); - } - if (end() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property end in model GenerateDetailedCostReportTimePeriod")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GenerateDetailedCostReportTimePeriod.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReports.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReports.java index dea194ddd04c..b873ec8b4800 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReports.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReports.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateReservationDetailsReports.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateReservationDetailsReports.java index 95051fb92551..91f80365e61e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateReservationDetailsReports.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateReservationDetailsReports.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -13,9 +13,9 @@ public interface GenerateReservationDetailsReports { /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,9 +28,9 @@ public interface GenerateReservationDetailsReports { /** * Generates the reservations details report for provided date range asynchronously based on enrollment id. The * Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, - * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role. * - * @param billingAccountId Enrollment ID (Legacy BillingAccount ID). + * @param billingAccountId BillingAccount ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. @@ -45,10 +45,10 @@ public interface GenerateReservationDetailsReports { * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,10 +63,10 @@ OperationStatus byBillingProfileId(String billingAccountId, String billingProfil * Generates the reservations details report for provided date range asynchronously by billing profile. The * Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the * roles see, - * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. + * https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access. * - * @param billingAccountId Billing account ID. - * @param billingProfileId Billing profile ID. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Billing Profile ID. * @param startDate Start Date. * @param endDate End Date. * @param context The context to associate with this operation. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Grain.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Grain.java index 1248ec83be79..159a43341719 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Grain.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Grain.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,17 +12,17 @@ */ public final class Grain extends ExpandableStringEnum { /** - * Static value Hourly for Grain. + * Hourly grain corresponds to value per hour. */ public static final Grain HOURLY = fromString("Hourly"); /** - * Static value Daily for Grain. + * Hourly grain corresponds to value per day. */ public static final Grain DAILY = fromString("Daily"); /** - * Static value Monthly for Grain. + * Hourly grain corresponds to value per month. */ public static final Grain MONTHLY = fromString("Monthly"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GrainParameter.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GrainParameter.java index ee229e20403d..a56019dc9690 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GrainParameter.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GrainParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,17 +12,17 @@ */ public final class GrainParameter extends ExpandableStringEnum { /** - * Static value Hourly for GrainParameter. + * Hourly grain corresponds to value per hour. */ public static final GrainParameter HOURLY = fromString("Hourly"); /** - * Static value Daily for GrainParameter. + * Hourly grain corresponds to value per day. */ public static final GrainParameter DAILY = fromString("Daily"); /** - * Static value Monthly for GrainParameter. + * Hourly grain corresponds to value per month. */ public static final GrainParameter MONTHLY = fromString("Monthly"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GranularityType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GranularityType.java index dcb14cf54f43..f1ffe59f818f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GranularityType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/GranularityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The granularity of rows in the forecast. + * The granularity of rows in the export. Currently 'Daily' is supported for most cases. */ public final class GranularityType extends ExpandableStringEnum { /** @@ -16,6 +16,11 @@ public final class GranularityType extends ExpandableStringEnum */ public static final GranularityType DAILY = fromString("Daily"); + /** + * Static value Monthly for GranularityType. + */ + public static final GranularityType MONTHLY = fromString("Monthly"); + /** * Creates a new instance of GranularityType value. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/IncludedQuantityUtilizationSummary.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/IncludedQuantityUtilizationSummary.java index 33954cab29b1..c4f6984b1b6d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/IncludedQuantityUtilizationSummary.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/IncludedQuantityUtilizationSummary.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,7 +18,7 @@ /** * Included Quantity utilization summary resource. */ -@Fluent +@Immutable public final class IncludedQuantityUtilizationSummary extends BenefitUtilizationSummaryInner { /* * Supported values: 'SavingsPlan'. @@ -29,6 +30,11 @@ public final class IncludedQuantityUtilizationSummary extends BenefitUtilization */ private IncludedQuantityUtilizationSummaryProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -47,7 +53,7 @@ public final class IncludedQuantityUtilizationSummary extends BenefitUtilization /** * Creates an instance of IncludedQuantityUtilizationSummary class. */ - public IncludedQuantityUtilizationSummary() { + private IncludedQuantityUtilizationSummary() { } /** @@ -69,6 +75,16 @@ private IncludedQuantityUtilizationSummaryProperties innerProperties() { return this.innerProperties; } + /** + * 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 type property: The type of the resource. * @@ -144,20 +160,6 @@ public BenefitKind benefitType() { return this.innerProperties() == null ? null : this.innerProperties().benefitType(); } - /** - * Set the benefitType property: The benefit type. Supported values: 'SavingsPlan'. - * - * @param benefitType the benefitType value to set. - * @return the IncludedQuantityUtilizationSummary object itself. - */ - public IncludedQuantityUtilizationSummary withBenefitType(BenefitKind benefitType) { - if (this.innerProperties() == null) { - this.innerProperties = new IncludedQuantityUtilizationSummaryProperties(); - } - this.innerProperties().withBenefitType(benefitType); - return this; - } - /** * Get the usageDate property: Date corresponding to the utilization summary record. If the grain of data is * monthly, value for this field will be first day of the month. @@ -168,18 +170,6 @@ public OffsetDateTime usageDate() { return this.innerProperties() == null ? null : this.innerProperties().usageDate(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -214,6 +204,8 @@ public static IncludedQuantityUtilizationSummary fromJson(JsonReader jsonReader) deserializedIncludedQuantityUtilizationSummary.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedIncludedQuantityUtilizationSummary.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedIncludedQuantityUtilizationSummary.systemData = SystemData.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedIncludedQuantityUtilizationSummary.kind = BenefitKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiProperties.java index 4d0ce7ccb394..b3a9a62da43b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -97,14 +97,6 @@ public KpiProperties withEnabled(Boolean enabled) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiType.java index 9e8dc4905240..a0429b09e940 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/KpiType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/LookBackPeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/LookBackPeriod.java index 97dd11597b19..b0e567158ba2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/LookBackPeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/LookBackPeriod.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,17 +12,17 @@ */ public final class LookBackPeriod extends ExpandableStringEnum { /** - * Static value Last7Days for LookBackPeriod. + * 7 days used to look back. */ public static final LookBackPeriod LAST7DAYS = fromString("Last7Days"); /** - * Static value Last30Days for LookBackPeriod. + * 30 days used to look back. */ public static final LookBackPeriod LAST30DAYS = fromString("Last30Days"); /** - * Static value Last60Days for LookBackPeriod. + * 60 days used to look back. */ public static final LookBackPeriod LAST60DAYS = fromString("Last60Days"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MCAPriceSheetProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MCAPriceSheetProperties.java new file mode 100644 index 000000000000..6f9fcae6803c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MCAPriceSheetProperties.java @@ -0,0 +1,537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * The properties of the price sheet. + */ +@Immutable +public final class MCAPriceSheetProperties implements JsonSerializable { + /* + * Unique identifier for the billing account. + */ + private String billingAccountID; + + /* + * Name of the billing profile that is set up to receive invoices. The prices in the price sheet are associated with + * this billing profile. + */ + private String billingAccountName; + + /* + * Unique identifier for the billing profile. + */ + private String billingProfileId; + + /* + * Name of the billing profile that is set up to receive invoices. The prices in the price sheet are associated with + * this billing profile. + */ + private String billingProfileName; + + /* + * Name of the purchased product plan. Indicates if this pricing is standard Azure Plan pricing, Dev/Test pricing + * etc. + * + * Currently unavailable for Azure 3rd party and ReservedInstance meters. + */ + private String productOrderName; + + /* + * Type of Azure service. For example, Compute, Analytics, and Security. + */ + private Double serviceFamily; + + /* + * Name of the product accruing the charges. + */ + private String product; + + /* + * Unique identifier for the product whose meter is consumed. + */ + private String productId; + + /* + * Unique identifier of the SKU + */ + private String skuId; + + /* + * How usage is measured for the service + */ + private String unitOfMeasure; + + /* + * Unique identifier of the meter + */ + private String meterId; + + /* + * Name of the meter. The meter represents the deployable resource of an Azure service. + */ + private String meterName; + + /* + * Name of the meter type + */ + private String meterType; + + /* + * Name of the classification category for the meter. For example, Cloud services, Networking, etc. + */ + private String meterCategory; + + /* + * Name of the meter subclassification category. + */ + private String meterSubCategory; + + /* + * Name of the Azure region where the meter for the service is available. + */ + private String meterRegion; + + /* + * Defines the lower bound of the tier range for which prices are defined. For example, if the range is 0 to 100, + * tierMinimumUnits would be 0. + */ + private String tierMinimumUnits; + + /* + * Effective start date of the Price Sheet billing period + */ + private OffsetDateTime effectiveStartDate; + + /* + * Effective end date of the Price Sheet billing period + */ + private OffsetDateTime effectiveEndDate; + + /* + * The per-unit price at the time of billing for a given product or service, inclusive of any negotiated discounts + * on top of the market price. + * + * For PriceType ReservedInstance, unit price reflects the total cost of the 1 or 3-year commitment including + * discounts. + * + * Note: The unit price isn't the same as the effective price in usage details downloads when services have + * differential prices across tiers. + * + * If services have multi-tiered pricing, the effective price is a blended rate across the tiers and doesn't show a + * tier-specific unit price. The blended price or effective price is the net price for the consumed quantity + * spanning across the multiple tiers (where each tier has a specific unit price). + */ + private String unitPrice; + + /* + * The unit price at the time the customer signs on or the unit price at the time of service meter GA launch if it + * is after sign-on. + * + * This is applicable for Enterprise Agreement users + */ + private String basePrice; + + /* + * The current list price for a given product or service. This price is without any negotiations and is based on + * your Microsoft Agreement type. + * + * For PriceType Consumption, market price is reflected as the pay-as-you-go price. + * + * For PriceType Savings Plan, market price reflects the Savings plan benefit on top of pay-as-you-go price for the + * corresponding commitment term. + * + * For PriceType ReservedInstance, market price reflects the total price of the 1 or 3-year commitment. + */ + private String marketPrice; + + /* + * Currency in which all the prices are reflected. + */ + private String currency; + + /* + * Currency in which charges are posted. + */ + private String billingCurrency; + + /* + * Term length for Azure Savings Plan or Reservation term – one year or three years (P1Y or P3Y) + */ + private String term; + + /* + * Price type for a product. For example, an Azure resource with a pay-as-you-go rate with priceType as Consumption. + * Other price types include ReservedInstance and Savings Plan. + */ + private String priceType; + + /** + * Creates an instance of MCAPriceSheetProperties class. + */ + private MCAPriceSheetProperties() { + } + + /** + * Get the billingAccountID property: Unique identifier for the billing account. + * + * @return the billingAccountID value. + */ + public String billingAccountID() { + return this.billingAccountID; + } + + /** + * Get the billingAccountName property: Name of the billing profile that is set up to receive invoices. The prices + * in the price sheet are associated with this billing profile. + * + * @return the billingAccountName value. + */ + public String billingAccountName() { + return this.billingAccountName; + } + + /** + * Get the billingProfileId property: Unique identifier for the billing profile. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billingProfileName property: Name of the billing profile that is set up to receive invoices. The prices + * in the price sheet are associated with this billing profile. + * + * @return the billingProfileName value. + */ + public String billingProfileName() { + return this.billingProfileName; + } + + /** + * Get the productOrderName property: Name of the purchased product plan. Indicates if this pricing is standard + * Azure Plan pricing, Dev/Test pricing etc. + * + * Currently unavailable for Azure 3rd party and ReservedInstance meters. + * + * @return the productOrderName value. + */ + public String productOrderName() { + return this.productOrderName; + } + + /** + * Get the serviceFamily property: Type of Azure service. For example, Compute, Analytics, and Security. + * + * @return the serviceFamily value. + */ + public Double serviceFamily() { + return this.serviceFamily; + } + + /** + * Get the product property: Name of the product accruing the charges. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Get the productId property: Unique identifier for the product whose meter is consumed. + * + * @return the productId value. + */ + public String productId() { + return this.productId; + } + + /** + * Get the skuId property: Unique identifier of the SKU. + * + * @return the skuId value. + */ + public String skuId() { + return this.skuId; + } + + /** + * Get the unitOfMeasure property: How usage is measured for the service. + * + * @return the unitOfMeasure value. + */ + public String unitOfMeasure() { + return this.unitOfMeasure; + } + + /** + * Get the meterId property: Unique identifier of the meter. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the meterName property: Name of the meter. The meter represents the deployable resource of an Azure service. + * + * @return the meterName value. + */ + public String meterName() { + return this.meterName; + } + + /** + * Get the meterType property: Name of the meter type. + * + * @return the meterType value. + */ + public String meterType() { + return this.meterType; + } + + /** + * Get the meterCategory property: Name of the classification category for the meter. For example, Cloud services, + * Networking, etc. + * + * @return the meterCategory value. + */ + public String meterCategory() { + return this.meterCategory; + } + + /** + * Get the meterSubCategory property: Name of the meter subclassification category. + * + * @return the meterSubCategory value. + */ + public String meterSubCategory() { + return this.meterSubCategory; + } + + /** + * Get the meterRegion property: Name of the Azure region where the meter for the service is available. + * + * @return the meterRegion value. + */ + public String meterRegion() { + return this.meterRegion; + } + + /** + * Get the tierMinimumUnits property: Defines the lower bound of the tier range for which prices are defined. For + * example, if the range is 0 to 100, tierMinimumUnits would be 0. + * + * @return the tierMinimumUnits value. + */ + public String tierMinimumUnits() { + return this.tierMinimumUnits; + } + + /** + * Get the effectiveStartDate property: Effective start date of the Price Sheet billing period. + * + * @return the effectiveStartDate value. + */ + public OffsetDateTime effectiveStartDate() { + return this.effectiveStartDate; + } + + /** + * Get the effectiveEndDate property: Effective end date of the Price Sheet billing period. + * + * @return the effectiveEndDate value. + */ + public OffsetDateTime effectiveEndDate() { + return this.effectiveEndDate; + } + + /** + * Get the unitPrice property: The per-unit price at the time of billing for a given product or service, inclusive + * of any negotiated discounts on top of the market price. + * + * For PriceType ReservedInstance, unit price reflects the total cost of the 1 or 3-year commitment including + * discounts. + * + * Note: The unit price isn't the same as the effective price in usage details downloads when services have + * differential prices across tiers. + * + * If services have multi-tiered pricing, the effective price is a blended rate across the tiers and doesn't show a + * tier-specific unit price. The blended price or effective price is the net price for the consumed quantity + * spanning across the multiple tiers (where each tier has a specific unit price). + * + * @return the unitPrice value. + */ + public String unitPrice() { + return this.unitPrice; + } + + /** + * Get the basePrice property: The unit price at the time the customer signs on or the unit price at the time of + * service meter GA launch if it is after sign-on. + * + * This is applicable for Enterprise Agreement users. + * + * @return the basePrice value. + */ + public String basePrice() { + return this.basePrice; + } + + /** + * Get the marketPrice property: The current list price for a given product or service. This price is without any + * negotiations and is based on your Microsoft Agreement type. + * + * For PriceType Consumption, market price is reflected as the pay-as-you-go price. + * + * For PriceType Savings Plan, market price reflects the Savings plan benefit on top of pay-as-you-go price for the + * corresponding commitment term. + * + * For PriceType ReservedInstance, market price reflects the total price of the 1 or 3-year commitment. + * + * @return the marketPrice value. + */ + public String marketPrice() { + return this.marketPrice; + } + + /** + * Get the currency property: Currency in which all the prices are reflected. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the billingCurrency property: Currency in which charges are posted. + * + * @return the billingCurrency value. + */ + public String billingCurrency() { + return this.billingCurrency; + } + + /** + * Get the term property: Term length for Azure Savings Plan or Reservation term – one year or three years (P1Y or + * P3Y). + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the priceType property: Price type for a product. For example, an Azure resource with a pay-as-you-go rate + * with priceType as Consumption. Other price types include ReservedInstance and Savings Plan. + * + * @return the priceType value. + */ + public String priceType() { + return this.priceType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MCAPriceSheetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MCAPriceSheetProperties 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 MCAPriceSheetProperties. + */ + public static MCAPriceSheetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MCAPriceSheetProperties deserializedMCAPriceSheetProperties = new MCAPriceSheetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("billingAccountID".equals(fieldName)) { + deserializedMCAPriceSheetProperties.billingAccountID = reader.getString(); + } else if ("billingAccountName".equals(fieldName)) { + deserializedMCAPriceSheetProperties.billingAccountName = reader.getString(); + } else if ("billingProfileId".equals(fieldName)) { + deserializedMCAPriceSheetProperties.billingProfileId = reader.getString(); + } else if ("billingProfileName".equals(fieldName)) { + deserializedMCAPriceSheetProperties.billingProfileName = reader.getString(); + } else if ("productOrderName".equals(fieldName)) { + deserializedMCAPriceSheetProperties.productOrderName = reader.getString(); + } else if ("serviceFamily".equals(fieldName)) { + deserializedMCAPriceSheetProperties.serviceFamily = reader.getNullable(JsonReader::getDouble); + } else if ("product".equals(fieldName)) { + deserializedMCAPriceSheetProperties.product = reader.getString(); + } else if ("productId".equals(fieldName)) { + deserializedMCAPriceSheetProperties.productId = reader.getString(); + } else if ("skuId".equals(fieldName)) { + deserializedMCAPriceSheetProperties.skuId = reader.getString(); + } else if ("unitOfMeasure".equals(fieldName)) { + deserializedMCAPriceSheetProperties.unitOfMeasure = reader.getString(); + } else if ("meterId".equals(fieldName)) { + deserializedMCAPriceSheetProperties.meterId = reader.getString(); + } else if ("meterName".equals(fieldName)) { + deserializedMCAPriceSheetProperties.meterName = reader.getString(); + } else if ("meterType".equals(fieldName)) { + deserializedMCAPriceSheetProperties.meterType = reader.getString(); + } else if ("meterCategory".equals(fieldName)) { + deserializedMCAPriceSheetProperties.meterCategory = reader.getString(); + } else if ("meterSubCategory".equals(fieldName)) { + deserializedMCAPriceSheetProperties.meterSubCategory = reader.getString(); + } else if ("meterRegion".equals(fieldName)) { + deserializedMCAPriceSheetProperties.meterRegion = reader.getString(); + } else if ("tierMinimumUnits".equals(fieldName)) { + deserializedMCAPriceSheetProperties.tierMinimumUnits = reader.getString(); + } else if ("effectiveStartDate".equals(fieldName)) { + deserializedMCAPriceSheetProperties.effectiveStartDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("effectiveEndDate".equals(fieldName)) { + deserializedMCAPriceSheetProperties.effectiveEndDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("unitPrice".equals(fieldName)) { + deserializedMCAPriceSheetProperties.unitPrice = reader.getString(); + } else if ("basePrice".equals(fieldName)) { + deserializedMCAPriceSheetProperties.basePrice = reader.getString(); + } else if ("marketPrice".equals(fieldName)) { + deserializedMCAPriceSheetProperties.marketPrice = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedMCAPriceSheetProperties.currency = reader.getString(); + } else if ("billingCurrency".equals(fieldName)) { + deserializedMCAPriceSheetProperties.billingCurrency = reader.getString(); + } else if ("term".equals(fieldName)) { + deserializedMCAPriceSheetProperties.term = reader.getString(); + } else if ("priceType".equals(fieldName)) { + deserializedMCAPriceSheetProperties.priceType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMCAPriceSheetProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ManagementGroupScopeBenefitRecommendationProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ManagementGroupScopeBenefitRecommendationProperties.java new file mode 100644 index 000000000000..27431d4c93fc --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ManagementGroupScopeBenefitRecommendationProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +/** + * The properties of the benefit recommendation when scope is 'ManagementGroup'. + */ +@Immutable +public final class ManagementGroupScopeBenefitRecommendationProperties extends BenefitRecommendationProperties { + /* + * Benefit scope. For example, Single or Shared. + */ + private Scope scope = Scope.MANAGEMENT_GROUP; + + /* + * Fully-qualified identifier of the management group that this management group scope recommendation is for, of the + * format /providers/Microsoft.Management/managementGroups/{managementGroupId}. Applicable only if recommendation is + * for 'ManagementGroup' scope. + */ + private String managementGroupId; + + /* + * The tenant ID associated with the management group. Populated only when managementGroupId is populated. + */ + private String tenantId; + + /** + * Creates an instance of ManagementGroupScopeBenefitRecommendationProperties class. + */ + private ManagementGroupScopeBenefitRecommendationProperties() { + } + + /** + * Get the scope property: Benefit scope. For example, Single or Shared. + * + * @return the scope value. + */ + @Override + public Scope scope() { + return this.scope; + } + + /** + * Get the managementGroupId property: Fully-qualified identifier of the management group that this management group + * scope recommendation is for, of the format /providers/Microsoft.Management/managementGroups/{managementGroupId}. + * Applicable only if recommendation is for 'ManagementGroup' scope. + * + * @return the managementGroupId value. + */ + public String managementGroupId() { + return this.managementGroupId; + } + + /** + * Get the tenantId property: The tenant ID associated with the management group. Populated only when + * managementGroupId is populated. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lookBackPeriod", lookBackPeriod() == null ? null : lookBackPeriod().toString()); + jsonWriter.writeJsonField("usage", usage()); + jsonWriter.writeStringField("term", term() == null ? null : term().toString()); + jsonWriter.writeStringField("commitmentGranularity", + commitmentGranularity() == null ? null : commitmentGranularity().toString()); + jsonWriter.writeJsonField("recommendationDetails", recommendationDetails()); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementGroupScopeBenefitRecommendationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementGroupScopeBenefitRecommendationProperties 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 ManagementGroupScopeBenefitRecommendationProperties. + */ + public static ManagementGroupScopeBenefitRecommendationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagementGroupScopeBenefitRecommendationProperties deserializedManagementGroupScopeBenefitRecommendationProperties + = new ManagementGroupScopeBenefitRecommendationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("firstConsumptionDate".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.withFirstConsumptionDate(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastConsumptionDate".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.withLastConsumptionDate(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lookBackPeriod".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withLookBackPeriod(LookBackPeriod.fromString(reader.getString())); + } else if ("totalHours".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withTotalHours(reader.getNullable(JsonReader::getInt)); + } else if ("usage".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withUsage(RecommendationUsageDetails.fromJson(reader)); + } else if ("armSkuName".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.withArmSkuName(reader.getString()); + } else if ("term".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withTerm(Term.fromString(reader.getString())); + } else if ("commitmentGranularity".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withCommitmentGranularity(Grain.fromString(reader.getString())); + } else if ("currencyCode".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withCurrencyCode(reader.getString()); + } else if ("costWithoutBenefit".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.withCostWithoutBenefit( + reader.getNullable(nonNullReader -> new BigDecimal(nonNullReader.getString()))); + } else if ("recommendationDetails".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withRecommendationDetails(AllSavingsBenefitDetails.fromJson(reader)); + } else if ("allRecommendationDetails".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties + .withAllRecommendationDetails(AllSavingsList.fromJson(reader)); + } else if ("scope".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.scope + = Scope.fromString(reader.getString()); + } else if ("managementGroupId".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.managementGroupId + = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagementGroupScopeBenefitRecommendationProperties.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementGroupScopeBenefitRecommendationProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRule.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRule.java new file mode 100644 index 000000000000..fec94f1db9aa --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRule.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; + +/** + * An immutable client-side representation of MarkupRule. + */ +public interface MarkupRule { + /** + * 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 properties property: Markup rule properties. + * + * @return the properties value. + */ + MarkupRuleProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner object. + * + * @return the inner object. + */ + MarkupRuleInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRuleProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRuleProperties.java new file mode 100644 index 000000000000..958a0629b550 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRuleProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * The properties of the markup rule. + */ +@Fluent +public final class MarkupRuleProperties implements JsonSerializable { + /* + * The description of the markup rule. + */ + private String description; + + /* + * The markup percentage of the rule. + */ + private double percentage; + + /* + * Starting date of the markup rule. + */ + private OffsetDateTime startDate; + + /* + * Ending date of the markup rule. + */ + private OffsetDateTime endDate; + + /* + * Customer information for the markup rule. + */ + private CustomerMetadata customerDetails; + + /** + * Creates an instance of MarkupRuleProperties class. + */ + public MarkupRuleProperties() { + } + + /** + * Get the description property: The description of the markup rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the markup rule. + * + * @param description the description value to set. + * @return the MarkupRuleProperties object itself. + */ + public MarkupRuleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the percentage property: The markup percentage of the rule. + * + * @return the percentage value. + */ + public double percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The markup percentage of the rule. + * + * @param percentage the percentage value to set. + * @return the MarkupRuleProperties object itself. + */ + public MarkupRuleProperties withPercentage(double percentage) { + this.percentage = percentage; + return this; + } + + /** + * Get the startDate property: Starting date of the markup rule. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Set the startDate property: Starting date of the markup rule. + * + * @param startDate the startDate value to set. + * @return the MarkupRuleProperties object itself. + */ + public MarkupRuleProperties withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the endDate property: Ending date of the markup rule. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.endDate; + } + + /** + * Set the endDate property: Ending date of the markup rule. + * + * @param endDate the endDate value to set. + * @return the MarkupRuleProperties object itself. + */ + public MarkupRuleProperties withEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get the customerDetails property: Customer information for the markup rule. + * + * @return the customerDetails value. + */ + public CustomerMetadata customerDetails() { + return this.customerDetails; + } + + /** + * Set the customerDetails property: Customer information for the markup rule. + * + * @param customerDetails the customerDetails value to set. + * @return the MarkupRuleProperties object itself. + */ + public MarkupRuleProperties withCustomerDetails(CustomerMetadata customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("percentage", this.percentage); + jsonWriter.writeStringField("startDate", + this.startDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDate)); + jsonWriter.writeJsonField("customerDetails", this.customerDetails); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("endDate", + this.endDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarkupRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarkupRuleProperties 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 MarkupRuleProperties. + */ + public static MarkupRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarkupRuleProperties deserializedMarkupRuleProperties = new MarkupRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("percentage".equals(fieldName)) { + deserializedMarkupRuleProperties.percentage = reader.getDouble(); + } else if ("startDate".equals(fieldName)) { + deserializedMarkupRuleProperties.startDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("customerDetails".equals(fieldName)) { + deserializedMarkupRuleProperties.customerDetails = CustomerMetadata.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedMarkupRuleProperties.description = reader.getString(); + } else if ("endDate".equals(fieldName)) { + deserializedMarkupRuleProperties.endDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMarkupRuleProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRules.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRules.java new file mode 100644 index 000000000000..61d25f063bee --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRules.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; + +/** + * Resource collection API of MarkupRules. + */ +public interface MarkupRules { + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a markup rule by name for a billing account and billing profile along with {@link Response}. + */ + Response getWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context); + + /** + * Get a markup rule by name for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a markup rule by name for a billing account and billing profile. + */ + MarkupRule get(String billingAccountId, String billingProfileId, String ruleName); + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule along with {@link Response}. + */ + Response createOrUpdateWithResponse(String billingAccountId, String billingProfileId, String ruleName, + MarkupRuleInner resource, Context context); + + /** + * Create or update a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @param resource The markup rule to create or update. + * @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 markup rule. + */ + MarkupRule createOrUpdate(String billingAccountId, String billingProfileId, String ruleName, + MarkupRuleInner resource); + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 Response}. + */ + Response deleteWithResponse(String billingAccountId, String billingProfileId, String ruleName, + Context context); + + /** + * Delete a markup rule for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param ruleName Markup rule name. + * @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 billingAccountId, String billingProfileId, String ruleName); + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String billingAccountId, String billingProfileId); + + /** + * List all markup rules for a billing account and billing profile. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId BillingProfile ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return markup rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String billingAccountId, String billingProfileId, Context context); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MetricType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MetricType.java index 5d583bb51272..2297b5ce12e8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MetricType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/MetricType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Notification.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Notification.java new file mode 100644 index 000000000000..38ba2efc6ded --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Notification.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * The notification associated with a budget. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ +@Fluent +public final class Notification implements JsonSerializable { + /* + * The notification is enabled or not. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ + private boolean enabled; + + /* + * The comparison operator. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported operators for **CategoryType: Cost** + * - GreaterThan + * - GreaterThanOrEqualTo + * + * Supported operators for **CategoryType: ReservationUtilization** + * - LessThan + */ + private BudgetNotificationOperatorType operator; + + /* + * Threshold value associated with a notification. It is always percent with a maximum of 2 decimal places. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold. + * + * **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has + * a utilization percentage below the threshold. + */ + private double threshold; + + /* + * Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a + * threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when + * timeGrain: Last7Days, Monthly when timeGrain: Last30Days). + * + * Supported for CategoryType(s): ReservationUtilization. + */ + private Frequency frequency; + + /* + * Email addresses to send the notification to when the threshold is breached. Must have at least one contact email + * or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one + * contact email specified. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ + private List contactEmails; + + /* + * Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is + * breached. + * + * Supported for CategoryType(s): Cost. + */ + private List contactRoles; + + /* + * Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is + * exceeded. Must be provided as a fully qualified Azure resource id. + * + * Supported for CategoryType(s): Cost. + */ + private List contactGroups; + + /* + * The type of threshold. + * + * Supported for CategoryType(s): Cost. + */ + private ThresholdType thresholdType; + + /* + * Language in which the recipient will receive the notification, + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + */ + private CultureCode locale; + + /** + * Creates an instance of Notification class. + */ + public Notification() { + } + + /** + * Get the enabled property: The notification is enabled or not. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: The notification is enabled or not. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @param enabled the enabled value to set. + * @return the Notification object itself. + */ + public Notification withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the operator property: The comparison operator. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported operators for **CategoryType: Cost** + * - GreaterThan + * - GreaterThanOrEqualTo + * + * Supported operators for **CategoryType: ReservationUtilization** + * - LessThan. + * + * @return the operator value. + */ + public BudgetNotificationOperatorType operator() { + return this.operator; + } + + /** + * Set the operator property: The comparison operator. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported operators for **CategoryType: Cost** + * - GreaterThan + * - GreaterThanOrEqualTo + * + * Supported operators for **CategoryType: ReservationUtilization** + * - LessThan. + * + * @param operator the operator value to set. + * @return the Notification object itself. + */ + public Notification withOperator(BudgetNotificationOperatorType operator) { + this.operator = operator; + return this; + } + + /** + * Get the threshold property: Threshold value associated with a notification. It is always percent with a maximum + * of 2 decimal places. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold. + * + * **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has + * a utilization percentage below the threshold. + * + * @return the threshold value. + */ + public double threshold() { + return this.threshold; + } + + /** + * Set the threshold property: Threshold value associated with a notification. It is always percent with a maximum + * of 2 decimal places. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold. + * + * **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has + * a utilization percentage below the threshold. + * + * @param threshold the threshold value to set. + * @return the Notification object itself. + */ + public Notification withThreshold(double threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the frequency property: Frequency of a notification. Represents how long the notification will be silent + * after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on + * the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days). + * + * Supported for CategoryType(s): ReservationUtilization. + * + * @return the frequency value. + */ + public Frequency frequency() { + return this.frequency; + } + + /** + * Set the frequency property: Frequency of a notification. Represents how long the notification will be silent + * after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on + * the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days). + * + * Supported for CategoryType(s): ReservationUtilization. + * + * @param frequency the frequency value to set. + * @return the Notification object itself. + */ + public Notification withFrequency(Frequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get the contactEmails property: Email addresses to send the notification to when the threshold is breached. Must + * have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All + * other scopes must have at least one contact email specified. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @return the contactEmails value. + */ + public List contactEmails() { + return this.contactEmails; + } + + /** + * Set the contactEmails property: Email addresses to send the notification to when the threshold is breached. Must + * have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All + * other scopes must have at least one contact email specified. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @param contactEmails the contactEmails value to set. + * @return the Notification object itself. + */ + public Notification withContactEmails(List contactEmails) { + this.contactEmails = contactEmails; + return this; + } + + /** + * Get the contactRoles property: Subscription or Resource Group scopes only. Contact roles to send the notification + * to when the threshold is breached. + * + * Supported for CategoryType(s): Cost. + * + * @return the contactRoles value. + */ + public List contactRoles() { + return this.contactRoles; + } + + /** + * Set the contactRoles property: Subscription or Resource Group scopes only. Contact roles to send the notification + * to when the threshold is breached. + * + * Supported for CategoryType(s): Cost. + * + * @param contactRoles the contactRoles value to set. + * @return the Notification object itself. + */ + public Notification withContactRoles(List contactRoles) { + this.contactRoles = contactRoles; + return this; + } + + /** + * Get the contactGroups property: Subscription or Resource Group scopes only. Action groups to send the + * notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. + * + * Supported for CategoryType(s): Cost. + * + * @return the contactGroups value. + */ + public List contactGroups() { + return this.contactGroups; + } + + /** + * Set the contactGroups property: Subscription or Resource Group scopes only. Action groups to send the + * notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. + * + * Supported for CategoryType(s): Cost. + * + * @param contactGroups the contactGroups value to set. + * @return the Notification object itself. + */ + public Notification withContactGroups(List contactGroups) { + this.contactGroups = contactGroups; + return this; + } + + /** + * Get the thresholdType property: The type of threshold. + * + * Supported for CategoryType(s): Cost. + * + * @return the thresholdType value. + */ + public ThresholdType thresholdType() { + return this.thresholdType; + } + + /** + * Set the thresholdType property: The type of threshold. + * + * Supported for CategoryType(s): Cost. + * + * @param thresholdType the thresholdType value to set. + * @return the Notification object itself. + */ + public Notification withThresholdType(ThresholdType thresholdType) { + this.thresholdType = thresholdType; + return this; + } + + /** + * Get the locale property: Language in which the recipient will receive the notification, + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @return the locale value. + */ + public CultureCode locale() { + return this.locale; + } + + /** + * Set the locale property: Language in which the recipient will receive the notification, + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * @param locale the locale value to set. + * @return the Notification object itself. + */ + public Notification withLocale(CultureCode locale) { + this.locale = locale; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeDoubleField("threshold", this.threshold); + jsonWriter.writeArrayField("contactEmails", this.contactEmails, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeArrayField("contactRoles", this.contactRoles, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("contactGroups", this.contactGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("thresholdType", this.thresholdType == null ? null : this.thresholdType.toString()); + jsonWriter.writeStringField("locale", this.locale == null ? null : this.locale.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Notification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Notification 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 Notification. + */ + public static Notification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Notification deserializedNotification = new Notification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedNotification.enabled = reader.getBoolean(); + } else if ("operator".equals(fieldName)) { + deserializedNotification.operator = BudgetNotificationOperatorType.fromString(reader.getString()); + } else if ("threshold".equals(fieldName)) { + deserializedNotification.threshold = reader.getDouble(); + } else if ("contactEmails".equals(fieldName)) { + List contactEmails = reader.readArray(reader1 -> reader1.getString()); + deserializedNotification.contactEmails = contactEmails; + } else if ("frequency".equals(fieldName)) { + deserializedNotification.frequency = Frequency.fromString(reader.getString()); + } else if ("contactRoles".equals(fieldName)) { + List contactRoles = reader.readArray(reader1 -> reader1.getString()); + deserializedNotification.contactRoles = contactRoles; + } else if ("contactGroups".equals(fieldName)) { + List contactGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedNotification.contactGroups = contactGroups; + } else if ("thresholdType".equals(fieldName)) { + deserializedNotification.thresholdType = ThresholdType.fromString(reader.getString()); + } else if ("locale".equals(fieldName)) { + deserializedNotification.locale = CultureCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNotification; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/NotificationProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/NotificationProperties.java index 070869d5f7a2..17657ff7d130 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/NotificationProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/NotificationProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -149,24 +148,6 @@ public NotificationProperties withSubject(String subject) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (to() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property to in model NotificationProperties")); - } - if (subject() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property subject in model NotificationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NotificationProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operation.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operation.java index 2f50399a511e..80afca680c58 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operation.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operation.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public class Operation implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -25,8 +25,8 @@ public class Operation implements JsonSerializable { private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -42,14 +42,14 @@ public class Operation implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of Operation class. */ - public Operation() { + protected Operation() { } /** @@ -76,7 +76,7 @@ Operation withName(String name) { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -86,7 +86,7 @@ public Boolean isDataAction() { /** * Set the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @param isDataAction the isDataAction value to set. * @return the Operation object itself. @@ -111,7 +111,7 @@ public OperationDisplay display() { * @param display the display value to set. * @return the Operation object itself. */ - public Operation withDisplay(OperationDisplay display) { + Operation withDisplay(OperationDisplay display) { this.display = display; return this; } @@ -139,8 +139,8 @@ Operation withOrigin(Origin origin) { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ @@ -149,8 +149,8 @@ public ActionType actionType() { } /** - * Set the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Set the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @param actionType the actionType value to set. * @return the Operation object itself. @@ -160,17 +160,6 @@ Operation withActionType(ActionType actionType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationDisplay.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationDisplay.java index 4fbb5eff9c78..d7319d71ac1b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationDisplay.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for an operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { /** diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operations.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operations.java index bee1908766f6..5619cb2509e5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operations.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,7 +12,7 @@ */ public interface Operations { /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @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. @@ -21,7 +21,7 @@ public interface Operations { PagedIterable list(); /** - * Lists all of the available cost management REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperatorType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperatorType.java index b46127a4c602..5c96c6430c49 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperatorType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/OperatorType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Origin.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Origin.java index ceb72f2da397..2b2b0a5681d2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Origin.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Origin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -13,17 +13,17 @@ */ public final class Origin extends ExpandableStringEnum { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotProperties.java index 84f59425ace0..9d4ab2c187d9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -72,14 +72,6 @@ public PivotProperties withName(String name) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotType.java index f1ef5f80a6a6..9f8e9c186661 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PivotType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PriceSheets.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PriceSheets.java index ef45a6ffbd76..d5e31b132464 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PriceSheets.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PriceSheets.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -14,22 +14,22 @@ public interface PriceSheets { * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download the pricesheet for an invoice. */ - DownloadUrl download(String billingAccountName, String billingProfileName, String invoiceName); + DownloadUrl downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName); /** * Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -37,36 +37,117 @@ public interface PriceSheets { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download the pricesheet for an invoice. */ - DownloadUrl download(String billingAccountName, String billingProfileName, String invoiceName, Context context); + DownloadUrl downloadByInvoice(String billingAccountName, String billingProfileName, String invoiceName, + Context context); /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. + * + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download the current month's pricesheet for a billing profile. */ - DownloadUrl downloadByBillingProfile(String billingAccountName, String billingProfileName); + PricesheetDownloadProperties downloadByBillingProfile(String billingAccountName, String billingProfileName); /** * Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure - * product growth, the Azure price sheet download experience in this preview version will be updated from a single - * csv file to a Zip file containing multiple csv files, each with max 200k records. + * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * You can use the new 2023-09-01 API version for billing periods January 2023 onwards. Azure Reserved Instance (RI) + * pricing is only available through the new version of the API. * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated + * from a single csv/json file to a Zip file containing multiple csv/json files, each with max size of 75MB. + * + * @param billingAccountName BillingAccount ID. + * @param billingProfileName Billing Profile Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download the current month's pricesheet for a billing profile. */ - DownloadUrl downloadByBillingProfile(String billingAccountName, String billingProfileName, Context context); + PricesheetDownloadProperties downloadByBillingProfile(String billingAccountName, String billingProfileName, + Context context); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation. + */ + OperationStatus downloadByBillingAccount(String billingAccountId, String billingPeriodName); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the Enrollment ID. This is for + * Enterprise Agreement customers. + * + * **Migrate to version 2025-03-01** + * + * You can use the 2025-03-01 API version with the new URI: + * + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.CostManagement/pricesheets/default/download' + * + * With a new schema detailed below, the new version of the price sheet provides additional information and includes + * prices for Azure Reserved Instances (RI) for the current billing period. We recommend downloading an Azure Price + * Sheet for when entering a new billing period if you would maintain an ongoing record of past Azure Reserved + * Instance (RI) pricing. + * + * The EA Azure price sheet is available for billing periods in the past 13 months. To request a price sheet for a + * billing period older than 13 months, please contact support. + * + * The Azure price sheet download experience has been updated from a single .csv file to a zip file containing + * multiple .csv files, each with max size of 75MB. The 2023-11-01 version has been upgraded to use http POST + * method; details can be found below. + * + * All versions of the Microsoft.Consumption Azure Price Sheet - Download by Billing Account (including 2022-06-01, + * 2021-10-01, 2020-01-01-preview, 2019-10-01, 2019-05-01) are scheduled to be retired on 01 June 2026 and will no + * longer be supported after this date. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @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 status of the long running operation. + */ + OperationStatus downloadByBillingAccount(String billingAccountId, String billingPeriodName, Context context); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PricesheetDownloadProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PricesheetDownloadProperties.java new file mode 100644 index 000000000000..48af7ed01849 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/PricesheetDownloadProperties.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of PricesheetDownloadProperties. + */ +public interface PricesheetDownloadProperties { + /** + * Gets the expiryTime property: The time at which report URL becomes invalid/expires in UTC e.g. + * 2020-12-08T05:55:59.4394737Z. + * + * @return the expiryTime value. + */ + OffsetDateTime expiryTime(); + + /** + * Gets the downloadUrl property: The URL to download the generated report. + * + * @return the downloadUrl value. + */ + String downloadUrl(); + + /** + * Gets the downloadFileProperties property: The properties in downloaded file. + * + * @return the downloadFileProperties value. + */ + MCAPriceSheetProperties downloadFileProperties(); + + /** + * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner object. + * + * @return the inner object. + */ + PricesheetDownloadPropertiesInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Queries.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Queries.java index 66c38bb1959f..0b6fe0404c2f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Queries.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Queries.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -65,7 +65,7 @@ public interface Queries { * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. @@ -83,7 +83,7 @@ Response usageByExternalCloudProviderTypeWithResponse( * This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. * @param externalCloudProviderId This can be '{externalSubscriptionId}' for linked account or * '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - * @param parameters Parameters supplied to the CreateOrUpdate Query Config operation. + * @param parameters The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryAggregation.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryAggregation.java index f73661b8b3d1..9ea183fdc326 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryAggregation.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryAggregation.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -73,24 +72,6 @@ public QueryAggregation withFunction(FunctionType function) { 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 QueryAggregation")); - } - if (function() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property function in model QueryAggregation")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QueryAggregation.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumn.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumn.java index efc5d3838c74..b26778845bdd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumn.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumn.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * QueryColumn properties. */ -@Fluent +@Immutable public final class QueryColumn implements JsonSerializable { /* * The name of column. @@ -29,7 +29,7 @@ public final class QueryColumn implements JsonSerializable { /** * Creates an instance of QueryColumn class. */ - public QueryColumn() { + private QueryColumn() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of column. - * - * @param name the name value to set. - * @return the QueryColumn object itself. - */ - public QueryColumn withName(String name) { - this.name = name; - return this; - } - /** * Get the type property: The type of column. * @@ -61,25 +50,6 @@ public String type() { return this.type; } - /** - * Set the type property: The type of column. - * - * @param type the type value to set. - * @return the QueryColumn object itself. - */ - public QueryColumn withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumnType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumnType.java index f321e31ad210..b0c5453d73b8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumnType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumnType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,12 +12,12 @@ */ public final class QueryColumnType extends ExpandableStringEnum { /** - * Static value TagKey for QueryColumnType. + * The tag associated with the cost data. */ public static final QueryColumnType TAG_KEY = fromString("TagKey"); /** - * Static value Dimension for QueryColumnType. + * The dimension of cost data. */ public static final QueryColumnType DIMENSION = fromString("Dimension"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryComparisonExpression.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryComparisonExpression.java index 155141d6ad63..0a8c823a2c69 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryComparisonExpression.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryComparisonExpression.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -99,30 +98,6 @@ public QueryComparisonExpression withValues(List values) { 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 QueryComparisonExpression")); - } - if (operator() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property operator in model QueryComparisonExpression")); - } - if (values() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property values in model QueryComparisonExpression")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QueryComparisonExpression.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDataset.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDataset.java index 7b04b0ba8a0a..c271c75006e8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDataset.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDataset.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -160,30 +160,6 @@ public QueryDataset withFilter(QueryFilter filter) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - if (aggregation() != null) { - aggregation().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (grouping() != null) { - grouping().forEach(e -> e.validate()); - } - if (filter() != null) { - filter().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDatasetConfiguration.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDatasetConfiguration.java index b982ec5f9614..e7f210d6cdf2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDatasetConfiguration.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDatasetConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -51,14 +51,6 @@ public QueryDatasetConfiguration withColumns(List columns) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDefinition.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDefinition.java index ef12887b63d0..71bd15acd114 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDefinition.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDefinition.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -125,33 +124,6 @@ public QueryDefinition withDataset(QueryDataset dataset) { 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 QueryDefinition")); - } - if (timeframe() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property timeframe in model QueryDefinition")); - } - if (timePeriod() != null) { - timePeriod().validate(); - } - if (dataset() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property dataset in model QueryDefinition")); - } else { - dataset().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QueryDefinition.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryFilter.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryFilter.java index 0eb12e207597..81aaab4efdc3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryFilter.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -123,26 +123,6 @@ public QueryFilter withTags(QueryComparisonExpression tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (and() != null) { - and().forEach(e -> e.validate()); - } - if (or() != null) { - or().forEach(e -> e.validate()); - } - if (dimensions() != null) { - dimensions().validate(); - } - if (tags() != null) { - tags().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryGrouping.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryGrouping.java index 29c2bda0893f..3b5bcb19fc14 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryGrouping.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryGrouping.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -73,24 +72,6 @@ public QueryGrouping withName(String name) { 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 QueryGrouping")); - } - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model QueryGrouping")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QueryGrouping.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryOperatorType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryOperatorType.java index 2ebb5c4da22d..fade9f715377 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryOperatorType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryOperatorType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryResult.java index 06b006755bfd..80e66f0789c1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryResult.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -13,40 +13,33 @@ */ public interface QueryResult { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Resource Id. * * @return the id value. */ String id(); /** - * Gets the name property: The name of the resource. + * Gets the name property: Resource name. * * @return the name value. */ String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the location property: Location of the resource. * * @return the location value. */ String location(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the sku property: SKU of the resource. * @@ -61,6 +54,13 @@ public interface QueryResult { */ String etag(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the nextLink property: The link (url) to the next page of results. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryTimePeriod.java index ca080efeded4..4bb6ff23aa2f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryTimePeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/QueryTimePeriod.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -76,24 +75,6 @@ public QueryTimePeriod withTo(OffsetDateTime to) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (from() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property from in model QueryTimePeriod")); - } - if (to() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property to in model QueryTimePeriod")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QueryTimePeriod.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Reason.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Reason.java new file mode 100644 index 000000000000..09fef72fd4f1 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Reason.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The reason this name is not available. + */ +public final class Reason extends ExpandableStringEnum { + /** + * Static value Invalid for Reason. + */ + public static final Reason INVALID = fromString("Invalid"); + + /** + * Static value AlreadyExists for Reason. + */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Static value Valid for Reason. + */ + public static final Reason VALID = fromString("Valid"); + + /** + * Creates a new instance of Reason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Reason() { + } + + /** + * Creates or finds a Reason from its string representation. + * + * @param name a name to look for. + * @return the corresponding Reason. + */ + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** + * Gets known Reason values. + * + * @return known Reason values. + */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecommendationUsageDetails.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecommendationUsageDetails.java index d426c12e5836..9fd525e7d828 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecommendationUsageDetails.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecommendationUsageDetails.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ * On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit * recommendations. */ -@Fluent +@Immutable public final class RecommendationUsageDetails implements JsonSerializable { /* * The grain of the usage. Supported values: 'Hourly' @@ -33,7 +33,7 @@ public final class RecommendationUsageDetails implements JsonSerializable charges() { return this.charges; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecurrenceType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecurrenceType.java index cf369f08108c..0baddf7a7a69 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecurrenceType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RecurrenceType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigAggregation.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigAggregation.java index 52e921031b85..fcb06b912266 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigAggregation.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigAggregation.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -73,25 +72,6 @@ public ReportConfigAggregation withFunction(FunctionType function) { 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 ReportConfigAggregation")); - } - if (function() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property function in model ReportConfigAggregation")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReportConfigAggregation.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigComparisonExpression.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigComparisonExpression.java index b941861651f0..3e70410c99ce 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigComparisonExpression.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigComparisonExpression.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -99,31 +98,6 @@ public ReportConfigComparisonExpression withValues(List values) { 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 ReportConfigComparisonExpression")); - } - if (operator() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property operator in model ReportConfigComparisonExpression")); - } - if (values() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property values in model ReportConfigComparisonExpression")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReportConfigComparisonExpression.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDataset.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDataset.java index 5dabaa1f4533..e3d779e9ff33 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDataset.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDataset.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -182,33 +182,6 @@ public ReportConfigDataset withFilter(ReportConfigFilter filter) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - if (aggregation() != null) { - aggregation().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (grouping() != null) { - grouping().forEach(e -> e.validate()); - } - if (sorting() != null) { - sorting().forEach(e -> e.validate()); - } - if (filter() != null) { - filter().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDatasetConfiguration.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDatasetConfiguration.java index 9fade3c57ea2..6f72fabc189b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDatasetConfiguration.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDatasetConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -51,14 +51,6 @@ public ReportConfigDatasetConfiguration withColumns(List columns) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigFilter.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigFilter.java index dc02d5b35614..15fffbb82b10 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigFilter.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -123,26 +123,6 @@ public ReportConfigFilter withTags(ReportConfigComparisonExpression tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (and() != null) { - and().forEach(e -> e.validate()); - } - if (or() != null) { - or().forEach(e -> e.validate()); - } - if (dimensions() != null) { - dimensions().validate(); - } - if (tags() != null) { - tags().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigGrouping.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigGrouping.java index 7d11310f4101..31fbb3dc1685 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigGrouping.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigGrouping.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -73,24 +72,6 @@ public ReportConfigGrouping withName(String name) { 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 ReportConfigGrouping")); - } - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model ReportConfigGrouping")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReportConfigGrouping.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSorting.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSorting.java index d235283cbef2..6ed392e6499d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSorting.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSorting.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -73,20 +72,6 @@ public ReportConfigSorting withName(String name) { 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 ReportConfigSorting")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReportConfigSorting.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSortingType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSortingType.java index 8f6117699e81..2684ba4f9bab 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSortingType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSortingType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigTimePeriod.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigTimePeriod.java index 50053987471c..3122d847e5e6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigTimePeriod.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigTimePeriod.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -76,24 +75,6 @@ public ReportConfigTimePeriod withTo(OffsetDateTime to) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (from() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property from in model ReportConfigTimePeriod")); - } - if (to() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property to in model ReportConfigTimePeriod")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReportConfigTimePeriod.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportGranularityType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportGranularityType.java index 4c7b444e4629..2daeb4df1537 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportGranularityType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportGranularityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportOperationStatusType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportOperationStatusType.java index a85ecfd727ea..463d60bbf4b5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportOperationStatusType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportOperationStatusType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportTimeframeType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportTimeframeType.java index 8519365d3ebd..31bd551158b1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportTimeframeType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportTimeframeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportType.java index a493b6de294f..1f73febfcb7e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReportType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReservationReportSchema.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReservationReportSchema.java index 8f65a430a53e..330160f4b1ca 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReservationReportSchema.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ReservationReportSchema.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RuleStatus.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RuleStatus.java new file mode 100644 index 000000000000..039f59983477 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/RuleStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current status of the rule. + */ +public final class RuleStatus extends ExpandableStringEnum { + /** + * Rule is saved but not used to allocate costs. + */ + public static final RuleStatus NOT_ACTIVE = fromString("NotActive"); + + /** + * Rule is saved and impacting cost allocation. + */ + public static final RuleStatus ACTIVE = fromString("Active"); + + /** + * Rule is saved and cost allocation is being updated. Readonly value that cannot be submitted in a put request. + */ + public static final RuleStatus PROCESSING = fromString("Processing"); + + /** + * Creates a new instance of RuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleStatus() { + } + + /** + * Creates or finds a RuleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleStatus. + */ + public static RuleStatus fromString(String name) { + return fromString(name, RuleStatus.class); + } + + /** + * Gets known RuleStatus values. + * + * @return known RuleStatus values. + */ + public static Collection values() { + return values(RuleStatus.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SavingsPlanUtilizationSummary.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SavingsPlanUtilizationSummary.java index 176502dc65c6..b6783ce50c88 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SavingsPlanUtilizationSummary.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SavingsPlanUtilizationSummary.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,7 +18,7 @@ /** * Savings plan utilization summary resource. */ -@Fluent +@Immutable public final class SavingsPlanUtilizationSummary extends BenefitUtilizationSummaryInner { /* * Supported values: 'SavingsPlan'. @@ -29,6 +30,11 @@ public final class SavingsPlanUtilizationSummary extends BenefitUtilizationSumma */ private SavingsPlanUtilizationSummaryProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -47,7 +53,7 @@ public final class SavingsPlanUtilizationSummary extends BenefitUtilizationSumma /** * Creates an instance of SavingsPlanUtilizationSummary class. */ - public SavingsPlanUtilizationSummary() { + private SavingsPlanUtilizationSummary() { } /** @@ -69,6 +75,16 @@ private SavingsPlanUtilizationSummaryProperties innerProperties() { return this.innerProperties; } + /** + * 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 type property: The type of the resource. * @@ -101,7 +117,7 @@ public String id() { /** * Get the avgUtilizationPercentage property: This is the average hourly utilization for each date range that - * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2022-10-01 and usageDate + * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2025-03-01 and usageDate * < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, * the avgUtilizationPercentage value will be equal to the average of the set of values where the set contains 24 * utilization percentage entries one for each hour in a specific day. @@ -114,7 +130,7 @@ public BigDecimal avgUtilizationPercentage() { /** * Get the minUtilizationPercentage property: This is the minimum hourly utilization for each date range that - * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2022-10-01 and usageDate + * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2025-03-01 and usageDate * < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, * the minUtilizationPercentage value will be equal to the smallest in the set of values where the set contains 24 * utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the lowest @@ -129,7 +145,7 @@ public BigDecimal minUtilizationPercentage() { /** * Get the maxUtilizationPercentage property: This is the maximum hourly utilization for each date range that - * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2022-10-01 and usageDate + * corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2025-03-01 and usageDate * < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, * the maxUtilizationPercentage value will be equal to the largest in the set of values where the set contains 24 * utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the largest @@ -178,20 +194,6 @@ public BenefitKind benefitType() { return this.innerProperties() == null ? null : this.innerProperties().benefitType(); } - /** - * Set the benefitType property: The benefit type. Supported values: 'SavingsPlan'. - * - * @param benefitType the benefitType value to set. - * @return the SavingsPlanUtilizationSummary object itself. - */ - public SavingsPlanUtilizationSummary withBenefitType(BenefitKind benefitType) { - if (this.innerProperties() == null) { - this.innerProperties = new SavingsPlanUtilizationSummaryProperties(); - } - this.innerProperties().withBenefitType(benefitType); - return this; - } - /** * Get the usageDate property: Date corresponding to the utilization summary record. If the grain of data is * monthly, value for this field will be first day of the month. @@ -202,18 +204,6 @@ public OffsetDateTime usageDate() { return this.innerProperties() == null ? null : this.innerProperties().usageDate(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -248,6 +238,8 @@ public static SavingsPlanUtilizationSummary fromJson(JsonReader jsonReader) thro deserializedSavingsPlanUtilizationSummary.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSavingsPlanUtilizationSummary.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSavingsPlanUtilizationSummary.systemData = SystemData.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedSavingsPlanUtilizationSummary.kind = BenefitKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleFrequency.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleFrequency.java index b84c5951d6de..ff117d05aefc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleFrequency.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleFrequency.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,17 +12,17 @@ */ public final class ScheduleFrequency extends ExpandableStringEnum { /** - * Static value Daily for ScheduleFrequency. + * Cost analysis data will be emailed every day. */ public static final ScheduleFrequency DAILY = fromString("Daily"); /** - * Static value Weekly for ScheduleFrequency. + * Cost analysis data will be emailed every week. */ public static final ScheduleFrequency WEEKLY = fromString("Weekly"); /** - * Static value Monthly for ScheduleFrequency. + * Cost analysis data will be emailed every month. */ public static final ScheduleFrequency MONTHLY = fromString("Monthly"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleProperties.java index 97836d5b3368..4f6dfd3bd01d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleProperties.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.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; @@ -211,28 +210,6 @@ public ScheduleProperties withEndDate(OffsetDateTime endDate) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (frequency() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property frequency in model ScheduleProperties")); - } - if (startDate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property startDate in model ScheduleProperties")); - } - if (endDate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property endDate in model ScheduleProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScheduleProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledAction.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledAction.java index b0a12251e2c4..63276cbe6c43 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledAction.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -52,7 +52,7 @@ public interface ScheduledAction { ScheduledActionKind kind(); /** - * Gets the systemData property: Kind of the scheduled action. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -95,9 +95,10 @@ public interface ScheduledAction { ScheduleProperties schedule(); /** - * Gets the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Gets the scope property: For private scheduled action(Create or Update), scope will be empty.<br /> For + * shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' + * for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup + * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for * EnrollmentAccount scope, @@ -158,22 +159,7 @@ interface WithScopeStage { /** * Specifies scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for - * Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, - * 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External - * Subscription scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @return the next definition stage. */ WithCreate withExistingScope(String scope); @@ -183,8 +169,8 @@ interface WithScopeStage { * The stage of the ScheduledAction 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.WithKind, DefinitionStages.WithDisplayName, - DefinitionStages.WithFileDestination, DefinitionStages.WithNotification, + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithKind, + DefinitionStages.WithDisplayName, DefinitionStages.WithFileDestination, DefinitionStages.WithNotification, DefinitionStages.WithNotificationEmail, DefinitionStages.WithSchedule, DefinitionStages.WithScope, DefinitionStages.WithStatus, DefinitionStages.WithViewId, DefinitionStages.WithIfMatch { /** @@ -203,6 +189,25 @@ interface WithCreate extends DefinitionStages.WithKind, DefinitionStages.WithDis ScheduledAction create(Context context); } + /** + * The stage of the ScheduledAction definition allowing to specify etag. + */ + interface WithEtag { + /** + * Specifies the etag property: Resource Etag. For update calls, eTag is optional and can be specified to + * achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including + * the latest eTag as part of the request body or 'If-Match' header while performing the update. For create + * calls, eTag is not required.. + * + * @param etag Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic + * concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as + * part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not + * required. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** * The stage of the ScheduledAction definition allowing to specify kind. */ @@ -288,9 +293,11 @@ interface WithSchedule { */ interface WithScope { /** - * Specifies the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Specifies the scope property: For private scheduled action(Create or Update), scope will be empty.<br + * /> For shared scheduled action(Create or Update By Scope), Cost Management scope can be + * 'subscriptions/{subscriptionId}' for subscription scope, + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for * Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' @@ -304,7 +311,9 @@ interface WithScope { * '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for * ExternalSubscription scope.. * - * @param scope Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, + * @param scope For private scheduled action(Create or Update), scope will be empty.<br /> For shared + * scheduled action(Create or Update By Scope), Cost Management scope can be + * 'subscriptions/{subscriptionId}' for subscription scope, * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for @@ -378,9 +387,10 @@ interface WithIfMatch { /** * The template for ScheduledAction update. */ - interface Update extends UpdateStages.WithKind, UpdateStages.WithDisplayName, UpdateStages.WithFileDestination, - UpdateStages.WithNotification, UpdateStages.WithNotificationEmail, UpdateStages.WithSchedule, - UpdateStages.WithScope, UpdateStages.WithStatus, UpdateStages.WithViewId, UpdateStages.WithIfMatch { + interface Update extends UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithDisplayName, + UpdateStages.WithFileDestination, UpdateStages.WithNotification, UpdateStages.WithNotificationEmail, + UpdateStages.WithSchedule, UpdateStages.WithScope, UpdateStages.WithStatus, UpdateStages.WithViewId, + UpdateStages.WithIfMatch { /** * Executes the update request. * @@ -401,6 +411,25 @@ interface Update extends UpdateStages.WithKind, UpdateStages.WithDisplayName, Up * The ScheduledAction update stages. */ interface UpdateStages { + /** + * The stage of the ScheduledAction update allowing to specify etag. + */ + interface WithEtag { + /** + * Specifies the etag property: Resource Etag. For update calls, eTag is optional and can be specified to + * achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including + * the latest eTag as part of the request body or 'If-Match' header while performing the update. For create + * calls, eTag is not required.. + * + * @param etag Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic + * concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as + * part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not + * required. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** * The stage of the ScheduledAction update allowing to specify kind. */ @@ -486,9 +515,11 @@ interface WithSchedule { */ interface WithScope { /** - * Specifies the scope property: Cost Management scope like 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * Specifies the scope property: For private scheduled action(Create or Update), scope will be empty.<br + * /> For shared scheduled action(Create or Update By Scope), Cost Management scope can be + * 'subscriptions/{subscriptionId}' for subscription scope, + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for * Department scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' @@ -502,7 +533,9 @@ interface WithScope { * '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for * ExternalSubscription scope.. * - * @param scope Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, + * @param scope For private scheduled action(Create or Update), scope will be empty.<br /> For shared + * scheduled action(Create or Update By Scope), Cost Management scope can be + * 'subscriptions/{subscriptionId}' for subscription scope, * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionKind.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionKind.java index 00c661e28f39..9ce94129ed85 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionKind.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,12 +12,13 @@ */ public final class ScheduledActionKind extends ExpandableStringEnum { /** - * Static value Email for ScheduledActionKind. + * Cost analysis data will be emailed. */ public static final ScheduledActionKind EMAIL = fromString("Email"); /** - * Static value InsightAlert for ScheduledActionKind. + * Cost anomaly information will be emailed. Available only on subscription scope at daily frequency. If no anomaly + * is detected on the resource, an email won't be sent. */ public static final ScheduledActionKind INSIGHT_ALERT = fromString("InsightAlert"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionProxyResource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionProxyResource.java deleted file mode 100644 index 1f3804722255..000000000000 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionProxyResource.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.costmanagement.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -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; - -/** - * The Resource model definition. - */ -@Fluent -public class ScheduledActionProxyResource extends ProxyResource { - /* - * Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch - * the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or - * 'If-Match' header while performing the update. For create calls, eTag is not required. - */ - private String etag; - - /* - * Kind of the scheduled action. - */ - private ScheduledActionKind kind; - - /* - * Kind of the scheduled action. - */ - 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 ScheduledActionProxyResource class. - */ - public ScheduledActionProxyResource() { - } - - /** - * Get the etag property: Resource Etag. For update calls, eTag is optional and can be specified to achieve - * optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag - * as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not - * required. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Resource Etag. For update calls, eTag is optional and can be specified to achieve - * optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag - * as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not - * required. - * - * @param etag the etag value to set. - * @return the ScheduledActionProxyResource object itself. - */ - ScheduledActionProxyResource withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the kind property: Kind of the scheduled action. - * - * @return the kind value. - */ - public ScheduledActionKind kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the scheduled action. - * - * @param kind the kind value to set. - * @return the ScheduledActionProxyResource object itself. - */ - public ScheduledActionProxyResource withKind(ScheduledActionKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the systemData property: Kind of the scheduled action. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Kind of the scheduled action. - * - * @param systemData the systemData value to set. - * @return the ScheduledActionProxyResource object itself. - */ - ScheduledActionProxyResource 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; - } - - /** - * 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("kind", this.kind == null ? null : this.kind.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScheduledActionProxyResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScheduledActionProxyResource 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 ScheduledActionProxyResource. - */ - public static ScheduledActionProxyResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScheduledActionProxyResource deserializedScheduledActionProxyResource = new ScheduledActionProxyResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedScheduledActionProxyResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedScheduledActionProxyResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedScheduledActionProxyResource.type = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedScheduledActionProxyResource.etag = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedScheduledActionProxyResource.kind = ScheduledActionKind.fromString(reader.getString()); - } else if ("systemData".equals(fieldName)) { - deserializedScheduledActionProxyResource.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedScheduledActionProxyResource; - }); - } -} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionStatus.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionStatus.java index 805b9a929876..63401f02f8ff 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionStatus.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,19 +12,19 @@ */ public final class ScheduledActionStatus extends ExpandableStringEnum { /** - * Static value Disabled for ScheduledActionStatus. + * Scheduled action is saved and will be run. */ - public static final ScheduledActionStatus DISABLED = fromString("Disabled"); + public static final ScheduledActionStatus ENABLED = fromString("Enabled"); /** - * Static value Enabled for ScheduledActionStatus. + * Scheduled action is expired. */ - public static final ScheduledActionStatus ENABLED = fromString("Enabled"); + public static final ScheduledActionStatus EXPIRED = fromString("Expired"); /** - * Static value Expired for ScheduledActionStatus. + * Scheduled action is saved but will not be run. */ - public static final ScheduledActionStatus EXPIRED = fromString("Expired"); + public static final ScheduledActionStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of ScheduledActionStatus value. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActions.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActions.java index e9aa1c4dbe86..90fb5e2847c8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActions.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -14,75 +14,27 @@ */ public interface ScheduledActions { /** - * List all private scheduled actions. - * - * @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 scheduled actions list result as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List all private scheduled actions. + * Get the private scheduled action by name. * - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @param name Scheduled action name. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String filter, Context context); - - /** - * List all shared scheduled actions within the given scope. - * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return the private scheduled action by name along with {@link Response}. */ - PagedIterable listByScope(String scope); + Response getWithResponse(String name, Context context); /** - * List all shared scheduled actions within the given scope. + * Get the private scheduled action by name. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. - * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. - * @param context The context to associate with this operation. + * @param name Scheduled action name. * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + * @return the private scheduled action by name. */ - PagedIterable listByScope(String scope, String filter, Context context); + ScheduledAction get(String name); /** * Create or update a private scheduled action. @@ -113,30 +65,50 @@ Response createOrUpdateWithResponse(String name, ScheduledActio ScheduledAction createOrUpdate(String name, ScheduledActionInner scheduledAction); /** - * Get the private scheduled action by name. + * Delete a private scheduled action. * * @param name Scheduled action name. * @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 private scheduled action by name along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String name, Context context); + Response deleteWithResponse(String name, Context context); /** - * Get the private scheduled action by name. + * Delete a private scheduled action. * * @param name Scheduled action name. * @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 private scheduled action by name. */ - ScheduledAction get(String name); + void delete(String name); /** - * Delete a private scheduled action. + * List all private scheduled actions. + * + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all private scheduled actions. + * + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); + + /** + * Processes a private scheduled action. * * @param name Scheduled action name. * @param context The context to associate with this operation. @@ -145,35 +117,22 @@ Response createOrUpdateWithResponse(String name, ScheduledActio * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse(String name, Context context); + Response runWithResponse(String name, Context context); /** - * Delete a private scheduled action. + * Processes a private scheduled action. * * @param name Scheduled action name. * @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 name); + void run(String name); /** * Get the shared scheduled action from the given scope by name. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -186,20 +145,7 @@ Response createOrUpdateWithResponse(String name, ScheduledActio /** * Get the shared scheduled action from the given scope by name. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -211,20 +157,7 @@ Response createOrUpdateWithResponse(String name, ScheduledActio /** * Delete a scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -237,20 +170,7 @@ Response createOrUpdateWithResponse(String name, ScheduledActio /** * Delete a scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -259,44 +179,33 @@ Response createOrUpdateWithResponse(String name, ScheduledActio void deleteByScope(String scope, String name); /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. - * @param context The context to associate with this operation. + * @param scope undefined. * @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 Response}. + * @return scheduled actions list result as paginated response with {@link PagedIterable}. */ - Response runWithResponse(String name, Context context); + PagedIterable listByScope(String scope); /** - * Processes a private scheduled action. + * List all shared scheduled actions within the given scope. * - * @param name Scheduled action name. + * @param scope undefined. + * @param filter May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. + * @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 scheduled actions list result as paginated response with {@link PagedIterable}. */ - void run(String name); + PagedIterable listByScope(String scope, String filter, Context context); /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -309,20 +218,7 @@ Response createOrUpdateWithResponse(String name, ScheduledActio /** * Runs a shared scheduled action within the given scope. * - * @param scope The scope associated with scheduled action operations. This includes - * 'subscriptions/{subscriptionId}' for subscription scope, - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' - * for External Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription - * scope. Note: Insight Alerts are only available on subscription scope. + * @param scope undefined. * @param name Scheduled action name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -333,7 +229,7 @@ Response createOrUpdateWithResponse(String name, ScheduledActio /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. @@ -346,7 +242,7 @@ Response createOrUpdateWithResponse(String name, ScheduledActio /** * Checks availability and correctness of the name for a scheduled action. * - * @param checkNameAvailabilityRequest Scheduled action to be created or updated. + * @param checkNameAvailabilityRequest The request body. * @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. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Scope.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Scope.java index 9f8101ca1b8a..ad03ad7ea532 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Scope.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Scope.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,15 +12,20 @@ */ public final class Scope extends ExpandableStringEnum { /** - * Static value Single for Scope. + * Single scope recommendation. */ public static final Scope SINGLE = fromString("Single"); /** - * Static value Shared for Scope. + * Shared scope recommendation. */ public static final Scope SHARED = fromString("Shared"); + /** + * Management group scope recommendation. + */ + public static final Scope MANAGEMENT_GROUP = fromString("ManagementGroup"); + /** * Creates a new instance of Scope value. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Setting.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Setting.java new file mode 100644 index 000000000000..fe2aef15e552 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Setting.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; + +/** + * An immutable client-side representation of Setting. + */ +public interface Setting { + /** + * 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 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. + */ + SettingsKind kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.SettingInner object. + * + * @return the inner object. + */ + SettingInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingType.java new file mode 100644 index 000000000000..dd416dad651a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for SettingType. + */ +public final class SettingType extends ExpandableStringEnum { + /** + * This setting applies billing profile, invoice section, subscription and resource group tags to current month's + * usage data of child resources. + */ + public static final SettingType TAGINHERITANCE = fromString("taginheritance"); + + /** + * Creates a new instance of SettingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingType() { + } + + /** + * Creates or finds a SettingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingType. + */ + public static SettingType fromString(String name) { + return fromString(name, SettingType.class); + } + + /** + * Gets known SettingType values. + * + * @return known SettingType values. + */ + public static Collection values() { + return values(SettingType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Settings.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Settings.java new file mode 100644 index 000000000000..a109a932cb0f --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Settings.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; + +/** + * Resource collection API of Settings. + */ +public interface Settings { + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name along with {@link Response}. + */ + Response getByScopeWithResponse(String scope, SettingType type, Context context); + + /** + * Get the setting from the given scope by name. + * + * @param scope undefined. + * @param type Setting type. + * @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 setting from the given scope by name. + */ + Setting getByScope(String scope, SettingType type); + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition along with {@link Response}. + */ + Response createOrUpdateByScopeWithResponse(String scope, SettingType type, SettingInner setting, + Context context); + + /** + * Create or update a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @param setting Setting to be created or updated. + * @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 setting definition. + */ + Setting createOrUpdateByScope(String scope, SettingType type, SettingInner setting); + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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 Response}. + */ + Response deleteByScopeWithResponse(String scope, SettingType type, Context context); + + /** + * Delete a setting within the given scope. + * + * @param scope undefined. + * @param type Setting type. + * @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 deleteByScope(String scope, SettingType type); + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result along with {@link Response}. + */ + Response listWithResponse(String scope, Context context); + + /** + * List all cost management settings in the requested scope. + * + * @param scope undefined. + * @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 setting list result. + */ + SettingsListResult list(String scope); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsKind.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsKind.java new file mode 100644 index 000000000000..4eb739c63b5f --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the kind of settings. + */ +public final class SettingsKind extends ExpandableStringEnum { + /** + * Static value taginheritance for SettingsKind. + */ + public static final SettingsKind TAGINHERITANCE = fromString("taginheritance"); + + /** + * Creates a new instance of SettingsKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingsKind() { + } + + /** + * Creates or finds a SettingsKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingsKind. + */ + public static SettingsKind fromString(String name) { + return fromString(name, SettingsKind.class); + } + + /** + * Gets known SettingsKind values. + * + * @return known SettingsKind values. + */ + public static Collection values() { + return values(SettingsKind.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsListResult.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsListResult.java new file mode 100644 index 000000000000..23bdd4619a0b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsListResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of SettingsListResult. + */ +public interface SettingsListResult { + /** + * Gets the value property: The list of settings. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner object. + * + * @return the inner object. + */ + SettingsListResultInner innerModel(); +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SharedScopeBenefitRecommendationProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SharedScopeBenefitRecommendationProperties.java index dedfd052e34b..0f7dddaf4e6f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SharedScopeBenefitRecommendationProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SharedScopeBenefitRecommendationProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of the benefit recommendation when scope is 'Shared'. */ -@Fluent +@Immutable public final class SharedScopeBenefitRecommendationProperties extends BenefitRecommendationProperties { /* * Benefit scope. For example, Single or Shared. @@ -25,7 +25,7 @@ public final class SharedScopeBenefitRecommendationProperties extends BenefitRec /** * Creates an instance of SharedScopeBenefitRecommendationProperties class. */ - public SharedScopeBenefitRecommendationProperties() { + private SharedScopeBenefitRecommendationProperties() { } /** @@ -38,70 +38,6 @@ public Scope scope() { return this.scope; } - /** - * {@inheritDoc} - */ - @Override - public SharedScopeBenefitRecommendationProperties withLookBackPeriod(LookBackPeriod lookBackPeriod) { - super.withLookBackPeriod(lookBackPeriod); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SharedScopeBenefitRecommendationProperties withUsage(RecommendationUsageDetails usage) { - super.withUsage(usage); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SharedScopeBenefitRecommendationProperties withTerm(Term term) { - super.withTerm(term); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SharedScopeBenefitRecommendationProperties withCommitmentGranularity(Grain commitmentGranularity) { - super.withCommitmentGranularity(commitmentGranularity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SharedScopeBenefitRecommendationProperties - withRecommendationDetails(AllSavingsBenefitDetails recommendationDetails) { - super.withRecommendationDetails(recommendationDetails); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (usage() != null) { - usage().validate(); - } - if (recommendationDetails() != null) { - recommendationDetails().validate(); - } - if (allRecommendationDetails() != null) { - allRecommendationDetails().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SingleScopeBenefitRecommendationProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SingleScopeBenefitRecommendationProperties.java index 47cb768dbd98..de08fc242d28 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SingleScopeBenefitRecommendationProperties.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SingleScopeBenefitRecommendationProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of the benefit recommendations when scope is 'Single'. */ -@Fluent +@Immutable public final class SingleScopeBenefitRecommendationProperties extends BenefitRecommendationProperties { /* * Benefit scope. For example, Single or Shared. @@ -37,7 +37,7 @@ public final class SingleScopeBenefitRecommendationProperties extends BenefitRec /** * Creates an instance of SingleScopeBenefitRecommendationProperties class. */ - public SingleScopeBenefitRecommendationProperties() { + private SingleScopeBenefitRecommendationProperties() { } /** @@ -70,70 +70,6 @@ public String resourceGroup() { return this.resourceGroup; } - /** - * {@inheritDoc} - */ - @Override - public SingleScopeBenefitRecommendationProperties withLookBackPeriod(LookBackPeriod lookBackPeriod) { - super.withLookBackPeriod(lookBackPeriod); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SingleScopeBenefitRecommendationProperties withUsage(RecommendationUsageDetails usage) { - super.withUsage(usage); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SingleScopeBenefitRecommendationProperties withTerm(Term term) { - super.withTerm(term); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SingleScopeBenefitRecommendationProperties withCommitmentGranularity(Grain commitmentGranularity) { - super.withCommitmentGranularity(commitmentGranularity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SingleScopeBenefitRecommendationProperties - withRecommendationDetails(AllSavingsBenefitDetails recommendationDetails) { - super.withRecommendationDetails(recommendationDetails); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (usage() != null) { - usage().validate(); - } - if (recommendationDetails() != null) { - recommendationDetails().validate(); - } - if (allRecommendationDetails() != null) { - allRecommendationDetails().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SourceCostAllocationResource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SourceCostAllocationResource.java new file mode 100644 index 000000000000..e867c167fcd2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SourceCostAllocationResource.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source resources for cost allocation. + */ +@Fluent +public final class SourceCostAllocationResource extends CostAllocationResource { + /* + * Source Resources for cost allocation. This list cannot contain more than 25 values. + */ + private List values; + + /** + * Creates an instance of SourceCostAllocationResource class. + */ + public SourceCostAllocationResource() { + } + + /** + * Get the values property: Source Resources for cost allocation. This list cannot contain more than 25 values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Source Resources for cost allocation. This list cannot contain more than 25 values. + * + * @param values the values value to set. + * @return the SourceCostAllocationResource object itself. + */ + public SourceCostAllocationResource withValues(List values) { + this.values = values; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SourceCostAllocationResource withResourceType(CostAllocationResourceType resourceType) { + super.withResourceType(resourceType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SourceCostAllocationResource withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", resourceType() == null ? null : resourceType().toString()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceCostAllocationResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceCostAllocationResource 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 SourceCostAllocationResource. + */ + public static SourceCostAllocationResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceCostAllocationResource deserializedSourceCostAllocationResource = new SourceCostAllocationResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedSourceCostAllocationResource + .withResourceType(CostAllocationResourceType.fromString(reader.getString())); + } else if ("name".equals(fieldName)) { + deserializedSourceCostAllocationResource.withName(reader.getString()); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedSourceCostAllocationResource.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedSourceCostAllocationResource; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Status.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Status.java index 6c03ee3c39ee..db56ae9523ad 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Status.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Status.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The status of the long running operation. */ -@Fluent +@Immutable public final class Status implements JsonSerializable { /* * The status of the long running operation. @@ -24,7 +24,7 @@ public final class Status implements JsonSerializable { /** * Creates an instance of Status class. */ - public Status() { + private Status() { } /** @@ -36,25 +36,6 @@ public ReportOperationStatusType status() { return this.status; } - /** - * Set the status property: The status of the long running operation. - * - * @param status the status value to set. - * @return the Status object itself. - */ - public Status withStatus(ReportOperationStatusType status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/StatusType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/StatusType.java index ad3d8bb7030e..a4718aaa0158 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/StatusType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/StatusType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,7 +8,8 @@ import java.util.Collection; /** - * The status of the export's schedule. If 'Inactive', the export's schedule is paused. + * The status of the export's schedule. If 'Inactive', the export's schedule is paused. To enable export set the status + * to be Active and then make a PUT request. */ public final class StatusType extends ExpandableStringEnum { /** diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentity.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentity.java new file mode 100644 index 000000000000..76f2e4de8f6c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentity.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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; + +/** + * Managed service identity (either system assigned, or none). + */ +@Fluent +public final class SystemAssignedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private SystemAssignedServiceIdentityType type; + + /** + * Creates an instance of SystemAssignedServiceIdentity class. + */ + public SystemAssignedServiceIdentity() { + } + + /** + * 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 String 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 String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public SystemAssignedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the SystemAssignedServiceIdentity object itself. + */ + public SystemAssignedServiceIdentity withType(SystemAssignedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemAssignedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemAssignedServiceIdentity 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 SystemAssignedServiceIdentity. + */ + public static SystemAssignedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemAssignedServiceIdentity deserializedSystemAssignedServiceIdentity + = new SystemAssignedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSystemAssignedServiceIdentity.type + = SystemAssignedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedSystemAssignedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedSystemAssignedServiceIdentity.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSystemAssignedServiceIdentity; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentityType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentityType.java new file mode 100644 index 000000000000..3c48a9a950d0 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentityType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (either system assigned, or none). + */ +public final class SystemAssignedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed system identity. + */ + public static final SystemAssignedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed system identity. + */ + public static final SystemAssignedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Creates a new instance of SystemAssignedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SystemAssignedServiceIdentityType() { + } + + /** + * Creates or finds a SystemAssignedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SystemAssignedServiceIdentityType. + */ + public static SystemAssignedServiceIdentityType fromString(String name) { + return fromString(name, SystemAssignedServiceIdentityType.class); + } + + /** + * Gets known SystemAssignedServiceIdentityType values. + * + * @return known SystemAssignedServiceIdentityType values. + */ + public static Collection values() { + return values(SystemAssignedServiceIdentityType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceProperties.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceProperties.java new file mode 100644 index 000000000000..67b6d85c3dd0 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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 properties of the tag inheritance setting. + */ +@Fluent +public final class TagInheritanceProperties implements JsonSerializable { + /* + * This property defines the behavior when an inherited tag being applied matches a lower scope tag (Eg. + * Subscription tag matches the resource tag). If set to true - when tags match, the highest scope tags will be + * applied. Billing profile is the highest scope, followed by invoice sections, subscriptions and resource groups + * (allows overriding of lower scope tag values). If set to false - when tags match, the lowest scope tags will be + * applied. So, if a resource has the same tag as a subscription tag, the resource tag will be applied (does not + * allow overriding of lower scope tag values). + */ + private boolean preferContainerTags; + + /** + * Creates an instance of TagInheritanceProperties class. + */ + public TagInheritanceProperties() { + } + + /** + * Get the preferContainerTags property: This property defines the behavior when an inherited tag being applied + * matches a lower scope tag (Eg. Subscription tag matches the resource tag). If set to true - when tags match, the + * highest scope tags will be applied. Billing profile is the highest scope, followed by invoice sections, + * subscriptions and resource groups (allows overriding of lower scope tag values). If set to false - when tags + * match, the lowest scope tags will be applied. So, if a resource has the same tag as a subscription tag, the + * resource tag will be applied (does not allow overriding of lower scope tag values). + * + * @return the preferContainerTags value. + */ + public boolean preferContainerTags() { + return this.preferContainerTags; + } + + /** + * Set the preferContainerTags property: This property defines the behavior when an inherited tag being applied + * matches a lower scope tag (Eg. Subscription tag matches the resource tag). If set to true - when tags match, the + * highest scope tags will be applied. Billing profile is the highest scope, followed by invoice sections, + * subscriptions and resource groups (allows overriding of lower scope tag values). If set to false - when tags + * match, the lowest scope tags will be applied. So, if a resource has the same tag as a subscription tag, the + * resource tag will be applied (does not allow overriding of lower scope tag values). + * + * @param preferContainerTags the preferContainerTags value to set. + * @return the TagInheritanceProperties object itself. + */ + public TagInheritanceProperties withPreferContainerTags(boolean preferContainerTags) { + this.preferContainerTags = preferContainerTags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("preferContainerTags", this.preferContainerTags); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagInheritanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagInheritanceProperties 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 TagInheritanceProperties. + */ + public static TagInheritanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagInheritanceProperties deserializedTagInheritanceProperties = new TagInheritanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("preferContainerTags".equals(fieldName)) { + deserializedTagInheritanceProperties.preferContainerTags = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagInheritanceProperties; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceSetting.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceSetting.java new file mode 100644 index 000000000000..f2d51cec085a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceSetting.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.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.costmanagement.fluent.models.SettingInner; +import java.io.IOException; + +/** + * Tag Inheritance Setting definition. + */ +@Fluent +public final class TagInheritanceSetting extends SettingInner { + /* + * 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 SettingsKind kind = SettingsKind.TAGINHERITANCE; + + /* + * The properties of the tag inheritance setting. + */ + private TagInheritanceProperties properties; + + /* + * 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 TagInheritanceSetting class. + */ + public TagInheritanceSetting() { + } + + /** + * 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. + */ + @Override + public SettingsKind kind() { + return this.kind; + } + + /** + * Get the properties property: The properties of the tag inheritance setting. + * + * @return the properties value. + */ + public TagInheritanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the tag inheritance setting. + * + * @param properties the properties value to set. + * @return the TagInheritanceSetting object itself. + */ + public TagInheritanceSetting withProperties(TagInheritanceProperties 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 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagInheritanceSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagInheritanceSetting 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 TagInheritanceSetting. + */ + public static TagInheritanceSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagInheritanceSetting deserializedTagInheritanceSetting = new TagInheritanceSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTagInheritanceSetting.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTagInheritanceSetting.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTagInheritanceSetting.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedTagInheritanceSetting.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedTagInheritanceSetting.kind = SettingsKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedTagInheritanceSetting.properties = TagInheritanceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTagInheritanceSetting; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TargetCostAllocationResource.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TargetCostAllocationResource.java new file mode 100644 index 000000000000..52a360f5a2bf --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TargetCostAllocationResource.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Target resources for cost allocation. + */ +@Fluent +public final class TargetCostAllocationResource extends CostAllocationResource { + /* + * Target resources for cost allocation. This list cannot contain more than 25 values. + */ + private List values; + + /* + * Method of cost allocation for the rule + */ + private CostAllocationPolicyType policyType; + + /** + * Creates an instance of TargetCostAllocationResource class. + */ + public TargetCostAllocationResource() { + } + + /** + * Get the values property: Target resources for cost allocation. This list cannot contain more than 25 values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Target resources for cost allocation. This list cannot contain more than 25 values. + * + * @param values the values value to set. + * @return the TargetCostAllocationResource object itself. + */ + public TargetCostAllocationResource withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the policyType property: Method of cost allocation for the rule. + * + * @return the policyType value. + */ + public CostAllocationPolicyType policyType() { + return this.policyType; + } + + /** + * Set the policyType property: Method of cost allocation for the rule. + * + * @param policyType the policyType value to set. + * @return the TargetCostAllocationResource object itself. + */ + public TargetCostAllocationResource withPolicyType(CostAllocationPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TargetCostAllocationResource withResourceType(CostAllocationResourceType resourceType) { + super.withResourceType(resourceType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TargetCostAllocationResource withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", resourceType() == null ? null : resourceType().toString()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetCostAllocationResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetCostAllocationResource 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 TargetCostAllocationResource. + */ + public static TargetCostAllocationResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetCostAllocationResource deserializedTargetCostAllocationResource = new TargetCostAllocationResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedTargetCostAllocationResource + .withResourceType(CostAllocationResourceType.fromString(reader.getString())); + } else if ("name".equals(fieldName)) { + deserializedTargetCostAllocationResource.withName(reader.getString()); + } else if ("values".equals(fieldName)) { + List values + = reader.readArray(reader1 -> CostAllocationProportion.fromJson(reader1)); + deserializedTargetCostAllocationResource.values = values; + } else if ("policyType".equals(fieldName)) { + deserializedTargetCostAllocationResource.policyType + = CostAllocationPolicyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetCostAllocationResource; + }); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Term.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Term.java index 020eb6189e26..0f23bdb50998 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Term.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Term.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -12,12 +12,12 @@ */ public final class Term extends ExpandableStringEnum { /** - * Static value P1Y for Term. + * Benefit term is 1 year. */ public static final Term P1Y = fromString("P1Y"); /** - * Static value P3Y for Term. + * Benefit term is 3 years. */ public static final Term P3Y = fromString("P3Y"); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ThresholdType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ThresholdType.java new file mode 100644 index 000000000000..3a44e24e22ca --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/ThresholdType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of threshold. + * + * Supported for CategoryType(s): Cost. + */ +public final class ThresholdType extends ExpandableStringEnum { + /** + * Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget. + */ + public static final ThresholdType ACTUAL = fromString("Actual"); + + /** + * Forecasted costs budget alerts provide advanced notification that your spending trends are likely to exceed your + * allocated budget, as it relies on forecasted cost predictions. + */ + public static final ThresholdType FORECASTED = fromString("Forecasted"); + + /** + * Creates a new instance of ThresholdType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThresholdType() { + } + + /** + * Creates or finds a ThresholdType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThresholdType. + */ + public static ThresholdType fromString(String name) { + return fromString(name, ThresholdType.class); + } + + /** + * Gets known ThresholdType values. + * + * @return known ThresholdType values. + */ + public static Collection values() { + return values(ThresholdType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeGrainType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeGrainType.java new file mode 100644 index 000000000000..56444b5f78e7 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeGrainType.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The time covered by a budget. Tracking of the amount will be reset based on the time grain. + * + * Supported for CategoryType(s): Cost, ReservationUtilization. + * + * Supported timeGrainTypes for **CategoryType: Cost** + * + * - Monthly + * - Quarterly + * - Annually + * - BillingMonth* + * - BillingQuarter* + * - BillingAnnual* + * + * *only supported for Web Direct customers. + * + * Supported timeGrainTypes for **CategoryType: ReservationUtilization** + * - Last7Days + * - Last30Days + * + * Required for CategoryType(s): Cost, ReservationUtilization. + */ +public final class TimeGrainType extends ExpandableStringEnum { + /** + * The budget will track costs in the current calendar month against the amount. + * + * Supported for CategoryType: Cost only. + */ + public static final TimeGrainType MONTHLY = fromString("Monthly"); + + /** + * The budget will track costs in the current calendar quarter against the amount. + * + * Supported for CategoryType: Cost only. + */ + public static final TimeGrainType QUARTERLY = fromString("Quarterly"); + + /** + * The budget will track costs in the current calendar year against the amount. + * + * Supported for CategoryType: Cost only. + */ + public static final TimeGrainType ANNUALLY = fromString("Annually"); + + /** + * The budget will track costs in the current billing month against the amount. + * + * Supported for CategoryType: Cost and Web Direct customers only. + */ + public static final TimeGrainType BILLING_MONTH = fromString("BillingMonth"); + + /** + * The budget will track costs in the current billing quarter against the amount. + * + * Supported for CategoryType: Cost and Web Direct customers only. + */ + public static final TimeGrainType BILLING_QUARTER = fromString("BillingQuarter"); + + /** + * The budget will track costs in the current billing year against the amount. + * + * Supported for CategoryType: Cost and Web Direct customers only. + */ + public static final TimeGrainType BILLING_ANNUAL = fromString("BillingAnnual"); + + /** + * The Reservation Utilization Alert Rule will evaluate reservations based on their 7-Day utilization percentage. + * + * Supported for CategoryType: ReservationUtilization only. + */ + public static final TimeGrainType LAST7DAYS = fromString("Last7Days"); + + /** + * The Reservation Utilization Alert Rule will evaluate reservations based on their 30-Day utilization percentage. + * + * Supported for CategoryType: ReservationUtilization only. + */ + public static final TimeGrainType LAST30DAYS = fromString("Last30Days"); + + /** + * Creates a new instance of TimeGrainType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TimeGrainType() { + } + + /** + * Creates or finds a TimeGrainType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeGrainType. + */ + public static TimeGrainType fromString(String name) { + return fromString(name, TimeGrainType.class); + } + + /** + * Gets known TimeGrainType values. + * + * @return known TimeGrainType values. + */ + public static Collection values() { + return values(TimeGrainType.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeframeType.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeframeType.java index 550d118751ac..dd16a1d07528 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeframeType.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/TimeframeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The time frame for pulling data for the query. If custom, then a specific time period must be provided. + * The time frame for pulling data for the export. If custom, then a specific time period must be provided. */ public final class TimeframeType extends ExpandableStringEnum { /** @@ -41,6 +41,11 @@ public final class TimeframeType extends ExpandableStringEnum { */ public static final TimeframeType CUSTOM = fromString("Custom"); + /** + * Static value TheCurrentMonth for TimeframeType. + */ + public static final TimeframeType THE_CURRENT_MONTH = fromString("TheCurrentMonth"); + /** * Creates a new instance of TimeframeType value. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/View.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/View.java index 3812867ff8b6..819fd55d1cd3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/View.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/View.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.costmanagement.fluent.models.ViewInner; import java.time.OffsetDateTime; @@ -42,6 +43,13 @@ public interface View { */ String etag(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the displayName property: User input name of the view. Required. * @@ -201,22 +209,7 @@ interface WithScopeStage { /** * Specifies scope. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' - * for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - * resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account - * scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for - * Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and - * 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External - * Subscription scope. + * @param scope undefined. * @return the next definition stage. */ WithCreate withExistingScope(String scope); @@ -226,12 +219,12 @@ interface WithScopeStage { * The stage of the View 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.WithEtag, DefinitionStages.WithDisplayName, DefinitionStages.WithScope, - DefinitionStages.WithDateRange, DefinitionStages.WithChart, DefinitionStages.WithAccumulated, - DefinitionStages.WithMetric, DefinitionStages.WithKpis, DefinitionStages.WithPivots, - DefinitionStages.WithTypePropertiesType, DefinitionStages.WithTimeframe, DefinitionStages.WithTimePeriod, - DefinitionStages.WithDataSet, DefinitionStages.WithIncludeMonetaryCommitment { + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithDisplayName, + DefinitionStages.WithScope, DefinitionStages.WithModifiedOn, DefinitionStages.WithDateRange, + DefinitionStages.WithChart, DefinitionStages.WithAccumulated, DefinitionStages.WithMetric, + DefinitionStages.WithKpis, DefinitionStages.WithPivots, DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTimeframe, DefinitionStages.WithTimePeriod, DefinitionStages.WithDataSet, + DefinitionStages.WithIncludeMonetaryCommitment { /** * Executes the create request. * @@ -320,6 +313,19 @@ interface WithScope { WithCreate withScope(String scope); } + /** + * The stage of the View definition allowing to specify modifiedOn. + */ + interface WithModifiedOn { + /** + * Specifies the modifiedOn property: Date when the user last modified this view.. + * + * @param modifiedOn Date when the user last modified this view. + * @return the next definition stage. + */ + WithCreate withModifiedOn(OffsetDateTime modifiedOn); + } + /** * The stage of the View definition allowing to specify dateRange. */ @@ -481,9 +487,10 @@ interface WithIncludeMonetaryCommitment { * The template for View update. */ interface Update extends UpdateStages.WithEtag, UpdateStages.WithDisplayName, UpdateStages.WithScope, - UpdateStages.WithDateRange, UpdateStages.WithChart, UpdateStages.WithAccumulated, UpdateStages.WithMetric, - UpdateStages.WithKpis, UpdateStages.WithPivots, UpdateStages.WithTypePropertiesType, UpdateStages.WithTimeframe, - UpdateStages.WithTimePeriod, UpdateStages.WithDataSet, UpdateStages.WithIncludeMonetaryCommitment { + UpdateStages.WithModifiedOn, UpdateStages.WithDateRange, UpdateStages.WithChart, UpdateStages.WithAccumulated, + UpdateStages.WithMetric, UpdateStages.WithKpis, UpdateStages.WithPivots, UpdateStages.WithTypePropertiesType, + UpdateStages.WithTimeframe, UpdateStages.WithTimePeriod, UpdateStages.WithDataSet, + UpdateStages.WithIncludeMonetaryCommitment { /** * Executes the update request. * @@ -576,6 +583,19 @@ interface WithScope { Update withScope(String scope); } + /** + * The stage of the View update allowing to specify modifiedOn. + */ + interface WithModifiedOn { + /** + * Specifies the modifiedOn property: Date when the user last modified this view.. + * + * @param modifiedOn Date when the user last modified this view. + * @return the next definition stage. + */ + Update withModifiedOn(OffsetDateTime modifiedOn); + } + /** * The stage of the View update allowing to specify dateRange. */ diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Views.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Views.java index ddadf97fa2e0..844561c187cc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Views.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/Views.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; @@ -13,73 +13,6 @@ * Resource collection API of Views. */ public interface Views { - /** - * Lists all views by tenant and object. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all views by tenant and object. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - PagedIterable listByScope(String scope); - - /** - * Lists all views at the given scope. - * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing views as paginated response with {@link PagedIterable}. - */ - PagedIterable listByScope(String scope, Context context); - /** * Gets the view by view name. * @@ -152,22 +85,30 @@ public interface Views { */ void delete(String viewName); + /** + * Lists all views by tenant and object. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all views by tenant and object. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -180,19 +121,7 @@ public interface Views { /** * Gets the view for the defined scope by view name. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -204,19 +133,7 @@ public interface Views { /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -229,19 +146,7 @@ public interface Views { /** * The operation to delete a view. * - * @param scope The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for - * subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for - * EnrollmentAccount scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group - * scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External - * Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' - * for External Subscription scope. + * @param scope undefined. * @param viewName View name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -249,6 +154,29 @@ public interface Views { */ void deleteByScope(String scope, String viewName); + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + PagedIterable listByScope(String scope); + + /** + * Lists all views at the given scope. + * + * @param scope undefined. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing views as paginated response with {@link PagedIterable}. + */ + PagedIterable listByScope(String scope, Context context); + /** * Gets the view for the defined scope by view name. * diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/WeeksOfMonth.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/WeeksOfMonth.java index 45899ebb103c..6baa18a47e9a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/WeeksOfMonth.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/WeeksOfMonth.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/package-info.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/package-info.java index f55b19d4a5a9..83c14e559269 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/package-info.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for CostManagementClient. + * Package containing the data models for CostManagement. * CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.costmanagement.models; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/package-info.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/package-info.java index 9e69f6851e37..e93db1a26a96 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/package-info.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for CostManagementClient. + * Package containing the classes for CostManagement. * CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.costmanagement; diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/module-info.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/module-info.java index 96dde84e5193..1ee12cc3fbb2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/module-info.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.costmanagement { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.costmanagement.fluent.models to com.azure.core; opens com.azure.resourcemanager.costmanagement.models to com.azure.core; + opens com.azure.resourcemanager.costmanagement.implementation.models to com.azure.core; } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/azure-resourcemanager-costmanagement_metadata.json b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/azure-resourcemanager-costmanagement_metadata.json new file mode 100644 index 000000000000..0e381d2a01ff --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/azure-resourcemanager-costmanagement_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.CostManagement":"2026-06-01"},"crossLanguagePackageId":"Microsoft.CostManagement","crossLanguageVersion":"79be238a3223","crossLanguageDefinitions":{"com.azure.resourcemanager.costmanagement.fluent.AlertsClient":"Microsoft.CostManagement.Alerts","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.dismiss":"Microsoft.CostManagement.Alerts.dismiss","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.dismissWithResponse":"Microsoft.CostManagement.Alerts.dismiss","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.get":"Microsoft.CostManagement.Alerts.get","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.getWithResponse":"Microsoft.CostManagement.Alerts.get","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.list":"Microsoft.CostManagement.Alerts.list","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.listExternal":"Microsoft.CostManagement.AlertsOperationGroup.listExternal","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.listExternalWithResponse":"Microsoft.CostManagement.AlertsOperationGroup.listExternal","com.azure.resourcemanager.costmanagement.fluent.AlertsClient.listWithResponse":"Microsoft.CostManagement.Alerts.list","com.azure.resourcemanager.costmanagement.fluent.BenefitRecommendationsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.BenefitRecommendationsClient.list":"Microsoft.CostManagement.BenefitRecommendationsOperationGroup.list","com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient.listByBillingAccountId":"Microsoft.CostManagement.BenefitUtilizationSummariesOperationGroup.listByBillingAccountId","com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient.listByBillingProfileId":"Microsoft.CostManagement.BenefitUtilizationSummariesOperationGroup.listByBillingProfileId","com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient.listBySavingsPlanId":"Microsoft.CostManagement.BenefitUtilizationSummariesOperationGroup.listBySavingsPlanId","com.azure.resourcemanager.costmanagement.fluent.BenefitUtilizationSummariesClient.listBySavingsPlanOrder":"Microsoft.CostManagement.BenefitUtilizationSummariesOperationGroup.listBySavingsPlanOrder","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient":"Microsoft.CostManagement.Budgets","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.createOrUpdate":"Microsoft.CostManagement.Budgets.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.createOrUpdateWithResponse":"Microsoft.CostManagement.Budgets.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.delete":"Microsoft.CostManagement.Budgets.delete","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.deleteWithResponse":"Microsoft.CostManagement.Budgets.delete","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.get":"Microsoft.CostManagement.Budgets.get","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.getWithResponse":"Microsoft.CostManagement.Budgets.get","com.azure.resourcemanager.costmanagement.fluent.BudgetsClient.list":"Microsoft.CostManagement.Budgets.list","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.checkNameAvailability":"Microsoft.CostManagement.CostAllocationRulesOperationGroup.checkNameAvailability","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.checkNameAvailabilityWithResponse":"Microsoft.CostManagement.CostAllocationRulesOperationGroup.checkNameAvailability","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.createOrUpdate":"Microsoft.CostManagement.CostAllocationRuleDefinitions.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.createOrUpdateWithResponse":"Microsoft.CostManagement.CostAllocationRuleDefinitions.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.delete":"Microsoft.CostManagement.CostAllocationRuleDefinitions.delete","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.deleteWithResponse":"Microsoft.CostManagement.CostAllocationRuleDefinitions.delete","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.get":"Microsoft.CostManagement.CostAllocationRuleDefinitions.get","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.getWithResponse":"Microsoft.CostManagement.CostAllocationRuleDefinitions.get","com.azure.resourcemanager.costmanagement.fluent.CostAllocationRulesClient.list":"Microsoft.CostManagement.CostAllocationRuleDefinitions.list","com.azure.resourcemanager.costmanagement.fluent.CostManagementManagementClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.DimensionsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.DimensionsClient.byExternalCloudProviderType":"Microsoft.CostManagement.DimensionsOperationGroup.byExternalCloudProviderType","com.azure.resourcemanager.costmanagement.fluent.DimensionsClient.list":"Microsoft.CostManagement.DimensionsOperationGroup.list","com.azure.resourcemanager.costmanagement.fluent.ExportsClient":"Microsoft.CostManagement.Exports","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.createOrUpdate":"Microsoft.CostManagement.Exports.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.createOrUpdateWithResponse":"Microsoft.CostManagement.Exports.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.delete":"Microsoft.CostManagement.Exports.delete","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.deleteWithResponse":"Microsoft.CostManagement.Exports.delete","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.execute":"Microsoft.CostManagement.Exports.execute","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.executeWithResponse":"Microsoft.CostManagement.Exports.execute","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.get":"Microsoft.CostManagement.Exports.get","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.getExecutionHistory":"Microsoft.CostManagement.Exports.getExecutionHistory","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.getExecutionHistoryWithResponse":"Microsoft.CostManagement.Exports.getExecutionHistory","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.getWithResponse":"Microsoft.CostManagement.Exports.get","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.list":"Microsoft.CostManagement.Exports.list","com.azure.resourcemanager.costmanagement.fluent.ExportsClient.listWithResponse":"Microsoft.CostManagement.Exports.list","com.azure.resourcemanager.costmanagement.fluent.ForecastsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.ForecastsClient.externalCloudProviderUsage":"Microsoft.CostManagement.ForecastOperationGroup.externalCloudProviderUsage","com.azure.resourcemanager.costmanagement.fluent.ForecastsClient.externalCloudProviderUsageWithResponse":"Microsoft.CostManagement.ForecastOperationGroup.externalCloudProviderUsage","com.azure.resourcemanager.costmanagement.fluent.ForecastsClient.usage":"Microsoft.CostManagement.ForecastOperationGroup.usage","com.azure.resourcemanager.costmanagement.fluent.ForecastsClient.usageWithResponse":"Microsoft.CostManagement.ForecastOperationGroup.usage","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.beginGenerateByBillingAccount":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByBillingAccount","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.beginGenerateByBillingProfile":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByBillingProfile","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.beginGenerateByReservationId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByReservationId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.beginGenerateByReservationOrderId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByReservationOrderId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.beginGenerateBySavingsPlanId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateBySavingsPlanId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.beginGenerateBySavingsPlanOrderId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateBySavingsPlanOrderId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.generateByBillingAccount":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByBillingAccount","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.generateByBillingProfile":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByBillingProfile","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.generateByReservationId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByReservationId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.generateByReservationOrderId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateByReservationOrderId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.generateBySavingsPlanId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateBySavingsPlanId","com.azure.resourcemanager.costmanagement.fluent.GenerateBenefitUtilizationSummariesReportsClient.generateBySavingsPlanOrderId":"Microsoft.CostManagement.GenerateBenefitUtilizationSummariesReportOperationGroup.generateBySavingsPlanOrderId","com.azure.resourcemanager.costmanagement.fluent.GenerateCostDetailsReportsClient":"Microsoft.CostManagement.GenerateCostDetailsReport","com.azure.resourcemanager.costmanagement.fluent.GenerateCostDetailsReportsClient.beginCreateOperation":"Microsoft.CostManagement.GenerateCostDetailsReportOperationGroup.createOperation","com.azure.resourcemanager.costmanagement.fluent.GenerateCostDetailsReportsClient.beginGetOperationResults":"Microsoft.CostManagement.GenerateCostDetailsReport.getOperationResults","com.azure.resourcemanager.costmanagement.fluent.GenerateCostDetailsReportsClient.createOperation":"Microsoft.CostManagement.GenerateCostDetailsReportOperationGroup.createOperation","com.azure.resourcemanager.costmanagement.fluent.GenerateCostDetailsReportsClient.getOperationResults":"Microsoft.CostManagement.GenerateCostDetailsReport.getOperationResults","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationResultsClient":"Microsoft.CostManagement.GenerateDetailedCostReportOperationResults","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationResultsClient.beginGet":"Microsoft.CostManagement.GenerateDetailedCostReportOperationResults.get","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationResultsClient.get":"Microsoft.CostManagement.GenerateDetailedCostReportOperationResults.get","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationStatusClient":"Microsoft.CostManagement.GenerateDetailedCostReportOperationStatus","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationStatusClient.get":"Microsoft.CostManagement.GenerateDetailedCostReportOperationStatus.get","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportOperationStatusClient.getWithResponse":"Microsoft.CostManagement.GenerateDetailedCostReportOperationStatus.get","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportsClient.beginCreateOperation":"Microsoft.CostManagement.GenerateDetailedCostReportOperationGroup.createOperation","com.azure.resourcemanager.costmanagement.fluent.GenerateDetailedCostReportsClient.createOperation":"Microsoft.CostManagement.GenerateDetailedCostReportOperationGroup.createOperation","com.azure.resourcemanager.costmanagement.fluent.GenerateReservationDetailsReportsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.GenerateReservationDetailsReportsClient.beginByBillingAccountId":"Microsoft.CostManagement.GenerateReservationDetailsReportOperationGroup.byBillingAccountId","com.azure.resourcemanager.costmanagement.fluent.GenerateReservationDetailsReportsClient.beginByBillingProfileId":"Microsoft.CostManagement.GenerateReservationDetailsReportOperationGroup.byBillingProfileId","com.azure.resourcemanager.costmanagement.fluent.GenerateReservationDetailsReportsClient.byBillingAccountId":"Microsoft.CostManagement.GenerateReservationDetailsReportOperationGroup.byBillingAccountId","com.azure.resourcemanager.costmanagement.fluent.GenerateReservationDetailsReportsClient.byBillingProfileId":"Microsoft.CostManagement.GenerateReservationDetailsReportOperationGroup.byBillingProfileId","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient":"Microsoft.CostManagement.MarkupRules","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.createOrUpdate":"Microsoft.CostManagement.MarkupRules.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.createOrUpdateWithResponse":"Microsoft.CostManagement.MarkupRules.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.delete":"Microsoft.CostManagement.MarkupRules.delete","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.deleteWithResponse":"Microsoft.CostManagement.MarkupRules.delete","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.get":"Microsoft.CostManagement.MarkupRules.get","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.getWithResponse":"Microsoft.CostManagement.MarkupRules.get","com.azure.resourcemanager.costmanagement.fluent.MarkupRulesClient.list":"Microsoft.CostManagement.MarkupRules.list","com.azure.resourcemanager.costmanagement.fluent.OperationsClient":"Microsoft.CostManagement.Operations","com.azure.resourcemanager.costmanagement.fluent.OperationsClient.list":"Azure.ResourceManager.Legacy.Operations.list","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient.beginDownloadByBillingAccount":"Microsoft.CostManagement.PriceSheetOperationGroup.downloadByBillingAccount","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient.beginDownloadByBillingProfile":"Microsoft.CostManagement.PriceSheetOperationGroup.downloadByBillingProfile","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient.beginDownloadByInvoice":"Microsoft.CostManagement.PriceSheetOperationGroup.downloadByInvoice","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient.downloadByBillingAccount":"Microsoft.CostManagement.PriceSheetOperationGroup.downloadByBillingAccount","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient.downloadByBillingProfile":"Microsoft.CostManagement.PriceSheetOperationGroup.downloadByBillingProfile","com.azure.resourcemanager.costmanagement.fluent.PriceSheetsClient.downloadByInvoice":"Microsoft.CostManagement.PriceSheetOperationGroup.downloadByInvoice","com.azure.resourcemanager.costmanagement.fluent.QueriesClient":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.fluent.QueriesClient.usage":"Microsoft.CostManagement.QueryOperationGroup.usage","com.azure.resourcemanager.costmanagement.fluent.QueriesClient.usageByExternalCloudProviderType":"Microsoft.CostManagement.QueryOperationGroup.usageByExternalCloudProviderType","com.azure.resourcemanager.costmanagement.fluent.QueriesClient.usageByExternalCloudProviderTypeWithResponse":"Microsoft.CostManagement.QueryOperationGroup.usageByExternalCloudProviderType","com.azure.resourcemanager.costmanagement.fluent.QueriesClient.usageWithResponse":"Microsoft.CostManagement.QueryOperationGroup.usage","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient":"Microsoft.CostManagement.ScheduledActions","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.checkNameAvailability":"Microsoft.CostManagement.ScheduledActionsOperationGroup.checkNameAvailability","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.checkNameAvailabilityByScope":"Microsoft.CostManagement.ScheduledActionsOperationGroup.checkNameAvailabilityByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.checkNameAvailabilityByScopeWithResponse":"Microsoft.CostManagement.ScheduledActionsOperationGroup.checkNameAvailabilityByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.checkNameAvailabilityWithResponse":"Microsoft.CostManagement.ScheduledActionsOperationGroup.checkNameAvailability","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.createOrUpdate":"Microsoft.CostManagement.ScheduledActions.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.createOrUpdateByScope":"Microsoft.CostManagement.ScheduledActionOperationGroup.createOrUpdateByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.createOrUpdateByScopeWithResponse":"Microsoft.CostManagement.ScheduledActionOperationGroup.createOrUpdateByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.createOrUpdateWithResponse":"Microsoft.CostManagement.ScheduledActions.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.delete":"Microsoft.CostManagement.ScheduledActions.delete","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.deleteByScope":"Microsoft.CostManagement.ScheduledActionOperationGroup.deleteByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.deleteByScopeWithResponse":"Microsoft.CostManagement.ScheduledActionOperationGroup.deleteByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.deleteWithResponse":"Microsoft.CostManagement.ScheduledActions.delete","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.get":"Microsoft.CostManagement.ScheduledActions.get","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.getByScope":"Microsoft.CostManagement.ScheduledActionOperationGroup.getByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.getByScopeWithResponse":"Microsoft.CostManagement.ScheduledActionOperationGroup.getByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.getWithResponse":"Microsoft.CostManagement.ScheduledActions.get","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.list":"Microsoft.CostManagement.ScheduledActions.list","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.listByScope":"Microsoft.CostManagement.ScheduledActionOperationGroup.listByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.run":"Microsoft.CostManagement.ScheduledActions.run","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.runByScope":"Microsoft.CostManagement.ScheduledActionOperationGroup.runByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.runByScopeWithResponse":"Microsoft.CostManagement.ScheduledActionOperationGroup.runByScope","com.azure.resourcemanager.costmanagement.fluent.ScheduledActionsClient.runWithResponse":"Microsoft.CostManagement.ScheduledActions.run","com.azure.resourcemanager.costmanagement.fluent.SettingsClient":"Microsoft.CostManagement.Settings","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.createOrUpdateByScope":"Microsoft.CostManagement.Settings.createOrUpdateByScope","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.createOrUpdateByScopeWithResponse":"Microsoft.CostManagement.Settings.createOrUpdateByScope","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.deleteByScope":"Microsoft.CostManagement.Settings.deleteByScope","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.deleteByScopeWithResponse":"Microsoft.CostManagement.Settings.deleteByScope","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.getByScope":"Microsoft.CostManagement.Settings.getByScope","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.getByScopeWithResponse":"Microsoft.CostManagement.Settings.getByScope","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.list":"Microsoft.CostManagement.Settings.list","com.azure.resourcemanager.costmanagement.fluent.SettingsClient.listWithResponse":"Microsoft.CostManagement.Settings.list","com.azure.resourcemanager.costmanagement.fluent.ViewsClient":"Microsoft.CostManagement.Views","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.createOrUpdate":"Microsoft.CostManagement.Views.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.createOrUpdateByScope":"Microsoft.CostManagement.ViewOperationGroup.createOrUpdateByScope","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.createOrUpdateByScopeWithResponse":"Microsoft.CostManagement.ViewOperationGroup.createOrUpdateByScope","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.createOrUpdateWithResponse":"Microsoft.CostManagement.Views.createOrUpdate","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.delete":"Microsoft.CostManagement.Views.delete","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.deleteByScope":"Microsoft.CostManagement.ViewOperationGroup.deleteByScope","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.deleteByScopeWithResponse":"Microsoft.CostManagement.ViewOperationGroup.deleteByScope","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.deleteWithResponse":"Microsoft.CostManagement.Views.delete","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.get":"Microsoft.CostManagement.Views.get","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.getByScope":"Microsoft.CostManagement.ViewOperationGroup.getByScope","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.getByScopeWithResponse":"Microsoft.CostManagement.ViewOperationGroup.getByScope","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.getWithResponse":"Microsoft.CostManagement.Views.get","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.list":"Microsoft.CostManagement.Views.list","com.azure.resourcemanager.costmanagement.fluent.ViewsClient.listByScope":"Microsoft.CostManagement.ViewOperationGroup.listByScope","com.azure.resourcemanager.costmanagement.fluent.models.AlertInner":"Microsoft.CostManagement.Alert","com.azure.resourcemanager.costmanagement.fluent.models.AlertProperties":"Microsoft.CostManagement.AlertProperties","com.azure.resourcemanager.costmanagement.fluent.models.AlertsResultInner":"Microsoft.CostManagement.AlertsResult","com.azure.resourcemanager.costmanagement.fluent.models.BenefitRecommendationModelInner":"Microsoft.CostManagement.BenefitRecommendationModel","com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner":"Microsoft.CostManagement.BenefitUtilizationSummariesOperationStatus","com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummaryInner":"Microsoft.CostManagement.BenefitUtilizationSummary","com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner":"Microsoft.CostManagement.Budget","com.azure.resourcemanager.costmanagement.fluent.models.BudgetProperties":"Microsoft.CostManagement.BudgetProperties","com.azure.resourcemanager.costmanagement.fluent.models.CheckNameAvailabilityResponseInner":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse","com.azure.resourcemanager.costmanagement.fluent.models.CommonExportPropertiesInner":"Microsoft.CostManagement.CommonExportProperties","com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner":"Microsoft.CostManagement.CostAllocationRuleCheckNameAvailabilityResponse","com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner":"Microsoft.CostManagement.CostAllocationRuleDefinition","com.azure.resourcemanager.costmanagement.fluent.models.CostDetailsOperationResultsInner":"Microsoft.CostManagement.CostDetailsOperationResults","com.azure.resourcemanager.costmanagement.fluent.models.CostManagementOperationInner":"Microsoft.CostManagement.CostManagementOperation","com.azure.resourcemanager.costmanagement.fluent.models.DimensionInner":"Microsoft.CostManagement.Dimension","com.azure.resourcemanager.costmanagement.fluent.models.DimensionProperties":"Microsoft.CostManagement.DimensionProperties","com.azure.resourcemanager.costmanagement.fluent.models.DownloadUrlInner":"Microsoft.CostManagement.DownloadURL","com.azure.resourcemanager.costmanagement.fluent.models.ExportExecutionListResultInner":"Microsoft.CostManagement.ExportExecutionListResult","com.azure.resourcemanager.costmanagement.fluent.models.ExportInner":"Microsoft.CostManagement.Export","com.azure.resourcemanager.costmanagement.fluent.models.ExportListResultInner":"Microsoft.CostManagement.ExportListResult","com.azure.resourcemanager.costmanagement.fluent.models.ExportProperties":"Microsoft.CostManagement.ExportProperties","com.azure.resourcemanager.costmanagement.fluent.models.ExportRunInner":"Microsoft.CostManagement.ExportRun","com.azure.resourcemanager.costmanagement.fluent.models.ExportRunPropertiesInner":"Microsoft.CostManagement.ExportRunProperties","com.azure.resourcemanager.costmanagement.fluent.models.ForecastProperties":"Microsoft.CostManagement.ForecastProperties","com.azure.resourcemanager.costmanagement.fluent.models.ForecastResultInner":"Microsoft.CostManagement.ForecastResult","com.azure.resourcemanager.costmanagement.fluent.models.GenerateDetailedCostReportOperationResultInner":"Microsoft.CostManagement.GenerateDetailedCostReportOperationResult","com.azure.resourcemanager.costmanagement.fluent.models.GenerateDetailedCostReportOperationStatusesInner":"Microsoft.CostManagement.GenerateDetailedCostReportOperationStatuses","com.azure.resourcemanager.costmanagement.fluent.models.IncludedQuantityUtilizationSummaryProperties":"Microsoft.CostManagement.IncludedQuantityUtilizationSummaryProperties","com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner":"Microsoft.CostManagement.MarkupRule","com.azure.resourcemanager.costmanagement.fluent.models.OperationStatusInner":"Microsoft.CostManagement.OperationStatus","com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner":"Microsoft.CostManagement.PricesheetDownloadProperties","com.azure.resourcemanager.costmanagement.fluent.models.QueryProperties":"Microsoft.CostManagement.QueryProperties","com.azure.resourcemanager.costmanagement.fluent.models.QueryResultInner":"Microsoft.CostManagement.QueryResult","com.azure.resourcemanager.costmanagement.fluent.models.ReportConfigDefinition":"Microsoft.CostManagement.ReportConfigDefinition","com.azure.resourcemanager.costmanagement.fluent.models.ReportManifest":"Microsoft.CostManagement.ReportManifest","com.azure.resourcemanager.costmanagement.fluent.models.ReportUrl":"Microsoft.CostManagement.ReportURL","com.azure.resourcemanager.costmanagement.fluent.models.RequestContext":"Microsoft.CostManagement.RequestContext","com.azure.resourcemanager.costmanagement.fluent.models.SavingsPlanUtilizationSummaryProperties":"Microsoft.CostManagement.SavingsPlanUtilizationSummaryProperties","com.azure.resourcemanager.costmanagement.fluent.models.ScheduledActionInner":"Microsoft.CostManagement.ScheduledAction","com.azure.resourcemanager.costmanagement.fluent.models.ScheduledActionProperties":"Microsoft.CostManagement.ScheduledActionProperties","com.azure.resourcemanager.costmanagement.fluent.models.SettingInner":"Microsoft.CostManagement.Setting","com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner":"Microsoft.CostManagement.SettingsListResult","com.azure.resourcemanager.costmanagement.fluent.models.ViewInner":"Microsoft.CostManagement.View","com.azure.resourcemanager.costmanagement.fluent.models.ViewProperties":"Microsoft.CostManagement.ViewProperties","com.azure.resourcemanager.costmanagement.implementation.CostManagementManagementClientBuilder":"Microsoft.CostManagement","com.azure.resourcemanager.costmanagement.implementation.models.BenefitRecommendationsListResult":"Microsoft.CostManagement.benefitRecommendationsListResult","com.azure.resourcemanager.costmanagement.implementation.models.BenefitUtilizationSummariesListResult":"Microsoft.CostManagement.BenefitUtilizationSummariesListResult","com.azure.resourcemanager.costmanagement.implementation.models.BudgetsListResult":"Microsoft.CostManagement.BudgetsListResult","com.azure.resourcemanager.costmanagement.implementation.models.CostAllocationRuleList":"Microsoft.CostManagement.CostAllocationRuleList","com.azure.resourcemanager.costmanagement.implementation.models.DimensionsListResult":"Microsoft.CostManagement.DimensionsListResult","com.azure.resourcemanager.costmanagement.implementation.models.MarkupRulePagedResponse":"Microsoft.CostManagement.MarkupRulePagedResponse","com.azure.resourcemanager.costmanagement.implementation.models.OperationListResult":"Microsoft.CostManagement.OperationListResult","com.azure.resourcemanager.costmanagement.implementation.models.ScheduledActionListResult":"Microsoft.CostManagement.ScheduledActionListResult","com.azure.resourcemanager.costmanagement.implementation.models.ViewListResult":"Microsoft.CostManagement.ViewListResult","com.azure.resourcemanager.costmanagement.models.AccumulatedType":"Microsoft.CostManagement.AccumulatedType","com.azure.resourcemanager.costmanagement.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.costmanagement.models.AlertCategory":"Microsoft.CostManagement.AlertCategory","com.azure.resourcemanager.costmanagement.models.AlertCriteria":"Microsoft.CostManagement.AlertCriteria","com.azure.resourcemanager.costmanagement.models.AlertOperator":"Microsoft.CostManagement.AlertOperator","com.azure.resourcemanager.costmanagement.models.AlertPropertiesDefinition":"Microsoft.CostManagement.AlertPropertiesDefinition","com.azure.resourcemanager.costmanagement.models.AlertPropertiesDetails":"Microsoft.CostManagement.AlertPropertiesDetails","com.azure.resourcemanager.costmanagement.models.AlertSource":"Microsoft.CostManagement.AlertSource","com.azure.resourcemanager.costmanagement.models.AlertStatus":"Microsoft.CostManagement.AlertStatus","com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType":"Microsoft.CostManagement.AlertTimeGrainType","com.azure.resourcemanager.costmanagement.models.AlertType":"Microsoft.CostManagement.AlertType","com.azure.resourcemanager.costmanagement.models.AllSavingsBenefitDetails":"Microsoft.CostManagement.AllSavingsBenefitDetails","com.azure.resourcemanager.costmanagement.models.AllSavingsList":"Microsoft.CostManagement.AllSavingsList","com.azure.resourcemanager.costmanagement.models.AsyncOperationStatusProperties":"Microsoft.CostManagement.AsyncOperationStatusProperties","com.azure.resourcemanager.costmanagement.models.BenefitKind":"Microsoft.CostManagement.BenefitKind","com.azure.resourcemanager.costmanagement.models.BenefitRecommendationProperties":"Microsoft.CostManagement.BenefitRecommendationProperties","com.azure.resourcemanager.costmanagement.models.BenefitResource":"Microsoft.CostManagement.BenefitResource","com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest":"Microsoft.CostManagement.BenefitUtilizationSummariesRequest","com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryProperties":"Microsoft.CostManagement.BenefitUtilizationSummaryProperties","com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema":"Microsoft.CostManagement.BenefitUtilizationSummaryReportSchema","com.azure.resourcemanager.costmanagement.models.BlobInfo":"Microsoft.CostManagement.BlobInfo","com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression":"Microsoft.CostManagement.BudgetComparisonExpression","com.azure.resourcemanager.costmanagement.models.BudgetFilter":"Microsoft.CostManagement.BudgetFilter","com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties":"Microsoft.CostManagement.BudgetFilterProperties","com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType":"Microsoft.CostManagement.BudgetNotificationOperatorType","com.azure.resourcemanager.costmanagement.models.BudgetOperatorType":"Microsoft.CostManagement.BudgetOperatorType","com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod":"Microsoft.CostManagement.BudgetTimePeriod","com.azure.resourcemanager.costmanagement.models.CategoryType":"Microsoft.CostManagement.CategoryType","com.azure.resourcemanager.costmanagement.models.ChartType":"Microsoft.CostManagement.ChartType","com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityReason":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason","com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityRequest":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest","com.azure.resourcemanager.costmanagement.models.CompressionModeType":"Microsoft.CostManagement.CompressionModeType","com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType":"Microsoft.CostManagement.CostAllocationPolicyType","com.azure.resourcemanager.costmanagement.models.CostAllocationProportion":"Microsoft.CostManagement.CostAllocationProportion","com.azure.resourcemanager.costmanagement.models.CostAllocationResource":"Microsoft.CostManagement.CostAllocationResource","com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType":"Microsoft.CostManagement.CostAllocationResourceType","com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest":"Microsoft.CostManagement.CostAllocationRuleCheckNameAvailabilityRequest","com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails":"Microsoft.CostManagement.CostAllocationRuleDetails","com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties":"Microsoft.CostManagement.CostAllocationRuleProperties","com.azure.resourcemanager.costmanagement.models.CostDetailsDataFormat":"Microsoft.CostManagement.CostDetailsDataFormat","com.azure.resourcemanager.costmanagement.models.CostDetailsMetricType":"Microsoft.CostManagement.CostDetailsMetricType","com.azure.resourcemanager.costmanagement.models.CostDetailsStatusType":"Microsoft.CostManagement.CostDetailsStatusType","com.azure.resourcemanager.costmanagement.models.CostDetailsTimePeriod":"Microsoft.CostManagement.CostDetailsTimePeriod","com.azure.resourcemanager.costmanagement.models.CostManagementProxyResource":"Microsoft.CostManagement.CostManagementProxyResource","com.azure.resourcemanager.costmanagement.models.CostManagementResource":"Microsoft.CostManagement.CostManagementResource","com.azure.resourcemanager.costmanagement.models.CultureCode":"Microsoft.CostManagement.CultureCode","com.azure.resourcemanager.costmanagement.models.CurrentSpend":"Microsoft.CostManagement.CurrentSpend","com.azure.resourcemanager.costmanagement.models.CustomerMetadata":"Microsoft.CostManagement.CustomerMetadata","com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType":"Microsoft.CostManagement.DataOverwriteBehaviorType","com.azure.resourcemanager.costmanagement.models.DaysOfWeek":"Microsoft.CostManagement.DaysOfWeek","com.azure.resourcemanager.costmanagement.models.DestinationType":"Microsoft.CostManagement.DestinationType","com.azure.resourcemanager.costmanagement.models.DismissAlertPayload":"Microsoft.CostManagement.DismissAlertPayload","com.azure.resourcemanager.costmanagement.models.ExecutionStatus":"Microsoft.CostManagement.ExecutionStatus","com.azure.resourcemanager.costmanagement.models.ExecutionType":"Microsoft.CostManagement.ExecutionType","com.azure.resourcemanager.costmanagement.models.ExportDataset":"Microsoft.CostManagement.ExportDataset","com.azure.resourcemanager.costmanagement.models.ExportDatasetConfiguration":"Microsoft.CostManagement.ExportDatasetConfiguration","com.azure.resourcemanager.costmanagement.models.ExportDefinition":"Microsoft.CostManagement.ExportDefinition","com.azure.resourcemanager.costmanagement.models.ExportDeliveryDestination":"Microsoft.CostManagement.ExportDeliveryDestination","com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo":"Microsoft.CostManagement.ExportDeliveryInfo","com.azure.resourcemanager.costmanagement.models.ExportRecurrencePeriod":"Microsoft.CostManagement.ExportRecurrencePeriod","com.azure.resourcemanager.costmanagement.models.ExportRunRequest":"Microsoft.CostManagement.ExportRunRequest","com.azure.resourcemanager.costmanagement.models.ExportSchedule":"Microsoft.CostManagement.ExportSchedule","com.azure.resourcemanager.costmanagement.models.ExportSuspensionContext":"Microsoft.CostManagement.ExportSuspensionContext","com.azure.resourcemanager.costmanagement.models.ExportTimePeriod":"Microsoft.CostManagement.ExportTimePeriod","com.azure.resourcemanager.costmanagement.models.ExportType":"Microsoft.CostManagement.ExportType","com.azure.resourcemanager.costmanagement.models.ExternalCloudProviderType":"Microsoft.CostManagement.ExternalCloudProviderType","com.azure.resourcemanager.costmanagement.models.FileDestination":"Microsoft.CostManagement.FileDestination","com.azure.resourcemanager.costmanagement.models.FileFormat":"Microsoft.CostManagement.FileFormat","com.azure.resourcemanager.costmanagement.models.FilterItemNames":"Microsoft.CostManagement.FilterItemNames","com.azure.resourcemanager.costmanagement.models.FilterItems":"Microsoft.CostManagement.FilterItems","com.azure.resourcemanager.costmanagement.models.ForecastAggregation":"Microsoft.CostManagement.ForecastAggregation","com.azure.resourcemanager.costmanagement.models.ForecastColumn":"Microsoft.CostManagement.ForecastColumn","com.azure.resourcemanager.costmanagement.models.ForecastComparisonExpression":"Microsoft.CostManagement.ForecastComparisonExpression","com.azure.resourcemanager.costmanagement.models.ForecastDataset":"Microsoft.CostManagement.ForecastDataset","com.azure.resourcemanager.costmanagement.models.ForecastDatasetConfiguration":"Microsoft.CostManagement.ForecastDatasetConfiguration","com.azure.resourcemanager.costmanagement.models.ForecastDefinition":"Microsoft.CostManagement.ForecastDefinition","com.azure.resourcemanager.costmanagement.models.ForecastFilter":"Microsoft.CostManagement.ForecastFilter","com.azure.resourcemanager.costmanagement.models.ForecastOperatorType":"Microsoft.CostManagement.ForecastOperatorType","com.azure.resourcemanager.costmanagement.models.ForecastSpend":"Microsoft.CostManagement.ForecastSpend","com.azure.resourcemanager.costmanagement.models.ForecastTimePeriod":"Microsoft.CostManagement.ForecastTimePeriod","com.azure.resourcemanager.costmanagement.models.ForecastTimeframe":"Microsoft.CostManagement.ForecastTimeframe","com.azure.resourcemanager.costmanagement.models.ForecastType":"Microsoft.CostManagement.ForecastType","com.azure.resourcemanager.costmanagement.models.FormatType":"Microsoft.CostManagement.FormatType","com.azure.resourcemanager.costmanagement.models.Frequency":"Microsoft.CostManagement.Frequency","com.azure.resourcemanager.costmanagement.models.FunctionName":"Microsoft.CostManagement.FunctionName","com.azure.resourcemanager.costmanagement.models.FunctionType":"Microsoft.CostManagement.FunctionType","com.azure.resourcemanager.costmanagement.models.GenerateCostDetailsReportRequestDefinition":"Microsoft.CostManagement.GenerateCostDetailsReportRequestDefinition","com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportDefinition":"Microsoft.CostManagement.GenerateDetailedCostReportDefinition","com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportMetricType":"Microsoft.CostManagement.GenerateDetailedCostReportMetricType","com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportTimePeriod":"Microsoft.CostManagement.GenerateDetailedCostReportTimePeriod","com.azure.resourcemanager.costmanagement.models.Grain":"Microsoft.CostManagement.Grain","com.azure.resourcemanager.costmanagement.models.GrainParameter":"Microsoft.CostManagement.GrainParameter","com.azure.resourcemanager.costmanagement.models.GranularityType":"Microsoft.CostManagement.GranularityType","com.azure.resourcemanager.costmanagement.models.IncludedQuantityUtilizationSummary":"Microsoft.CostManagement.IncludedQuantityUtilizationSummary","com.azure.resourcemanager.costmanagement.models.KpiProperties":"Microsoft.CostManagement.KpiProperties","com.azure.resourcemanager.costmanagement.models.KpiType":"Microsoft.CostManagement.KpiTypeType","com.azure.resourcemanager.costmanagement.models.LookBackPeriod":"Microsoft.CostManagement.LookBackPeriod","com.azure.resourcemanager.costmanagement.models.MCAPriceSheetProperties":"Microsoft.CostManagement.MCAPriceSheetProperties","com.azure.resourcemanager.costmanagement.models.ManagementGroupScopeBenefitRecommendationProperties":"Microsoft.CostManagement.ManagementGroupScopeBenefitRecommendationProperties","com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties":"Microsoft.CostManagement.MarkupRuleProperties","com.azure.resourcemanager.costmanagement.models.MetricType":"Microsoft.CostManagement.MetricType","com.azure.resourcemanager.costmanagement.models.Notification":"Microsoft.CostManagement.Notification","com.azure.resourcemanager.costmanagement.models.NotificationProperties":"Microsoft.CostManagement.NotificationProperties","com.azure.resourcemanager.costmanagement.models.Operation":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.costmanagement.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.costmanagement.models.OperationStatusType":"Microsoft.CostManagement.OperationStatusType","com.azure.resourcemanager.costmanagement.models.OperatorType":"Microsoft.CostManagement.OperatorType","com.azure.resourcemanager.costmanagement.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.costmanagement.models.PivotProperties":"Microsoft.CostManagement.PivotProperties","com.azure.resourcemanager.costmanagement.models.PivotType":"Microsoft.CostManagement.PivotTypeType","com.azure.resourcemanager.costmanagement.models.QueryAggregation":"Microsoft.CostManagement.QueryAggregation","com.azure.resourcemanager.costmanagement.models.QueryColumn":"Microsoft.CostManagement.QueryColumn","com.azure.resourcemanager.costmanagement.models.QueryColumnType":"Microsoft.CostManagement.QueryColumnType","com.azure.resourcemanager.costmanagement.models.QueryComparisonExpression":"Microsoft.CostManagement.QueryComparisonExpression","com.azure.resourcemanager.costmanagement.models.QueryDataset":"Microsoft.CostManagement.QueryDataset","com.azure.resourcemanager.costmanagement.models.QueryDatasetConfiguration":"Microsoft.CostManagement.QueryDatasetConfiguration","com.azure.resourcemanager.costmanagement.models.QueryDefinition":"Microsoft.CostManagement.QueryDefinition","com.azure.resourcemanager.costmanagement.models.QueryFilter":"Microsoft.CostManagement.QueryFilter","com.azure.resourcemanager.costmanagement.models.QueryGrouping":"Microsoft.CostManagement.QueryGrouping","com.azure.resourcemanager.costmanagement.models.QueryOperatorType":"Microsoft.CostManagement.QueryOperatorType","com.azure.resourcemanager.costmanagement.models.QueryTimePeriod":"Microsoft.CostManagement.QueryTimePeriod","com.azure.resourcemanager.costmanagement.models.Reason":"Microsoft.CostManagement.Reason","com.azure.resourcemanager.costmanagement.models.RecommendationUsageDetails":"Microsoft.CostManagement.RecommendationUsageDetails","com.azure.resourcemanager.costmanagement.models.RecurrenceType":"Microsoft.CostManagement.RecurrenceType","com.azure.resourcemanager.costmanagement.models.ReportConfigAggregation":"Microsoft.CostManagement.ReportConfigAggregation","com.azure.resourcemanager.costmanagement.models.ReportConfigComparisonExpression":"Microsoft.CostManagement.ReportConfigComparisonExpression","com.azure.resourcemanager.costmanagement.models.ReportConfigDataset":"Microsoft.CostManagement.ReportConfigDataset","com.azure.resourcemanager.costmanagement.models.ReportConfigDatasetConfiguration":"Microsoft.CostManagement.ReportConfigDatasetConfiguration","com.azure.resourcemanager.costmanagement.models.ReportConfigFilter":"Microsoft.CostManagement.ReportConfigFilter","com.azure.resourcemanager.costmanagement.models.ReportConfigGrouping":"Microsoft.CostManagement.ReportConfigGrouping","com.azure.resourcemanager.costmanagement.models.ReportConfigSorting":"Microsoft.CostManagement.ReportConfigSorting","com.azure.resourcemanager.costmanagement.models.ReportConfigSortingType":"Microsoft.CostManagement.ReportConfigSortingType","com.azure.resourcemanager.costmanagement.models.ReportConfigTimePeriod":"Microsoft.CostManagement.ReportConfigTimePeriod","com.azure.resourcemanager.costmanagement.models.ReportGranularityType":"Microsoft.CostManagement.ReportGranularityType","com.azure.resourcemanager.costmanagement.models.ReportOperationStatusType":"Microsoft.CostManagement.ReportOperationStatusType","com.azure.resourcemanager.costmanagement.models.ReportTimeframeType":"Microsoft.CostManagement.ReportTimeframeType","com.azure.resourcemanager.costmanagement.models.ReportType":"Microsoft.CostManagement.ReportType","com.azure.resourcemanager.costmanagement.models.ReservationReportSchema":"Microsoft.CostManagement.ReservationReportSchema","com.azure.resourcemanager.costmanagement.models.RuleStatus":"Microsoft.CostManagement.RuleStatus","com.azure.resourcemanager.costmanagement.models.SavingsPlanUtilizationSummary":"Microsoft.CostManagement.SavingsPlanUtilizationSummary","com.azure.resourcemanager.costmanagement.models.ScheduleFrequency":"Microsoft.CostManagement.ScheduleFrequency","com.azure.resourcemanager.costmanagement.models.ScheduleProperties":"Microsoft.CostManagement.ScheduleProperties","com.azure.resourcemanager.costmanagement.models.ScheduledActionKind":"Microsoft.CostManagement.ScheduledActionKind","com.azure.resourcemanager.costmanagement.models.ScheduledActionStatus":"Microsoft.CostManagement.ScheduledActionStatus","com.azure.resourcemanager.costmanagement.models.Scope":"Microsoft.CostManagement.Scope","com.azure.resourcemanager.costmanagement.models.SettingType":"Microsoft.CostManagement.SettingType","com.azure.resourcemanager.costmanagement.models.SettingsKind":"Microsoft.CostManagement.SettingsKind","com.azure.resourcemanager.costmanagement.models.SharedScopeBenefitRecommendationProperties":"Microsoft.CostManagement.SharedScopeBenefitRecommendationProperties","com.azure.resourcemanager.costmanagement.models.SingleScopeBenefitRecommendationProperties":"Microsoft.CostManagement.SingleScopeBenefitRecommendationProperties","com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource":"Microsoft.CostManagement.SourceCostAllocationResource","com.azure.resourcemanager.costmanagement.models.Status":"Microsoft.CostManagement.Status","com.azure.resourcemanager.costmanagement.models.StatusType":"Microsoft.CostManagement.StatusType","com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentity":"Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentity","com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentityType":"Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentityType","com.azure.resourcemanager.costmanagement.models.TagInheritanceProperties":"Microsoft.CostManagement.TagInheritanceProperties","com.azure.resourcemanager.costmanagement.models.TagInheritanceSetting":"Microsoft.CostManagement.TagInheritanceSetting","com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource":"Microsoft.CostManagement.TargetCostAllocationResource","com.azure.resourcemanager.costmanagement.models.Term":"Microsoft.CostManagement.Term","com.azure.resourcemanager.costmanagement.models.ThresholdType":"Microsoft.CostManagement.ThresholdType","com.azure.resourcemanager.costmanagement.models.TimeGrainType":"Microsoft.CostManagement.TimeGrainType","com.azure.resourcemanager.costmanagement.models.TimeframeType":"Microsoft.CostManagement.TimeframeType","com.azure.resourcemanager.costmanagement.models.WeeksOfMonth":"Microsoft.CostManagement.WeeksOfMonth"},"generatedFiles":["src/main/java/com/azure/resourcemanager/costmanagement/CostManagementManager.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/AlertsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitRecommendationsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/BenefitUtilizationSummariesClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/BudgetsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostAllocationRulesClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/CostManagementManagementClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/DimensionsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/ExportsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/ForecastsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateBenefitUtilizationSummariesReportsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateCostDetailsReportsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationResultsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportOperationStatusClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateDetailedCostReportsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/GenerateReservationDetailsReportsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/MarkupRulesClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/PriceSheetsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/QueriesClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/ScheduledActionsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/SettingsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/ViewsClient.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/AlertsResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitRecommendationModelInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummariesOperationStatusInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BenefitUtilizationSummaryInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/BudgetProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CheckNameAvailabilityResponseInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CommonExportPropertiesInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleCheckNameAvailabilityResponseInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostAllocationRuleDefinitionInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostDetailsOperationResultsInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/CostManagementOperationInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DimensionProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/DownloadUrlInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportExecutionListResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportListResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ExportRunPropertiesInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ForecastResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/GenerateDetailedCostReportOperationStatusesInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/IncludedQuantityUtilizationSummaryProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/MarkupRuleInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/OperationStatusInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/PricesheetDownloadPropertiesInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/QueryResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportConfigDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportManifest.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ReportUrl.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/RequestContext.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SavingsPlanUtilizationSummaryProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ScheduledActionProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/SettingsListResultInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewInner.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/costmanagement/fluent/package-info.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/AlertsResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationModelImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitRecommendationsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummariesOperationStatusImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BenefitUtilizationSummaryImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/BudgetsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CheckNameAvailabilityResponseImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CommonExportPropertiesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleCheckNameAvailabilityResponseImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRuleDefinitionImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostAllocationRulesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostDetailsOperationResultsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementManagementClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/CostManagementOperationImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/DimensionsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/DownloadUrlImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportExecutionListResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportListResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportRunPropertiesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ExportsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ForecastsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateBenefitUtilizationSummariesReportsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateCostDetailsReportsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationResultsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportOperationStatusesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateDetailedCostReportsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/GenerateReservationDetailsReportsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRuleImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/MarkupRulesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationStatusImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/PriceSheetsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/PricesheetDownloadPropertiesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueriesImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/QueryResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ScheduledActionsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/SettingsListResultImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsClientImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/ViewsImpl.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitRecommendationsListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BenefitUtilizationSummariesListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/BudgetsListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/CostAllocationRuleList.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/DimensionsListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/MarkupRulePagedResponse.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ScheduledActionListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/models/ViewListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/implementation/package-info.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AccumulatedType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ActionType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Alert.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCategory.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertCriteria.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertOperator.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertPropertiesDetails.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertSource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertTimeGrainType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Alerts.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AlertsResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AllSavingsBenefitDetails.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AllSavingsList.java","src/main/java/com/azure/resourcemanager/costmanagement/models/AsyncOperationStatusProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitKind.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationModel.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendationProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitRecommendations.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitResource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaries.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesOperationStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummariesRequest.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummary.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaryProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BenefitUtilizationSummaryReportSchema.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BlobInfo.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Budget.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetComparisonExpression.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilter.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetFilterProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetNotificationOperatorType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetOperatorType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/BudgetTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Budgets.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CategoryType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ChartType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityReason.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityRequest.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CheckNameAvailabilityResponse.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CommonExportProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CompressionModeType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationPolicyType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationProportion.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationResourceType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityRequest.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleCheckNameAvailabilityResponse.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleDetails.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRuleProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostAllocationRules.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsDataFormat.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsMetricType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsOperationResults.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsStatusType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostDetailsTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementOperation.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementProxyResource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CostManagementResource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CultureCode.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CurrentSpend.java","src/main/java/com/azure/resourcemanager/costmanagement/models/CustomerMetadata.java","src/main/java/com/azure/resourcemanager/costmanagement/models/DataOverwriteBehaviorType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/DaysOfWeek.java","src/main/java/com/azure/resourcemanager/costmanagement/models/DestinationType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Dimension.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Dimensions.java","src/main/java/com/azure/resourcemanager/costmanagement/models/DismissAlertPayload.java","src/main/java/com/azure/resourcemanager/costmanagement/models/DownloadUrl.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExecutionType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Export.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDataset.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDatasetConfiguration.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDeliveryDestination.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportDeliveryInfo.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportExecutionListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportRecurrencePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportRun.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportRunProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportRunRequest.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSchedule.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportSuspensionContext.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExportType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Exports.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ExternalCloudProviderType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FileDestination.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FileFormat.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItemNames.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FilterItems.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastAggregation.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastColumn.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastComparisonExpression.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDataset.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDatasetConfiguration.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastFilter.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastOperatorType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastSpend.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastTimeframe.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ForecastType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Forecasts.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FormatType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Frequency.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionName.java","src/main/java/com/azure/resourcemanager/costmanagement/models/FunctionType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateBenefitUtilizationSummariesReports.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReportRequestDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateCostDetailsReports.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportMetricType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationResults.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportOperationStatuses.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReportTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateDetailedCostReports.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GenerateReservationDetailsReports.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Grain.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GrainParameter.java","src/main/java/com/azure/resourcemanager/costmanagement/models/GranularityType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/IncludedQuantityUtilizationSummary.java","src/main/java/com/azure/resourcemanager/costmanagement/models/KpiProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/KpiType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/LookBackPeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/MCAPriceSheetProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ManagementGroupScopeBenefitRecommendationProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRule.java","src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRuleProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/MarkupRules.java","src/main/java/com/azure/resourcemanager/costmanagement/models/MetricType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Notification.java","src/main/java/com/azure/resourcemanager/costmanagement/models/NotificationProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Operation.java","src/main/java/com/azure/resourcemanager/costmanagement/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/costmanagement/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/OperationStatusType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Operations.java","src/main/java/com/azure/resourcemanager/costmanagement/models/OperatorType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Origin.java","src/main/java/com/azure/resourcemanager/costmanagement/models/PivotProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/PivotType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/PriceSheets.java","src/main/java/com/azure/resourcemanager/costmanagement/models/PricesheetDownloadProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Queries.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryAggregation.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumn.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryColumnType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryComparisonExpression.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDataset.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDatasetConfiguration.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryDefinition.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryFilter.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryGrouping.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryOperatorType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/QueryTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Reason.java","src/main/java/com/azure/resourcemanager/costmanagement/models/RecommendationUsageDetails.java","src/main/java/com/azure/resourcemanager/costmanagement/models/RecurrenceType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigAggregation.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigComparisonExpression.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDataset.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigDatasetConfiguration.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigFilter.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigGrouping.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSorting.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigSortingType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportConfigTimePeriod.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportGranularityType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportOperationStatusType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportTimeframeType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReportType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ReservationReportSchema.java","src/main/java/com/azure/resourcemanager/costmanagement/models/RuleStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SavingsPlanUtilizationSummary.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleFrequency.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduleProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledAction.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionKind.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActionStatus.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ScheduledActions.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Scope.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Setting.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SettingType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Settings.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsKind.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SettingsListResult.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SharedScopeBenefitRecommendationProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SingleScopeBenefitRecommendationProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SourceCostAllocationResource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Status.java","src/main/java/com/azure/resourcemanager/costmanagement/models/StatusType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentity.java","src/main/java/com/azure/resourcemanager/costmanagement/models/SystemAssignedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceProperties.java","src/main/java/com/azure/resourcemanager/costmanagement/models/TagInheritanceSetting.java","src/main/java/com/azure/resourcemanager/costmanagement/models/TargetCostAllocationResource.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Term.java","src/main/java/com/azure/resourcemanager/costmanagement/models/ThresholdType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/TimeGrainType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/TimeframeType.java","src/main/java/com/azure/resourcemanager/costmanagement/models/View.java","src/main/java/com/azure/resourcemanager/costmanagement/models/Views.java","src/main/java/com/azure/resourcemanager/costmanagement/models/WeeksOfMonth.java","src/main/java/com/azure/resourcemanager/costmanagement/models/package-info.java","src/main/java/com/azure/resourcemanager/costmanagement/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-costmanagement/proxy-config.json b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-costmanagement/proxy-config.json index 250eaab007eb..d8aa921d389a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-costmanagement/proxy-config.json +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-costmanagement/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.costmanagement.implementation.AlertsClientImpl$AlertsService"],["com.azure.resourcemanager.costmanagement.implementation.BenefitRecommendationsClientImpl$BenefitRecommendationsService"],["com.azure.resourcemanager.costmanagement.implementation.BenefitUtilizationSummariesClientImpl$BenefitUtilizationSummariesService"],["com.azure.resourcemanager.costmanagement.implementation.DimensionsClientImpl$DimensionsService"],["com.azure.resourcemanager.costmanagement.implementation.ExportsClientImpl$ExportsService"],["com.azure.resourcemanager.costmanagement.implementation.ForecastsClientImpl$ForecastsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateCostDetailsReportsClientImpl$GenerateCostDetailsReportsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportOperationResultsClientImpl$GenerateDetailedCostReportOperationResultsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportOperationStatusClientImpl$GenerateDetailedCostReportOperationStatusService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportsClientImpl$GenerateDetailedCostReportsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateReservationDetailsReportsClientImpl$GenerateReservationDetailsReportsService"],["com.azure.resourcemanager.costmanagement.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.costmanagement.implementation.PriceSheetsClientImpl$PriceSheetsService"],["com.azure.resourcemanager.costmanagement.implementation.QueriesClientImpl$QueriesService"],["com.azure.resourcemanager.costmanagement.implementation.ScheduledActionsClientImpl$ScheduledActionsService"],["com.azure.resourcemanager.costmanagement.implementation.ViewsClientImpl$ViewsService"]] \ No newline at end of file +[["com.azure.resourcemanager.costmanagement.implementation.AlertsClientImpl$AlertsService"],["com.azure.resourcemanager.costmanagement.implementation.BenefitRecommendationsClientImpl$BenefitRecommendationsService"],["com.azure.resourcemanager.costmanagement.implementation.BenefitUtilizationSummariesClientImpl$BenefitUtilizationSummariesService"],["com.azure.resourcemanager.costmanagement.implementation.BudgetsClientImpl$BudgetsService"],["com.azure.resourcemanager.costmanagement.implementation.CostAllocationRulesClientImpl$CostAllocationRulesService"],["com.azure.resourcemanager.costmanagement.implementation.DimensionsClientImpl$DimensionsService"],["com.azure.resourcemanager.costmanagement.implementation.ExportsClientImpl$ExportsService"],["com.azure.resourcemanager.costmanagement.implementation.ForecastsClientImpl$ForecastsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateBenefitUtilizationSummariesReportsClientImpl$GenerateBenefitUtilizationSummariesReportsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateCostDetailsReportsClientImpl$GenerateCostDetailsReportsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportOperationResultsClientImpl$GenerateDetailedCostReportOperationResultsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportOperationStatusClientImpl$GenerateDetailedCostReportOperationStatusService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateDetailedCostReportsClientImpl$GenerateDetailedCostReportsService"],["com.azure.resourcemanager.costmanagement.implementation.GenerateReservationDetailsReportsClientImpl$GenerateReservationDetailsReportsService"],["com.azure.resourcemanager.costmanagement.implementation.MarkupRulesClientImpl$MarkupRulesService"],["com.azure.resourcemanager.costmanagement.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.costmanagement.implementation.PriceSheetsClientImpl$PriceSheetsService"],["com.azure.resourcemanager.costmanagement.implementation.QueriesClientImpl$QueriesService"],["com.azure.resourcemanager.costmanagement.implementation.ScheduledActionsClientImpl$ScheduledActionsService"],["com.azure.resourcemanager.costmanagement.implementation.SettingsClientImpl$SettingsService"],["com.azure.resourcemanager.costmanagement.implementation.ViewsClientImpl$ViewsService"]] \ No newline at end of file diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/azure-resourcemanager-costmanagement.properties b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/azure-resourcemanager-costmanagement.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/resources/azure-resourcemanager-costmanagement.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissSamples.java index 2c69daadd6e6..2081aa8d2329 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,9 +12,7 @@ */ public final class AlertsDismissSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DismissResourceGroupAlerts.json + * x-ms-original-file: 2026-06-01/DismissResourceGroupAlerts.json */ /** * Sample code: PatchResourceGroupAlerts. @@ -31,9 +29,7 @@ public final class AlertsDismissSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DismissSubscriptionAlerts.json + * x-ms-original-file: 2026-06-01/DismissSubscriptionAlerts.json */ /** * Sample code: PatchSubscriptionAlerts. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetSamples.java index 8973a8ca951f..539e6e3adbe4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class AlertsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SingleSubscriptionAlert.json + * x-ms-original-file: 2026-06-01/SingleSubscriptionAlert.json */ /** * Sample code: SingleSubscriptionAlerts. @@ -26,9 +24,7 @@ public final class AlertsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SingleResourceGroupAlert.json + * x-ms-original-file: 2026-06-01/SingleResourceGroupAlert.json */ /** * Sample code: SingleResourceGroupAlerts. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalSamples.java index 934dbf412adb..87c177a23ad0 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,9 +11,7 @@ */ public final class AlertsListExternalSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountAlerts.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountAlerts.json */ /** * Sample code: ExternalBillingAccountAlerts. @@ -28,9 +26,7 @@ public final class AlertsListExternalSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionAlerts.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionAlerts.json */ /** * Sample code: ExternalSubscriptionAlerts. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListSamples.java index 90e106511e15..a86690e5d9d6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/AlertsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class AlertsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionAlerts.json + * x-ms-original-file: 2026-06-01/SubscriptionAlerts.json */ /** * Sample code: SubscriptionAlerts. @@ -24,9 +22,7 @@ public static void subscriptionAlerts(com.azure.resourcemanager.costmanagement.C } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingProfileAlerts.json + * x-ms-original-file: 2026-06-01/BillingProfileAlerts.json */ /** * Sample code: BillingProfileAlerts. @@ -35,14 +31,12 @@ public static void subscriptionAlerts(com.azure.resourcemanager.costmanagement.C */ public static void billingProfileAlerts(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.alerts() - .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", + .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupAlerts.json + * x-ms-original-file: 2026-06-01/ResourceGroupAlerts.json */ /** * Sample code: ResourceGroupAlerts. @@ -57,9 +51,7 @@ public static void resourceGroupAlerts(com.azure.resourcemanager.costmanagement. } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentAlerts.json + * x-ms-original-file: 2026-06-01/DepartmentAlerts.json */ /** * Sample code: DepartmentAlerts. @@ -73,9 +65,7 @@ public static void departmentAlerts(com.azure.resourcemanager.costmanagement.Cos } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * InvoiceSectionAlerts.json + * x-ms-original-file: 2026-06-01/InvoiceSectionAlerts.json */ /** * Sample code: InvoiceSectionAlerts. @@ -90,9 +80,7 @@ public static void invoiceSectionAlerts(com.azure.resourcemanager.costmanagement } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountAlerts.json + * x-ms-original-file: 2026-06-01/BillingAccountAlerts.json */ /** * Sample code: BillingAccountAlerts. @@ -101,14 +89,12 @@ public static void invoiceSectionAlerts(com.azure.resourcemanager.costmanagement */ public static void billingAccountAlerts(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.alerts() - .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345:6789", + .listWithResponse("providers/Microsoft.Billing/billingAccounts/12345-6789", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountAlerts.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountAlerts.json */ /** * Sample code: EnrollmentAccountAlerts. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitRecommendationsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitRecommendationsListSamples.java index bc38a7554219..33de154b8f3e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitRecommendationsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitRecommendationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,23 @@ */ public final class BenefitRecommendationsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitRecommendationsByBillingAccount.json + * x-ms-original-file: 2026-06-01/BenefitRecommendationsByBillingAccountForManagementGroup.json + */ + /** + * Sample code: BenefitRecommendationsManagementGroupList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void benefitRecommendationsManagementGroupList( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.benefitRecommendations() + .list("providers/Microsoft.Billing/billingAccounts/123456", + "properties/scope eq 'ManagementGroup' AND properties/managementGroupId eq '/providers/Microsoft.Management/managementGroups/00000000-0000-0000-0000-000000000001' AND properties/lookBackPeriod eq 'Last7Days' AND properties/term eq 'P1Y'", + null, "properties/usage,properties/allRecommendationDetails", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/BenefitRecommendationsByBillingAccount.json */ /** * Sample code: BenefitRecommendationsBillingAccountList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdSamples.java index fdf1fb41382d..ab3fae276887 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class BenefitUtilizationSummariesListByBillingAccountIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json */ /** * Sample code: SavingsPlanUtilizationSummaries-BillingAccount. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdSamples.java index 9c3d18c88b49..16ce9a0925ca 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class BenefitUtilizationSummariesListByBillingProfileIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json */ /** * Sample code: SavingsPlanUtilizationSummaries-BillingProfile. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdSamples.java index a6c56080c22a..3dc65c874af6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class BenefitUtilizationSummariesListBySavingsPlanIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json */ /** * Sample code: SavingsPlanUtilizationSummariesMonthlyWithSavingsPlanId. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderSamples.java index 3783731e77a7..3a367d7adf49 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class BenefitUtilizationSummariesListBySavingsPlanOrderSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json + * x-ms-original-file: 2026-06-01/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json */ /** * Sample code: SavingsPlanUtilizationSummariesDaily. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsCreateOrUpdateSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f684315261df --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsCreateOrUpdateSamples.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Budgets CreateOrUpdate. + */ +public final class BudgetsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule-ReservationIdFilter.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationBillingAccountEAAlertRuleReservationIdFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST7DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservationId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json + */ + /** + * Sample code: CreateOrUpdate-Cost-Subscription-Budget. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + createOrUpdateCostSubscriptionBudget(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestBudget") + .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.COST) + .withAmount(100.65D) + .withTimeGrain(TimeGrainType.MONTHLY) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2024-10-31T00:00:00Z"))) + .withFilter(new BudgetFilter().withAnd(Arrays.asList( + new BudgetFilterProperties().withDimensions(new BudgetComparisonExpression().withName("ResourceId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("category") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("Dev", "Prod"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("department") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("engineering", "sales")))))) + .withNotifications(mapOf("Actual_GreaterThan_80_Percent", new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.GREATER_THAN) + .withThreshold(80.0) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withContactRoles(Arrays.asList("Contributor", "Reader")) + .withContactGroups(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule-ReservedResourceTypeFilter.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-CustomerCSP-AlertRule-ReservedResourceTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationCustomerCSPAlertRuleReservedResourceTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter( + new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservedResourceType") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("VirtualMachines", "SqlDatabases", "CosmosDb")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-CustomerCSP-AlertRule.json. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationCustomerCSPAlertRuleJson( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter()) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule-ReservationIdFilter.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule-ReservationIdFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationBillingProfileMCAAlertRuleReservationIdFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservationId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule.json. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationBillingProfileMCAAlertRuleJson( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter()) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationBillingAccountEAAlertRule( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST7DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter()) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/EA/BillingAccountEA-AlertRule-ReservedResourceTypeFilter + * .json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationBillingAccountEAAlertRuleReservedResourceTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST7DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter( + new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservedResourceType") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("VirtualMachines", "SqlDatabases", "CosmosDb")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/BillingProfile-AlertRule-ReservedResourceTypeFilter. + * json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule-ReservedResourceTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationBillingProfileMCAAlertRuleReservedResourceTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter( + new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservedResourceType") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("VirtualMachines", "SqlDatabases", "CosmosDb")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-06-01/Budgets/CreateOrUpdate/ReservationUtilization/MCA/Customer-AlertRule-ReservationIdFilter.json + */ + /** + * Sample code: CreateOrUpdate-ReservationUtilization-CustomerCSP-AlertRule-ReservationIdFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void createOrUpdateReservationUtilizationCustomerCSPAlertRuleReservationIdFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .define("TestAlertRule") + .withExistingScope( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444") + .withETag("\"1d34d016a593709\"") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2023-04-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2025-04-01T00:00:00Z"))) + .withFilter(new BudgetFilter().withDimensions(new BudgetComparisonExpression().withName("ReservationId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002")))) + .withNotifications(mapOf("Actual_LessThan_99_Percent", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.LESS_THAN) + .withThreshold(99.0) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withLocale(CultureCode.EN_US))) + .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; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsDeleteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsDeleteSamples.java new file mode 100644 index 000000000000..266f5778648e --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for Budgets Delete. + */ +public final class BudgetsDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/Budgets/Delete/DeleteBudget.json + */ + /** + * Sample code: DeleteBudget. + * + * @param manager Entry point to CostManagementManager. + */ + public static void deleteBudget(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .deleteByResourceGroupWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsGetSamples.java new file mode 100644 index 000000000000..6082aa6a5115 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsGetSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for Budgets Get. + */ +public final class BudgetsGetSamples { + /* + * x-ms-original-file: 2026-06-01/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json + */ + /** + * Sample code: Get-ReservationUtilization-AlertRule. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + getReservationUtilizationAlertRule(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .getWithResponse( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN", + "TestAlertRule", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/Get/Cost/Get-Cost-Budget.json + */ + /** + * Sample code: Get-Cost-Budget. + * + * @param manager Entry point to CostManagementManager. + */ + public static void getCostBudget(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListSamples.java new file mode 100644 index 000000000000..de41f35dc7c8 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListSamples.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for Budgets List. + */ +public final class BudgetsListSamples { + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingProfileBudgetsList.json + */ + /** + * Sample code: BillingProfileBudgetsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingProfileBudgetsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/CustomerBudgetsList-CategoryTypeFilter.json + */ + /** + * Sample code: CustomerBudgetsList-MCA-CSP-CategoryTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void customerBudgetsListMCACSPCategoryTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/EA/BillingAccountBudgetsList-EA.json + */ + /** + * Sample code: BillingAccountBudgetsList-EA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingAccountBudgetsListEA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/CustomerBudgetsList.json + */ + /** + * Sample code: CustomerBudgetsList-MCA-CSP. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + customerBudgetsListMCACSP(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/000000-1111-2222-3333-444444444444", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json + */ + /** + * Sample code: BillingAccountBudgetsList-EA-CategoryTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingAccountBudgetsListEACategoryTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/RBAC/ManagementGroupBudgetsList.json + */ + /** + * Sample code: ManagementGroupBudgetsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + managementGroupBudgetsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("Microsoft.Management/managementGroups/MYDEVTESTMG", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/EA/DepartmentBudgetsList.json + */ + /** + * Sample code: DepartmentBudgetsList-EA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void departmentBudgetsListEA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456/departments/789101", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/EA/EnrollmentAccountBudgetsList.json + */ + /** + * Sample code: EnrollmentAccountBudgetsList-EA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + enrollmentAccountBudgetsListEA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/473845", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json + */ + /** + * Sample code: BillingProfileBudgetsList-MCA-CategoryTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingProfileBudgetsListMCACategoryTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json + */ + /** + * Sample code: BillingAccountBudgetsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingAccountBudgetsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json + */ + /** + * Sample code: BillingAccountBudgetsList-MCA-CategoryTypeFilter. + * + * @param manager Entry point to CostManagementManager. + */ + public static void billingAccountBudgetsListMCACategoryTypeFilter( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "properties/category eq 'ReservationUtilization'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/MCA/InvoiceSectionBudgetsList.json + */ + /** + * Sample code: InvoiceSectionBudgetsList-MCA. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + invoiceSectionBudgetsListMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list( + "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/invoiceSections/AAAA-BBBB-CCC-DDD", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/RBAC/ResourceGroupBudgetsList.json + */ + /** + * Sample code: ResourceGroupBudgetsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + resourceGroupBudgetsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Budgets/List/RBAC/SubscriptionBudgetsList.json + */ + /** + * Sample code: SubscriptionBudgetsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void subscriptionBudgetsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.budgets() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCheckNameAvailabilitySamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..4dbc004f46bf --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCheckNameAvailabilitySamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; + +/** + * Samples for CostAllocationRules CheckNameAvailability. + */ +public final class CostAllocationRulesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleCheckNameAvailability.json + */ + /** + * Sample code: CostAllocationRuleCheckNameAvailability. + * + * @param manager Entry point to CostManagementManager. + */ + public static void costAllocationRuleCheckNameAvailability( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .checkNameAvailabilityWithResponse("100", + new CostAllocationRuleCheckNameAvailabilityRequest().withName("testRule") + .withType("Microsoft.CostManagement/costAllocationRules"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCreateOrUpdateSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..58dc43142f9c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCreateOrUpdateSamples.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.util.Arrays; + +/** + * Samples for CostAllocationRules CreateOrUpdate. + */ +public final class CostAllocationRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleCreateTag.json + */ + /** + * Sample code: CostAllocationRulesCreateTag. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + costAllocationRulesCreateTag(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .createOrUpdateWithResponse("100", "testRule", + new CostAllocationRuleDefinitionInner().withProperties(new CostAllocationRuleProperties() + .withDescription("This is a testRule") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources(Arrays + .asList(new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("category") + .withValues(Arrays.asList("devops")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ResourceGroupName") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("destinationRG").withPercentage(33.33), + new CostAllocationProportion().withName("destinationRG2").withPercentage(33.33), + new CostAllocationProportion().withName("destinationRG3").withPercentage(33.34))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.ACTIVE)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleCreate.json + */ + /** + * Sample code: CostAllocationRulesCreateResourceGroup. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + costAllocationRulesCreateResourceGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .createOrUpdateWithResponse("100", "testRule", + new CostAllocationRuleDefinitionInner().withProperties(new CostAllocationRuleProperties() + .withDescription("This is a testRule") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources(Arrays.asList( + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ResourceGroupName") + .withValues(Arrays.asList("sampleRG", "secondRG")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ResourceGroupName") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("destinationRG").withPercentage(45.0), + new CostAllocationProportion().withName("destinationRG2").withPercentage(54.0))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.ACTIVE)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesDeleteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesDeleteSamples.java new file mode 100644 index 000000000000..9b44f4a6a622 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for CostAllocationRules Delete. + */ +public final class CostAllocationRulesDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleDelete.json + */ + /** + * Sample code: DeleteCostAllocationRule. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + deleteCostAllocationRule(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules() + .deleteByResourceGroupWithResponse("100", "testRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesGetSamples.java new file mode 100644 index 000000000000..e6c43a0b4dc4 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for CostAllocationRules Get. + */ +public final class CostAllocationRulesGetSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRuleGet.json + */ + /** + * Sample code: CostAllocationRules. + * + * @param manager Entry point to CostManagementManager. + */ + public static void costAllocationRules(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules().getWithResponse("100", "testRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesListSamples.java new file mode 100644 index 000000000000..31aebb9a19d9 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for CostAllocationRules List. + */ +public final class CostAllocationRulesListSamples { + /* + * x-ms-original-file: 2026-06-01/CostAllocationRulesList.json + */ + /** + * Sample code: CostAllocationRulesList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void costAllocationRulesList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.costAllocationRules().list("100", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeSamples.java index 8b5dc24b3e08..01b440760c0f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,9 +11,7 @@ */ public final class DimensionsByExternalCloudProviderTypeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionsDimensions.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionsDimensions.json */ /** * Sample code: ExternalSubscriptionDimensionList. @@ -28,9 +26,7 @@ public final class DimensionsByExternalCloudProviderTypeSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountsDimensions.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountsDimensions.json */ /** * Sample code: ExternalBillingAccountDimensionList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListSamples.java index 58858a463bcf..49448665fcad 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class DimensionsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerDimensionsList.json + * x-ms-original-file: 2026-06-01/MCACustomerDimensionsList.json */ /** * Sample code: CustomerDimensionsList-MCA. @@ -26,9 +24,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentDimensionsList.json + * x-ms-original-file: 2026-06-01/DepartmentDimensionsList.json */ /** * Sample code: DepartmentDimensionsList-Legacy. @@ -43,9 +39,7 @@ public final class DimensionsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionDimensionsListWithFilter.json */ /** * Sample code: InvoiceSectionDimensionsListWithFilter-MCA. @@ -60,9 +54,7 @@ public static void invoiceSectionDimensionsListWithFilterMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCACustomerDimensionsListWithFilter.json */ /** * Sample code: CustomerDimensionsListWithFilter-MCA. @@ -77,9 +69,7 @@ public static void invoiceSectionDimensionsListWithFilterMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/ManagementGroupDimensionsListWithFilter.json */ /** * Sample code: ManagementGroupDimensionsListWithFilter-Legacy. @@ -94,9 +84,7 @@ public static void managementGroupDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountDimensionsList.json + * x-ms-original-file: 2026-06-01/BillingAccountDimensionsList.json */ /** * Sample code: BillingAccountDimensionsList-Legacy. @@ -111,9 +99,7 @@ public static void managementGroupDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/ManagementGroupDimensionsListExpandAndTop.json */ /** * Sample code: ManagementGroupDimensionsListExpandAndTop-Legacy. @@ -128,9 +114,7 @@ public static void managementGroupDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileDimensionsList.json + * x-ms-original-file: 2026-06-01/MCABillingProfileDimensionsList.json */ /** * Sample code: BillingProfileDimensionsList-MCA. @@ -145,9 +129,7 @@ public static void managementGroupDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/DepartmentDimensionsListExpandAndTop.json */ /** * Sample code: DepartmentDimensionsListExpandAndTop-Legacy. @@ -162,9 +144,7 @@ public static void departmentDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountDimensionsList.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountDimensionsList.json */ /** * Sample code: EnrollmentAccountDimensionsList-Legacy. @@ -179,9 +159,7 @@ public static void departmentDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/MCABillingAccountDimensionsListExpandAndTop.json */ /** * Sample code: BillingAccountDimensionsListExpandAndTop-MCA. @@ -196,9 +174,7 @@ public static void billingAccountDimensionsListExpandAndTopMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/BillingAccountDimensionsListWithFilter.json */ /** * Sample code: BillingAccountDimensionsListWithFilter-Legacy. @@ -213,9 +189,7 @@ public static void billingAccountDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupDimensionsList.json + * x-ms-original-file: 2026-06-01/ResourceGroupDimensionsList.json */ /** * Sample code: ResourceGroupDimensionsList-Legacy. @@ -230,9 +204,7 @@ public static void billingAccountDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionDimensionsList.json + * x-ms-original-file: 2026-06-01/SubscriptionDimensionsList.json */ /** * Sample code: SubscriptionDimensionsList-Legacy. @@ -247,9 +219,7 @@ public static void billingAccountDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/BillingAccountDimensionsListExpandAndTop.json */ /** * Sample code: BillingAccountDimensionsListExpandAndTop-Legacy. @@ -264,9 +234,7 @@ public static void billingAccountDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountDimensionsList.json + * x-ms-original-file: 2026-06-01/MCABillingAccountDimensionsList.json */ /** * Sample code: BillingAccountDimensionsList-MCA. @@ -281,9 +249,7 @@ public static void billingAccountDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountDimensionsListExpandAndTop.json */ /** * Sample code: EnrollmentAccountDimensionsListExpandAndTop-Legacy. @@ -298,43 +264,37 @@ public static void enrollmentAccountDimensionsListExpandAndTopLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/DepartmentDimensionsListWithFilter.json */ /** - * Sample code: CustomerDimensionsListExpandAndTop-MCA. + * Sample code: DepartmentDimensionsListWithFilter-Legacy. * * @param manager Entry point to CostManagementManager. */ - public static void - customerDimensionsListExpandAndTopMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + public static void departmentDimensionsListWithFilterLegacy( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", null, "properties/data", - null, 5, com.azure.core.util.Context.NONE); + .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", + "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCACustomerDimensionsListExpandAndTop.json */ /** - * Sample code: DepartmentDimensionsListWithFilter-Legacy. + * Sample code: CustomerDimensionsListExpandAndTop-MCA. * * @param manager Entry point to CostManagementManager. */ - public static void departmentDimensionsListWithFilterLegacy( - com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + public static void + customerDimensionsListExpandAndTopMCA(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.dimensions() - .list("providers/Microsoft.Billing/billingAccounts/100/departments/123", - "properties/category eq 'resourceId'", "properties/data", null, 5, com.azure.core.util.Context.NONE); + .list("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", null, "properties/data", + null, 5, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionDimensionsList.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionDimensionsList.json */ /** * Sample code: InvoiceSectionDimensionsList-MCA. @@ -349,9 +309,7 @@ public static void departmentDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionDimensionsListExpandAndTop.json */ /** * Sample code: InvoiceSectionDimensionsListExpandAndTop-MCA. @@ -366,9 +324,7 @@ public static void invoiceSectionDimensionsListExpandAndTopMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupDimensionsList.json + * x-ms-original-file: 2026-06-01/ManagementGroupDimensionsList.json */ /** * Sample code: ManagementGroupDimensionsList-Legacy. @@ -383,9 +339,7 @@ public static void invoiceSectionDimensionsListExpandAndTopMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileDimensionsListExpandAndTop.json + * x-ms-original-file: 2026-06-01/MCABillingProfileDimensionsListExpandAndTop.json */ /** * Sample code: BillingProfileDimensionsListExpandAndTop-MCA. @@ -400,9 +354,7 @@ public static void billingProfileDimensionsListExpandAndTopMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCABillingProfileDimensionsListWithFilter.json */ /** * Sample code: BillingProfileDimensionsListWithFilter-MCA. @@ -417,9 +369,7 @@ public static void billingProfileDimensionsListWithFilterMCA( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountDimensionsListWithFilter.json */ /** * Sample code: EnrollmentAccountDimensionsListWithFilter-Legacy. @@ -434,9 +384,7 @@ public static void enrollmentAccountDimensionsListWithFilterLegacy( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountDimensionsListWithFilter.json + * x-ms-original-file: 2026-06-01/MCABillingAccountDimensionsListWithFilter.json */ /** * Sample code: BillingAccountDimensionsListWithFilter-MCA. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsCreateOrUpdateSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsCreateOrUpdateSamples.java index f61a486b8570..d700689fe26b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsCreateOrUpdateSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsCreateOrUpdateSamples.java @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; +import com.azure.resourcemanager.costmanagement.models.CompressionModeType; +import com.azure.resourcemanager.costmanagement.models.DataOverwriteBehaviorType; +import com.azure.resourcemanager.costmanagement.models.DestinationType; import com.azure.resourcemanager.costmanagement.models.ExportDataset; import com.azure.resourcemanager.costmanagement.models.ExportDatasetConfiguration; import com.azure.resourcemanager.costmanagement.models.ExportDefinition; @@ -11,11 +14,16 @@ import com.azure.resourcemanager.costmanagement.models.ExportDeliveryInfo; import com.azure.resourcemanager.costmanagement.models.ExportRecurrencePeriod; import com.azure.resourcemanager.costmanagement.models.ExportSchedule; +import com.azure.resourcemanager.costmanagement.models.ExportTimePeriod; import com.azure.resourcemanager.costmanagement.models.ExportType; +import com.azure.resourcemanager.costmanagement.models.FilterItemNames; +import com.azure.resourcemanager.costmanagement.models.FilterItems; import com.azure.resourcemanager.costmanagement.models.FormatType; import com.azure.resourcemanager.costmanagement.models.GranularityType; import com.azure.resourcemanager.costmanagement.models.RecurrenceType; import com.azure.resourcemanager.costmanagement.models.StatusType; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentity; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentityType; import com.azure.resourcemanager.costmanagement.models.TimeframeType; import java.time.OffsetDateTime; import java.util.Arrays; @@ -25,9 +33,7 @@ */ public final class ExportsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByManagementGroup.json */ /** * Sample code: ExportCreateOrUpdateByManagementGroup. @@ -39,28 +45,73 @@ public final class ExportsCreateOrUpdateSamples { manager.exports() .define("TestExport") .withExistingScope("providers/Microsoft.Management/managementGroups/TestMG") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountReservationDetails.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountReservationDetails. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountReservationDetails( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.RESERVATION_DETAILS) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-03-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccount.json */ /** * Sample code: ExportCreateOrUpdateByBillingAccount. @@ -72,28 +123,34 @@ public final class ExportsCreateOrUpdateSamples { manager.exports() .define("TestExport") .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByDepartment.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByDepartment.json */ /** * Sample code: ExportCreateOrUpdateByDepartment. @@ -105,28 +162,34 @@ public final class ExportsCreateOrUpdateSamples { manager.exports() .define("TestExport") .withExistingScope("providers/Microsoft.Billing/billingAccounts/12/departments/1234") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) - .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) + .withFormat(FormatType.PARQUET) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.SNAPPY) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByResourceGroup.json */ /** * Sample code: ExportCreateOrUpdateByResourceGroup. @@ -138,28 +201,117 @@ public final class ExportsCreateOrUpdateSamples { manager.exports() .define("TestExport") .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountReservationTransactions.json + */ + /** + * Sample code: ExportCreateOrUpdateExportCreateOrUpdateByBillingAccountReservationTransactionsByBillingAccount. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateExportCreateOrUpdateByBillingAccountReservationTransactionsByBillingAccount( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.RESERVATION_TRANSACTIONS) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset() + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountReservationRecommendation.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountReservationRecommendation. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountReservationRecommendation( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition( + new ExportDefinition().withType(ExportType.RESERVATION_RECOMMENDATIONS) + .withTimeframe(TimeframeType.MONTH_TO_DATE) + .withDataSet(new ExportDataset() + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01") + .withFilters(Arrays.asList( + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("Single"), + new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("VirtualMachines"), + new FilterItems().withName(FilterItemNames.LOOK_BACK_PERIOD).withValue("Last7Days")))))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateBySubscription.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateBySubscription.json */ /** * Sample code: ExportCreateOrUpdateBySubscription. @@ -171,28 +323,149 @@ public final class ExportsCreateOrUpdateSamples { manager.exports() .define("TestExport") .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountCustom.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountCustom. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountCustom( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.INACTIVE)) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withTimeframe(TimeframeType.CUSTOM) + .withTimePeriod(new ExportTimePeriod().withFrom(OffsetDateTime.parse("2025-04-03T00:00:00.000Z")) + .withTo(OffsetDateTime.parse("2025-04-03T00:00:00.000Z"))) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountMonthly.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountMonthly. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountMonthly( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.MONTHLY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-05T00:00:00Z")) + .withTo(OffsetDateTime.parse("2030-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) + .withTimeframe(TimeframeType.THE_LAST_MONTH) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") + .create(); + } + + /* + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByBillingAccountPricesheet.json + */ + /** + * Sample code: ExportCreateOrUpdateByBillingAccountPricesheet. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportCreateOrUpdateByBillingAccountPricesheet( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .define("TestExport") + .withExistingScope("providers/Microsoft.Billing/billingAccounts/123456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) + .withRecurrence(RecurrenceType.DAILY) + .withRecurrencePeriod( + new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2023-06-01T00:00:00Z")) + .withTo(OffsetDateTime.parse("2023-06-30T00:00:00Z")))) + .withFormat(FormatType.CSV) + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withContainer("exports") + .withRootFolderPath("ad-hoc"))) + .withDefinition(new ExportDefinition().withType(ExportType.PRICE_SHEET) + .withTimeframe(TimeframeType.THE_CURRENT_MONTH) + .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportCreateOrUpdateByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportCreateOrUpdateByEnrollmentAccount.json */ /** * Sample code: ExportCreateOrUpdateByEnrollmentAccount. @@ -204,21 +477,29 @@ public static void exportCreateOrUpdateByEnrollmentAccount( manager.exports() .define("TestExport") .withExistingScope("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456") + .withRegion("centralus") + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .withSchedule(new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.WEEKLY) + .withRecurrence(RecurrenceType.DAILY) .withRecurrencePeriod( new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2020-06-01T00:00:00Z")) - .withTo(OffsetDateTime.parse("2020-10-31T00:00:00Z")))) + .withTo(OffsetDateTime.parse("2020-06-30T00:00:00Z")))) .withFormat(FormatType.CSV) - .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination().withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") + .withDeliveryInfo(new ExportDeliveryInfo().withDestination(new ExportDeliveryDestination() + .withType(DestinationType.AZURE_BLOB) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182") .withContainer("exports") .withRootFolderPath("ad-hoc"))) .withDefinition(new ExportDefinition().withType(ExportType.ACTUAL_COST) .withTimeframe(TimeframeType.MONTH_TO_DATE) .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("Date", "MeterId", "ResourceId", "ResourceLocation", "Quantity"))))) + .withConfiguration(new ExportDatasetConfiguration().withDataVersion("2023-05-01")))) + .withPartitionData(true) + .withDataOverwriteBehavior(DataOverwriteBehaviorType.OVERWRITE_PREVIOUS_REPORT) + .withCompressionMode(CompressionModeType.GZIP) + .withExportDescription("This is a test export.") .create(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteSamples.java index e5244e8388eb..08754d93c397 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ExportsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportDeleteByBillingAccount.json */ /** * Sample code: ExportDeleteByBillingAccount. @@ -26,9 +24,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportDeleteByManagementGroup.json */ /** * Sample code: ExportDeleteByManagementGroup. @@ -43,9 +39,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportDeleteByResourceGroup.json */ /** * Sample code: ExportDeleteByResourceGroup. @@ -61,9 +55,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByDepartment.json + * x-ms-original-file: 2026-06-01/ExportDeleteByDepartment.json */ /** * Sample code: ExportDeleteByDepartment. @@ -78,9 +70,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteBySubscription.json + * x-ms-original-file: 2026-06-01/ExportDeleteBySubscription.json */ /** * Sample code: ExportDeleteBySubscription. @@ -95,9 +85,7 @@ public final class ExportsDeleteSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportDeleteByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportDeleteByEnrollmentAccount.json */ /** * Sample code: ExportDeleteByEnrollmentAccount. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteSamples.java index bbae0aeed7c4..e2ef36130ab4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ExportsExecuteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportRunByManagementGroup.json */ /** * Sample code: ExportRunByManagementGroup. @@ -21,14 +19,12 @@ public final class ExportsExecuteSamples { public static void exportRunByManagementGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("providers/Microsoft.Management/managementGroups/TestMG", "TestExport", + .executeWithResponse("providers/Microsoft.Management/managementGroups/TestMG", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportRunByBillingAccount.json */ /** * Sample code: ExportRunByBillingAccount. @@ -38,14 +34,12 @@ public final class ExportsExecuteSamples { public static void exportRunByBillingAccount(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("providers/Microsoft.Billing/billingAccounts/123456", "TestExport", + .executeWithResponse("providers/Microsoft.Billing/billingAccounts/123456", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunBySubscription.json + * x-ms-original-file: 2026-06-01/ExportRunBySubscription.json */ /** * Sample code: ExportRunBySubscription. @@ -54,14 +48,27 @@ public final class ExportsExecuteSamples { */ public static void exportRunBySubscription(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", + .executeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByDepartment.json + * x-ms-original-file: 2026-06-01/ExportRunByBillingAccountWithOptionalRequestBody.json + */ + /** + * Sample code: ExportRunByBillingAccountWithOptionalRequestBody. + * + * @param manager Entry point to CostManagementManager. + */ + public static void exportRunByBillingAccountWithOptionalRequestBody( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.exports() + .executeWithResponse("providers/Microsoft.Billing/billingAccounts/123456", "TestExport", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/ExportRunByDepartment.json */ /** * Sample code: ExportRunByDepartment. @@ -70,14 +77,12 @@ public static void exportRunBySubscription(com.azure.resourcemanager.costmanagem */ public static void exportRunByDepartment(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() - .executeWithResponse("providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", + .executeWithResponse("providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportRunByResourceGroup.json */ /** * Sample code: ExportRunByResourceGroup. @@ -88,13 +93,11 @@ public static void exportRunByDepartment(com.azure.resourcemanager.costmanagemen exportRunByResourceGroup(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .executeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "TestExport", com.azure.core.util.Context.NONE); + "TestExport", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportRunByEnrollmentAccount.json */ /** * Sample code: ExportRunByEnrollmentAccount. @@ -105,6 +108,6 @@ public static void exportRunByDepartment(com.azure.resourcemanager.costmanagemen exportRunByEnrollmentAccount(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.exports() .executeWithResponse("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", - com.azure.core.util.Context.NONE); + null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetExecutionHistorySamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetExecutionHistorySamples.java index a8261424a25d..2f14d25c11ad 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetExecutionHistorySamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetExecutionHistorySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ExportsGetExecutionHistorySamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByManagementGroup.json */ /** * Sample code: ExportRunHistoryGetByManagementGroup. @@ -26,9 +24,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetBySubscription.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetBySubscription.json */ /** * Sample code: ExportRunHistoryGetBySubscription. @@ -43,9 +39,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByResourceGroup.json */ /** * Sample code: ExportRunHistoryGetByResourceGroup. @@ -61,9 +55,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByEnrollmentAccount.json */ /** * Sample code: ExportRunHistoryGetByEnrollmentAccount. @@ -78,9 +70,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByBillingAccount.json */ /** * Sample code: ExportRunHistoryGetByBillingAccount. @@ -95,9 +85,7 @@ public final class ExportsGetExecutionHistorySamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportRunHistoryGetByDepartment.json + * x-ms-original-file: 2026-06-01/ExportRunHistoryGetByDepartment.json */ /** * Sample code: ExportRunHistoryGetByDepartment. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetSamples.java index 5f1affa93eae..99ee066595dd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ExportsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportGetByEnrollmentAccount.json */ /** * Sample code: ExportGetByEnrollmentAccount. @@ -26,9 +24,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportGetByManagementGroup.json */ /** * Sample code: ExportGetByManagementGroup. @@ -43,9 +39,7 @@ public final class ExportsGetSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByDepartment.json + * x-ms-original-file: 2026-06-01/ExportGetByDepartment.json */ /** * Sample code: ExportGetByDepartment. @@ -59,9 +53,7 @@ public static void exportGetByDepartment(com.azure.resourcemanager.costmanagemen } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetBySubscription.json + * x-ms-original-file: 2026-06-01/ExportGetBySubscription.json */ /** * Sample code: ExportGetBySubscription. @@ -75,9 +67,7 @@ public static void exportGetBySubscription(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportGetByBillingAccount.json */ /** * Sample code: ExportGetByBillingAccount. @@ -92,9 +82,7 @@ public static void exportGetBySubscription(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportGetByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportGetByResourceGroup.json */ /** * Sample code: ExportGetByResourceGroup. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsListSamples.java index ae8bc44603a3..00859d34b195 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ExportsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ExportsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByResourceGroup.json + * x-ms-original-file: 2026-06-01/ExportsGetByResourceGroup.json */ /** * Sample code: ExportsGetByResourceGroup. @@ -26,9 +24,7 @@ public final class ExportsListSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByDepartment.json + * x-ms-original-file: 2026-06-01/ExportsGetByDepartment.json */ /** * Sample code: ExportsGetByDepartment. @@ -42,9 +38,7 @@ public static void exportsGetByDepartment(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByBillingAccount.json + * x-ms-original-file: 2026-06-01/ExportsGetByBillingAccount.json */ /** * Sample code: ExportsGetByBillingAccount. @@ -59,9 +53,7 @@ public static void exportsGetByDepartment(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByEnrollmentAccount.json + * x-ms-original-file: 2026-06-01/ExportsGetByEnrollmentAccount.json */ /** * Sample code: ExportsGetByEnrollmentAccount. @@ -76,9 +68,7 @@ public static void exportsGetByDepartment(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetByManagementGroup.json + * x-ms-original-file: 2026-06-01/ExportsGetByManagementGroup.json */ /** * Sample code: ExportsGetByManagementGroup. @@ -93,9 +83,7 @@ public static void exportsGetByDepartment(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExportsGetBySubscription.json + * x-ms-original-file: 2026-06-01/ExportsGetBySubscription.json */ /** * Sample code: ExportsGetBySubscription. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastExternalCloudProviderUsageSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastExternalCloudProviderUsageSamples.java index b04716b47605..edf53b5ee2b4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastExternalCloudProviderUsageSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastExternalCloudProviderUsageSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -27,9 +27,7 @@ */ public final class ForecastExternalCloudProviderUsageSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionForecast.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionForecast.json */ /** * Sample code: ExternalSubscriptionForecast. @@ -64,9 +62,7 @@ public final class ForecastExternalCloudProviderUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountForecast.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountForecast.json */ /** * Sample code: ExternalBillingAccountForecast. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastUsageSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastUsageSamples.java index 24a46e8690f0..70cf34773b5b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastUsageSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ForecastUsageSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -26,9 +26,7 @@ */ public final class ForecastUsageSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupForecast.json + * x-ms-original-file: 2026-06-01/ResourceGroupForecast.json */ /** * Sample code: ResourceGroupForecast. @@ -65,9 +63,7 @@ public static void resourceGroupForecast(com.azure.resourcemanager.costmanagemen } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountForecast.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountForecast.json */ /** * Sample code: EnrollmentAccountForecast. @@ -104,9 +100,7 @@ public static void resourceGroupForecast(com.azure.resourcemanager.costmanagemen } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionForecast.json + * x-ms-original-file: 2026-06-01/SubscriptionForecast.json */ /** * Sample code: SubscriptionForecast. @@ -142,9 +136,7 @@ public static void subscriptionForecast(com.azure.resourcemanager.costmanagement } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingProfileForecast.json + * x-ms-original-file: 2026-06-01/BillingProfileForecast.json */ /** * Sample code: BillingProfileForecast. @@ -180,9 +172,7 @@ public static void billingProfileForecast(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentForecast.json + * x-ms-original-file: 2026-06-01/DepartmentForecast.json */ /** * Sample code: DepartmentForecast. @@ -218,9 +208,7 @@ public static void departmentForecast(com.azure.resourcemanager.costmanagement.C } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountForecast.json + * x-ms-original-file: 2026-06-01/BillingAccountForecast.json */ /** * Sample code: BillingAccountForecast. @@ -256,9 +244,7 @@ public static void billingAccountForecast(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * InvoiceSectionForecast.json + * x-ms-original-file: 2026-06-01/InvoiceSectionForecast.json */ /** * Sample code: InvoiceSectionForecast. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByBillingAccountSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByBillingAccountSamples.java new file mode 100644 index 000000000000..4d45a4f38617 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByBillingAccountSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByBillingAccount. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByBillingAccountSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByBillingAccount.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByBillingAccount. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByBillingAccount( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByBillingAccount("8099099", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByBillingProfileSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByBillingProfileSamples.java new file mode 100644 index 000000000000..283ea92cc627 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByBillingProfileSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByBillingProfile. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByBillingProfileSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByBillingProfile.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByBillingProfile. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByBillingProfile( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByBillingProfile("00000000-0000-0000-0000-000000000000", "CZSFR-SDFXC-DSDF", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByReservationIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByReservationIdSamples.java new file mode 100644 index 000000000000..8fffef37210e --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByReservationIdSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByReservationId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByReservationIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByReservation.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByReservation. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByReservation( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByReservationId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByReservationOrderIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByReservationOrderIdSamples.java new file mode 100644 index 000000000000..4092c487d667 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateByReservationOrderIdSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateByReservationOrderId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateByReservationOrderIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportByReservationOrder.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportByReservationOrder. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportByReservationOrder( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateByReservationOrderId("00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanIdSamples.java new file mode 100644 index 000000000000..1c6b5947c03e --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanIdSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateBySavingsPlanId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlan.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportBySavingsPlan. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportBySavingsPlan( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateBySavingsPlanId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanOrderIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanOrderIdSamples.java new file mode 100644 index 000000000000..595cdf696731 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanOrderIdSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; + +/** + * Samples for GenerateBenefitUtilizationSummariesReport GenerateBySavingsPlanOrderId. + */ +public final class GenerateBenefitUtilizationSummariesReportGenerateBySavingsPlanOrderIdSamples { + /* + * x-ms-original-file: + * 2026-06-01/BenefitUtilizationSummaries/Async/GenerateBenefitUtilizationSummariesReportBySavingsPlanOrder.json + */ + /** + * Sample code: GenerateUtilizationSummariesReportBySavingsPlanOrder. + * + * @param manager Entry point to CostManagementManager. + */ + public static void generateUtilizationSummariesReportBySavingsPlanOrder( + com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.generateBenefitUtilizationSummariesReports() + .generateBySavingsPlanOrderId("00000000-0000-0000-0000-000000000000", + new BenefitUtilizationSummariesRequest().withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2022-06-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-08-31T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportCreateOperationSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportCreateOperationSamples.java index 479639d78674..35e4eecc94cb 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportCreateOperationSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportCreateOperationSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,9 +13,7 @@ */ public final class GenerateCostDetailsReportCreateOperationSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportBySubscriptionAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportBySubscriptionAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportBySubscriptionAndTimePeriod. @@ -32,9 +30,7 @@ public static void generateCostDetailsReportBySubscriptionAndTimePeriod( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod. @@ -51,9 +47,7 @@ public static void generateCostDetailsReportByEnrollmentAccountsAndTimePeriod( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByBillingProfileAndInvoiceId.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByBillingProfileAndInvoiceId.json */ /** * Sample code: GenerateCostDetailsReportByBillingProfileAndInvoiceId. @@ -71,8 +65,7 @@ public static void generateCostDetailsReportByBillingProfileAndInvoiceId( /* * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json + * 2026-06-01/GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json */ /** * Sample code: GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod. @@ -89,9 +82,7 @@ public static void generateCostDetailsReportByBillingAccountEnterpriseAgreementC } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json */ /** * Sample code: GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId. @@ -108,9 +99,7 @@ public static void generateCostDetailsReportByBillingProfileAndInvoiceIdAndCusto } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByCustomerAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByCustomerAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportByCustomerAndTimePeriod. @@ -127,9 +116,7 @@ public static void generateCostDetailsReportByCustomerAndTimePeriod( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateCostDetailsReportByDepartmentsAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateCostDetailsReportByDepartmentsAndTimePeriod.json */ /** * Sample code: GenerateCostDetailsReportByDepartmentsAndTimePeriod. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportGetOperationResultsSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportGetOperationResultsSamples.java index 1e79ee0ac6a0..c08ec6292551 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportGetOperationResultsSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportGetOperationResultsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class GenerateCostDetailsReportGetOperationResultsSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * CostDetailsOperationResultsBySubscriptionScope.json + * x-ms-original-file: 2026-06-01/CostDetailsOperationResultsBySubscriptionScope.json */ /** * Sample code: Get details of the operation result. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportCreateOperationSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportCreateOperationSamples.java index 7048f859c792..cfb21578854a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportCreateOperationSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportCreateOperationSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,9 +13,7 @@ */ public final class GenerateDetailedCostReportCreateOperationSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByBillingProfileAndInvoiceId.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByBillingProfileAndInvoiceId.json */ /** * Sample code: GenerateDetailedCostReportByBillingProfileAndInvoiceId. @@ -32,9 +30,7 @@ public static void generateDetailedCostReportByBillingProfileAndInvoiceId( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json */ /** * Sample code: GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod. @@ -51,9 +47,7 @@ public static void generateDetailedCostReportByBillingAccountLegacyAndBillingPer } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json */ /** * Sample code: GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId. @@ -71,9 +65,7 @@ public static void generateDetailedCostReportByBillingProfileAndInvoiceIdAndCust } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportBySubscriptionAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportBySubscriptionAndTimePeriod.json */ /** * Sample code: GenerateDetailedCostReportBySubscriptionAndTimePeriod. @@ -91,9 +83,7 @@ public static void generateDetailedCostReportBySubscriptionAndTimePeriod( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportByCustomerAndTimePeriod.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportByCustomerAndTimePeriod.json */ /** * Sample code: GenerateDetailedCostReportByCustomerAndTimePeriod. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultsGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultsGetSamples.java index 9a3d7f8c84ff..cba3ce8f49eb 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultsGetSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class GenerateDetailedCostReportOperationResultsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportOperationResultsBySubscriptionScope.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json */ /** * Sample code: Get details of the operation result. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationStatusGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationStatusGetSamples.java index 6049ea9158ef..08280ec2daf6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationStatusGetSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationStatusGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class GenerateDetailedCostReportOperationStatusGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateDetailedCostReportOperationStatusBySubscriptionScope.json + * x-ms-original-file: 2026-06-01/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json */ /** * Sample code: Get details of the operation status. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingAccountIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingAccountIdSamples.java index 297cddc6c1a3..52cac386a201 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingAccountIdSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingAccountIdSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class GenerateReservationDetailsReportByBillingAccountIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateReservationDetailsReportByBillingAccount.json + * x-ms-original-file: 2026-06-01/GenerateReservationDetailsReportByBillingAccount.json */ /** * Sample code: ReservationDetails. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingProfileIdSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingProfileIdSamples.java index 827bd60bd8b7..7d640872a239 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingProfileIdSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportByBillingProfileIdSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class GenerateReservationDetailsReportByBillingProfileIdSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * GenerateReservationDetailsReportByBillingProfile.json + * x-ms-original-file: 2026-06-01/GenerateReservationDetailsReportByBillingProfile.json */ /** * Sample code: ReservationDetails. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesCreateOrUpdateSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..34a836048bda --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.models.CustomerMetadata; +import com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties; +import java.time.OffsetDateTime; + +/** + * Samples for MarkupRules CreateOrUpdate. + */ +public final class MarkupRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesCreateOrUpdate.json + */ + /** + * Sample code: MarkupRulesCreateOrUpdate. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + markupRulesCreateOrUpdate(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .createOrUpdateWithResponse("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", "markup-2022", + new MarkupRuleInner() + .withProperties(new MarkupRuleProperties().withDescription("Markup rule for year 2022") + .withPercentage(5.0) + .withStartDate(OffsetDateTime.parse("2022-01-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2022-12-31T00:00:00Z")) + .withCustomerDetails(new CustomerMetadata() + .withBillingAccountId( + "cff9aa6d-941c-43f2-b6cb-1d2bb34a02b4:780237f3-1aa6-4159-943b-498e0d647dd9") + .withBillingProfileId("08eeecee-efb2-40d5-817c-0a254d2e042c"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesDeleteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesDeleteSamples.java new file mode 100644 index 000000000000..dfcef5d6e063 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for MarkupRules Delete. + */ +public final class MarkupRulesDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesDelete.json + */ + /** + * Sample code: MarkupRulesDelete. + * + * @param manager Entry point to CostManagementManager. + */ + public static void markupRulesDelete(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .deleteWithResponse("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", "markup-2022", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesGetSamples.java new file mode 100644 index 000000000000..1e9be6065087 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for MarkupRules Get. + */ +public final class MarkupRulesGetSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesGet.json + */ + /** + * Sample code: MarkupRulesGet. + * + * @param manager Entry point to CostManagementManager. + */ + public static void markupRulesGet(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .getWithResponse("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", "markup-2022", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesListSamples.java new file mode 100644 index 000000000000..c477f8821d9f --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for MarkupRules List. + */ +public final class MarkupRulesListSamples { + /* + * x-ms-original-file: 2026-06-01/MarkupRulesList.json + */ + /** + * Sample code: MarkupRulesList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void markupRulesList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.markupRules() + .list("2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6", + "cbf78278-f4b8-43d9-8f13-47112da1c63e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/OperationsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/OperationsListSamples.java index 51a502962fed..09ad61f85a88 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/OperationsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList. - * json + * x-ms-original-file: 2026-06-01/OperationList.json */ /** * Sample code: OperationList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingAccountSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingAccountSamples.java new file mode 100644 index 000000000000..8c0ee3a807bb --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingAccountSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for PriceSheet DownloadByBillingAccount. + */ +public final class PriceSheetDownloadByBillingAccountSamples { + /* + * x-ms-original-file: 2026-06-01/EAPriceSheetForBillingPeriod.json + */ + /** + * Sample code: EAPriceSheetForBillingPeriod. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + eAPriceSheetForBillingPeriod(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.priceSheets().downloadByBillingAccount("0000000", "202311", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingProfileSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingProfileSamples.java index ab556030f343..8447dd8f43d6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingProfileSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByBillingProfileSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class PriceSheetDownloadByBillingProfileSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PricesheetDownloadByBillingProfile.json + * x-ms-original-file: 2026-06-01/PricesheetDownloadByBillingProfile.json */ /** * Sample code: PricesheetDownloadByBillingProfile. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByInvoiceSamples.java similarity index 56% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadSamples.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByInvoiceSamples.java index db17121e6ea9..56c752f35aa6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetDownloadByInvoiceSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; /** - * Samples for PriceSheet Download. + * Samples for PriceSheet DownloadByInvoice. */ -public final class PriceSheetDownloadSamples { +public final class PriceSheetDownloadByInvoiceSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PricesheetDownload.json + * x-ms-original-file: 2026-06-01/PricesheetDownload.json */ /** * Sample code: PricesheetDownload. @@ -20,7 +18,7 @@ public final class PriceSheetDownloadSamples { */ public static void pricesheetDownload(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { manager.priceSheets() - .download("7c05a543-80ff-571e-9f98-1063b3b53cf2:99ad03ad-2d1b-4889-a452-090ad407d25f_2019-05-31", + .downloadByInvoice("7c05a543-80ff-571e-9f98-1063b3b53cf2:99ad03ad-2d1b-4889-a452-090ad407d25f_2019-05-31", "2USN-TPCD-BG7-TGB", "T000940677", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageByExternalCloudProviderTypeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageByExternalCloudProviderTypeSamples.java index 2e7d21252a31..36a167f2b2f5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageByExternalCloudProviderTypeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageByExternalCloudProviderTypeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -20,9 +20,7 @@ */ public final class QueryUsageByExternalCloudProviderTypeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalSubscriptionsQuery.json + * x-ms-original-file: 2026-06-01/ExternalSubscriptionsQuery.json */ /** * Sample code: ExternalSubscriptionsQuery. @@ -53,9 +51,7 @@ public final class QueryUsageByExternalCloudProviderTypeSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ExternalBillingAccountsQuery.json + * x-ms-original-file: 2026-06-01/ExternalBillingAccountsQuery.json */ /** * Sample code: ExternalBillingAccountQueryList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageSamples.java index c50128d8c37c..c8bb2574e6c0 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/QueryUsageSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -25,9 +25,7 @@ */ public final class QueryUsageSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionQueryGrouping.json + * x-ms-original-file: 2026-06-01/SubscriptionQueryGrouping.json */ /** * Sample code: SubscriptionQueryGrouping-Legacy. @@ -49,9 +47,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountQueryGrouping.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountQueryGrouping.json */ /** * Sample code: EnrollmentAccountQueryGrouping-Legacy. @@ -73,9 +69,7 @@ public final class QueryUsageSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentQuery.json + * x-ms-original-file: 2026-06-01/DepartmentQuery.json */ /** * Sample code: DepartmentQuery-Legacy. @@ -105,9 +99,29 @@ public static void departmentQueryLegacy(com.azure.resourcemanager.costmanagemen } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountQuery.json + * x-ms-original-file: 2026-06-01/BillingAccountQueryGrouping.json + */ + /** + * Sample code: BillingAccountQueryGrouping-Legacy. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + billingAccountQueryGroupingLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.queries() + .usageWithResponse("providers/Microsoft.Billing/billingAccounts/70664866", + new QueryDefinition().withType(ExportType.USAGE) + .withTimeframe(TimeframeType.THE_LAST_MONTH) + .withDataset(new QueryDataset().withGranularity(GranularityType.fromString("None")) + .withAggregation(mapOf("totalCost", + new QueryAggregation().withName("PreTaxCost").withFunction(FunctionType.SUM))) + .withGrouping(Arrays.asList( + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("ResourceGroup")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/MCABillingAccountQuery.json */ /** * Sample code: BillingAccountQuery-MCA. @@ -137,33 +151,7 @@ public static void billingAccountQueryMCA(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountQueryGrouping.json - */ - /** - * Sample code: BillingAccountQueryGrouping-Legacy. - * - * @param manager Entry point to CostManagementManager. - */ - public static void - billingAccountQueryGroupingLegacy(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { - manager.queries() - .usageWithResponse("providers/Microsoft.Billing/billingAccounts/70664866", - new QueryDefinition().withType(ExportType.USAGE) - .withTimeframe(TimeframeType.THE_LAST_MONTH) - .withDataset(new QueryDataset().withGranularity(GranularityType.fromString("None")) - .withAggregation(mapOf("totalCost", - new QueryAggregation().withName("PreTaxCost").withFunction(FunctionType.SUM))) - .withGrouping(Arrays.asList( - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("ResourceGroup")))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * SubscriptionQuery.json + * x-ms-original-file: 2026-06-01/SubscriptionQuery.json */ /** * Sample code: SubscriptionQuery-Legacy. @@ -193,9 +181,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingAccountQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCABillingAccountQueryGrouping.json */ /** * Sample code: BillingAccountQueryGrouping-MCA. @@ -217,9 +203,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionQueryGrouping.json */ /** * Sample code: InvoiceSectionQueryGrouping-MCA. @@ -242,9 +226,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * EnrollmentAccountQuery.json + * x-ms-original-file: 2026-06-01/EnrollmentAccountQuery.json */ /** * Sample code: EnrollmentAccountQuery-Legacy. @@ -275,9 +257,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupQueryGrouping.json + * x-ms-original-file: 2026-06-01/ResourceGroupQueryGrouping.json */ /** * Sample code: ResourceGroupQueryGrouping-Legacy. @@ -300,9 +280,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * BillingAccountQuery.json + * x-ms-original-file: 2026-06-01/BillingAccountQuery.json */ /** * Sample code: BillingAccountQuery-Legacy. @@ -333,9 +311,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCABillingProfileQueryGrouping.json */ /** * Sample code: BillingProfileQueryGrouping-MCA. @@ -357,9 +333,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ResourceGroupQuery.json + * x-ms-original-file: 2026-06-01/ResourceGroupQuery.json */ /** * Sample code: ResourceGroupQuery-Legacy. @@ -391,9 +365,7 @@ public static void subscriptionQueryLegacy(com.azure.resourcemanager.costmanagem } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCAInvoiceSectionQuery.json + * x-ms-original-file: 2026-06-01/MCAInvoiceSectionQuery.json */ /** * Sample code: InvoiceSectionQuery-MCA. @@ -424,9 +396,7 @@ public static void invoiceSectionQueryMCA(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerQuery.json + * x-ms-original-file: 2026-06-01/MCACustomerQuery.json */ /** * Sample code: CustomerQuery-MCA. @@ -456,9 +426,7 @@ public static void customerQueryMCA(com.azure.resourcemanager.costmanagement.Cos } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupQuery.json + * x-ms-original-file: 2026-06-01/ManagementGroupQuery.json */ /** * Sample code: ManagementGroupQuery-Legacy. @@ -489,9 +457,7 @@ public static void customerQueryMCA(com.azure.resourcemanager.costmanagement.Cos } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * DepartmentQueryGrouping.json + * x-ms-original-file: 2026-06-01/DepartmentQueryGrouping.json */ /** * Sample code: DepartmentQueryGrouping-Legacy. @@ -513,9 +479,7 @@ public static void customerQueryMCA(com.azure.resourcemanager.costmanagement.Cos } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCABillingProfileQuery.json + * x-ms-original-file: 2026-06-01/MCABillingProfileQuery.json */ /** * Sample code: BillingProfileQuery-MCA. @@ -545,9 +509,7 @@ public static void billingProfileQueryMCA(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ManagementGroupQueryGrouping.json + * x-ms-original-file: 2026-06-01/ManagementGroupQueryGrouping.json */ /** * Sample code: ManagementGroupQueryGrouping-Legacy. @@ -569,9 +531,7 @@ public static void billingProfileQueryMCA(com.azure.resourcemanager.costmanageme } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * MCACustomerQueryGrouping.json + * x-ms-original-file: 2026-06-01/MCACustomerQueryGrouping.json */ /** * Sample code: CustomerQueryGrouping-MCA. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeSamples.java index 9e60e488676b..2562737bfad9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,9 +11,7 @@ */ public final class ScheduledActionsCheckNameAvailabilityByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/checkNameAvailability-shared-scheduledAction.json + * x-ms-original-file: 2026-06-01/scheduledActions/checkNameAvailability-shared-scheduledAction.json */ /** * Sample code: ScheduledActionCheckNameAvailabilityByScope. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilitySamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilitySamples.java index 811510845070..9ad0e8ed341d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilitySamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,9 +11,7 @@ */ public final class ScheduledActionsCheckNameAvailabilitySamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/checkNameAvailability-private-scheduledAction.json + * x-ms-original-file: 2026-06-01/scheduledActions/checkNameAvailability-private-scheduledAction.json */ /** * Sample code: ScheduledActionCheckNameAvailability. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeSamples.java index 03c2d94a5a30..2d877fb3292a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -21,9 +21,7 @@ */ public final class ScheduledActionsCreateOrUpdateByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-createOrUpdate-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-createOrUpdate-shared.json */ /** * Sample code: CreateOrUpdateScheduledActionByScope. @@ -53,9 +51,7 @@ public final class ScheduledActionsCreateOrUpdateByScopeSamples { } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json */ /** * Sample code: CreateOrUpdateInsightAlertScheduledActionByScope. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateSamples.java index 0e4a4272cf9b..cce735618de9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -20,9 +20,7 @@ */ public final class ScheduledActionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-createOrUpdate-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-createOrUpdate-private.json */ /** * Sample code: CreateOrUpdatePrivateScheduledAction. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeSamples.java index e5b2fdfadf2e..ace904601ddc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsDeleteByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-delete-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-delete-shared.json */ /** * Sample code: ScheduledActionDeleteByScope. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteSamples.java index d8bc421a3d46..7b106340d743 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-delete-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-delete-private.json */ /** * Sample code: PrivateScheduledActionDelete. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeSamples.java index cb759b6e312a..53084f795d11 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsGetByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-get-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-get-shared.json */ /** * Sample code: ScheduledActionByScope. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetSamples.java index 3447d1b65ebe..839047ec3a30 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-get-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-get-private.json */ /** * Sample code: PrivateScheduledAction. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeSamples.java index 34a1ddc75da4..5fe3233756d6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsListByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-listWithFilter-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-listWithFilter-shared.json */ /** * Sample code: ScheduledActionsListByScopeFilterByViewId. @@ -27,9 +25,7 @@ public static void scheduledActionsListByScopeFilterByViewId( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-list-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-list-shared.json */ /** * Sample code: ScheduledActionsListByScope. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListSamples.java index c280922c5eff..c6f051d66323 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-listWithFilter-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-listWithFilter-private.json */ /** * Sample code: PrivateScheduledActionsListFilterByViewId. @@ -26,9 +24,7 @@ public static void privateScheduledActionsListFilterByViewId( } /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledActions-list-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledActions-list-private.json */ /** * Sample code: PrivateScheduledActionsList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeSamples.java index 49995db62e3c..974a06d94653 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsRunByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-sendNow-shared.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-sendNow-shared.json */ /** * Sample code: ScheduledActionRunByScope. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunSamples.java index 97fa49cd858b..4374d813652c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ScheduledActionsRunSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * scheduledActions/scheduledAction-sendNow-private.json + * x-ms-original-file: 2026-06-01/scheduledActions/scheduledAction-sendNow-private.json */ /** * Sample code: ScheduledActionSendNow. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsCreateOrUpdateByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsCreateOrUpdateByScopeSamples.java new file mode 100644 index 000000000000..4fce4f6ad273 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsCreateOrUpdateByScopeSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.SettingType; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceProperties; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceSetting; + +/** + * Samples for Settings CreateOrUpdateByScope. + */ +public final class SettingsCreateOrUpdateByScopeSamples { + /* + * x-ms-original-file: 2026-06-01/settings-createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdateSettingByScope. + * + * @param manager Entry point to CostManagementManager. + */ + public static void + createOrUpdateSettingByScope(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .createOrUpdateByScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", + SettingType.TAGINHERITANCE, new TagInheritanceSetting().withProperties( + new TagInheritanceProperties().withPreferContainerTags(false)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsDeleteByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsDeleteByScopeSamples.java new file mode 100644 index 000000000000..db03955aa6f8 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsDeleteByScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.SettingType; + +/** + * Samples for Settings DeleteByScope. + */ +public final class SettingsDeleteByScopeSamples { + /* + * x-ms-original-file: 2026-06-01/setting-delete.json + */ + /** + * Sample code: SettingDeleteByScope. + * + * @param manager Entry point to CostManagementManager. + */ + public static void settingDeleteByScope(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .deleteByScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", SettingType.TAGINHERITANCE, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsGetByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsGetByScopeSamples.java new file mode 100644 index 000000000000..c442e255b329 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsGetByScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.resourcemanager.costmanagement.models.SettingType; + +/** + * Samples for Settings GetByScope. + */ +public final class SettingsGetByScopeSamples { + /* + * x-ms-original-file: 2026-06-01/setting-get.json + */ + /** + * Sample code: SettingByScope. + * + * @param manager Entry point to CostManagementManager. + */ + public static void settingByScope(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .getByScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", SettingType.TAGINHERITANCE, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsListSamples.java new file mode 100644 index 000000000000..f228e265cf14 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/SettingsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +/** + * Samples for Settings List. + */ +public final class SettingsListSamples { + /* + * x-ms-original-file: 2026-06-01/settingsList.json + */ + /** + * Sample code: SettingsList. + * + * @param manager Entry point to CostManagementManager. + */ + public static void settingsList(com.azure.resourcemanager.costmanagement.CostManagementManager manager) { + manager.settings() + .listWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeSamples.java index 1821b07569ef..944606a4b468 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -28,9 +28,7 @@ */ public final class ViewsCreateOrUpdateByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewCreateOrUpdateByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewCreateOrUpdateByResourceGroup.json */ /** * Sample code: ResourceGroupCreateOrUpdateView. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateSamples.java index 7b0a1cad28ac..eb4bd0dca04f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -29,9 +29,7 @@ */ public final class ViewsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PrivateViewCreateOrUpdate.json + * x-ms-original-file: 2026-06-01/PrivateViewCreateOrUpdate.json */ /** * Sample code: CreateOrUpdatePrivateView. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeSamples.java index 6acc4e95acc4..293a86849137 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ViewsDeleteByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewDeleteByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewDeleteByResourceGroup.json */ /** * Sample code: ResourceGroupDeleteView. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteSamples.java index 34eae5b0bad0..40fd1b243145 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ViewsDeleteSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PrivateViewDelete.json + * x-ms-original-file: 2026-06-01/PrivateViewDelete.json */ /** * Sample code: DeletePrivateView. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeSamples.java index cdd153523ced..cd78e69d1d0c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ViewsGetByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewByResourceGroup.json */ /** * Sample code: ResourceGroupView. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetSamples.java index 6594068fa822..70e85178acbd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ViewsGetSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateView. - * json + * x-ms-original-file: 2026-06-01/PrivateView.json */ /** * Sample code: PrivateView. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeSamples.java index f2aaa086ca8f..3e2aa527d941 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ViewsListByScopeSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * ViewListByResourceGroup.json + * x-ms-original-file: 2026-06-01/ViewListByResourceGroup.json */ /** * Sample code: ResourceGroupViewList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListSamples.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListSamples.java index 3a24ce8f8e1a..ab0998ee7094 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListSamples.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/samples/java/com/azure/resourcemanager/costmanagement/generated/ViewsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,9 +9,7 @@ */ public final class ViewsListSamples { /* - * x-ms-original-file: - * specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ - * PrivateViewList.json + * x-ms-original-file: 2026-06-01/PrivateViewList.json */ /** * Sample code: PrivateViewList. diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertInnerTests.java index df53b149bcfc..0cd42c9a9c3a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -9,111 +9,49 @@ import com.azure.resourcemanager.costmanagement.models.AlertCategory; import com.azure.resourcemanager.costmanagement.models.AlertCriteria; import com.azure.resourcemanager.costmanagement.models.AlertOperator; -import com.azure.resourcemanager.costmanagement.models.AlertPropertiesDefinition; -import com.azure.resourcemanager.costmanagement.models.AlertPropertiesDetails; import com.azure.resourcemanager.costmanagement.models.AlertSource; import com.azure.resourcemanager.costmanagement.models.AlertStatus; import com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType; import com.azure.resourcemanager.costmanagement.models.AlertType; -import java.util.Arrays; +import java.math.BigDecimal; import org.junit.jupiter.api.Assertions; public final class AlertInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertInner model = BinaryData.fromString( - "{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Billing\",\"criteria\":\"MultiCurrency\"},\"description\":\"tndoaongbjc\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"BillingAnnual\",\"periodStartDate\":\"jed\",\"triggeredBy\":\"wwa\",\"resourceGroupFilter\":[\"dataojvdcpzfoqo\",\"datai\"],\"resourceFilter\":[\"dataxarzgszufoxciq\",\"datap\",\"datadoamciodhkha\",\"dataxkhnzbonlwnto\"],\"meterFilter\":[\"datakdwbwhkszz\",\"datamrv\"],\"tagFilter\":\"dataztvbtqgsfr\",\"operator\":\"GreaterThan\",\"unit\":\"owtlmnguxawqald\",\"contactEmails\":[\"ximerqfobwyznk\",\"ykutwpf\",\"pagmhrskdsnf\"],\"contactGroups\":[\"oakgtdlmkkzev\",\"l\",\"ewpusdsttwvogvb\",\"ejdcngqqmoakuf\"],\"contactRoles\":[\"zr\",\"rdgrtw\",\"enuuzkopbm\"],\"overridingAlert\":\"rfdwoyu\",\"departmentName\":\"ziuiefozbhdm\",\"companyName\":\"l\",\"enrollmentNumber\":\"qhoftrmaequiah\",\"enrollmentStartDate\":\"cslfaoqzpiyylha\",\"enrollmentEndDate\":\"swhccsphk\"},\"costEntityId\":\"witqscywuggwoluh\",\"status\":\"None\",\"creationTime\":\"emh\",\"closeTime\":\"rsbrgzdwm\",\"modificationTime\":\"eypqwdxggicccn\",\"statusModificationUserName\":\"huexmk\",\"statusModificationTime\":\"lstvlzywe\"},\"eTag\":\"zrncsdt\",\"id\":\"lusiy\",\"name\":\"bsfgytguslfea\",\"type\":\"cy\"}") + "{\"properties\":{\"definition\":{\"type\":\"Credit\",\"category\":\"Cost\",\"criteria\":\"GeneralThresholdError\"},\"description\":\"rqemvvhmxt\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"BillingMonth\",\"periodStartDate\":\"coebjvewzcj\",\"triggeredBy\":\"m\",\"resourceGroupFilter\":[\"\\\"datamguaadraufa\\\"\",\"\\\"datatkahzo\\\"\",\"\\\"dataajjziuxxpshne\\\"\",\"\\\"datakulfg\\\"\"],\"resourceFilter\":[\"\\\"dataubkwdle\\\"\",\"\\\"datards\\\"\"],\"meterFilter\":[\"\\\"datajbazpjuohminy\\\"\",\"\\\"datalnorwmdu\\\"\",\"\\\"datawpklvxw\\\"\",\"\\\"dataygdxpgpqchis\\\"\"],\"tagFilter\":\"\\\"datapnnbjc\\\"\",\"threshold\":8305188180696356392,\"operator\":\"GreaterThanOrEqualTo\",\"amount\":2562090437731221877,\"unit\":\"onfo\",\"currentSpend\":4529300263395127628,\"contactEmails\":[\"ukokwbqplhlvn\",\"uepzl\",\"phwzsoldweyuqdu\"],\"contactGroups\":[\"nnrwrbiork\",\"alywjhhgdn\"],\"contactRoles\":[\"sivfomilo\"],\"overridingAlert\":\"gdufiqnd\",\"departmentName\":\"uzaofjchvcyyy\",\"companyName\":\"gdotcubiipuipwo\",\"enrollmentNumber\":\"nmacj\",\"enrollmentStartDate\":\"nizshqvcim\",\"enrollmentEndDate\":\"vfgmblrrilby\",\"invoicingThreshold\":6657975485404354402},\"costEntityId\":\"icc\",\"status\":\"Resolved\",\"creationTime\":\"scjfnyns\",\"closeTime\":\"ujiz\",\"modificationTime\":\"oqytibyowbblgy\",\"statusModificationUserName\":\"utp\",\"statusModificationTime\":\"joxoism\"},\"eTag\":\"sbpimlq\",\"id\":\"jxkcgxxlxsff\",\"name\":\"cvizqzdwlvw\",\"type\":\"youpfgfbkj\"}") .toObject(AlertInner.class); - Assertions.assertEquals("zrncsdt", model.etag()); - Assertions.assertEquals(AlertType.QUOTA, model.definition().type()); - Assertions.assertEquals(AlertCategory.BILLING, model.definition().category()); - Assertions.assertEquals(AlertCriteria.MULTI_CURRENCY, model.definition().criteria()); - Assertions.assertEquals("tndoaongbjc", model.description()); + Assertions.assertEquals("sbpimlq", model.etag()); + Assertions.assertEquals(AlertType.CREDIT, model.definition().type()); + Assertions.assertEquals(AlertCategory.COST, model.definition().category()); + Assertions.assertEquals(AlertCriteria.GENERAL_THRESHOLD_ERROR, model.definition().criteria()); + Assertions.assertEquals("rqemvvhmxt", model.description()); Assertions.assertEquals(AlertSource.USER, model.source()); - Assertions.assertEquals(AlertTimeGrainType.BILLING_ANNUAL, model.details().timeGrainType()); - Assertions.assertEquals("jed", model.details().periodStartDate()); - Assertions.assertEquals("wwa", model.details().triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN, model.details().operator()); - Assertions.assertEquals("owtlmnguxawqald", model.details().unit()); - Assertions.assertEquals("ximerqfobwyznk", model.details().contactEmails().get(0)); - Assertions.assertEquals("oakgtdlmkkzev", model.details().contactGroups().get(0)); - Assertions.assertEquals("zr", model.details().contactRoles().get(0)); - Assertions.assertEquals("rfdwoyu", model.details().overridingAlert()); - Assertions.assertEquals("ziuiefozbhdm", model.details().departmentName()); - Assertions.assertEquals("l", model.details().companyName()); - Assertions.assertEquals("qhoftrmaequiah", model.details().enrollmentNumber()); - Assertions.assertEquals("cslfaoqzpiyylha", model.details().enrollmentStartDate()); - Assertions.assertEquals("swhccsphk", model.details().enrollmentEndDate()); - Assertions.assertEquals("witqscywuggwoluh", model.costEntityId()); - Assertions.assertEquals(AlertStatus.NONE, model.status()); - Assertions.assertEquals("emh", model.creationTime()); - Assertions.assertEquals("rsbrgzdwm", model.closeTime()); - Assertions.assertEquals("eypqwdxggicccn", model.modificationTime()); - Assertions.assertEquals("huexmk", model.statusModificationUsername()); - Assertions.assertEquals("lstvlzywe", model.statusModificationTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertInner model = new AlertInner().withEtag("zrncsdt") - .withDefinition(new AlertPropertiesDefinition().withType(AlertType.QUOTA) - .withCategory(AlertCategory.BILLING) - .withCriteria(AlertCriteria.MULTI_CURRENCY)) - .withDescription("tndoaongbjc") - .withSource(AlertSource.USER) - .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.BILLING_ANNUAL) - .withPeriodStartDate("jed") - .withTriggeredBy("wwa") - .withResourceGroupFilter(Arrays.asList("dataojvdcpzfoqo", "datai")) - .withResourceFilter( - Arrays.asList("dataxarzgszufoxciq", "datap", "datadoamciodhkha", "dataxkhnzbonlwnto")) - .withMeterFilter(Arrays.asList("datakdwbwhkszz", "datamrv")) - .withTagFilter("dataztvbtqgsfr") - .withOperator(AlertOperator.GREATER_THAN) - .withUnit("owtlmnguxawqald") - .withContactEmails(Arrays.asList("ximerqfobwyznk", "ykutwpf", "pagmhrskdsnf")) - .withContactGroups(Arrays.asList("oakgtdlmkkzev", "l", "ewpusdsttwvogvb", "ejdcngqqmoakuf")) - .withContactRoles(Arrays.asList("zr", "rdgrtw", "enuuzkopbm")) - .withOverridingAlert("rfdwoyu") - .withDepartmentName("ziuiefozbhdm") - .withCompanyName("l") - .withEnrollmentNumber("qhoftrmaequiah") - .withEnrollmentStartDate("cslfaoqzpiyylha") - .withEnrollmentEndDate("swhccsphk")) - .withCostEntityId("witqscywuggwoluh") - .withStatus(AlertStatus.NONE) - .withCreationTime("emh") - .withCloseTime("rsbrgzdwm") - .withModificationTime("eypqwdxggicccn") - .withStatusModificationUsername("huexmk") - .withStatusModificationTime("lstvlzywe"); - model = BinaryData.fromObject(model).toObject(AlertInner.class); - Assertions.assertEquals("zrncsdt", model.etag()); - Assertions.assertEquals(AlertType.QUOTA, model.definition().type()); - Assertions.assertEquals(AlertCategory.BILLING, model.definition().category()); - Assertions.assertEquals(AlertCriteria.MULTI_CURRENCY, model.definition().criteria()); - Assertions.assertEquals("tndoaongbjc", model.description()); - Assertions.assertEquals(AlertSource.USER, model.source()); - Assertions.assertEquals(AlertTimeGrainType.BILLING_ANNUAL, model.details().timeGrainType()); - Assertions.assertEquals("jed", model.details().periodStartDate()); - Assertions.assertEquals("wwa", model.details().triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN, model.details().operator()); - Assertions.assertEquals("owtlmnguxawqald", model.details().unit()); - Assertions.assertEquals("ximerqfobwyznk", model.details().contactEmails().get(0)); - Assertions.assertEquals("oakgtdlmkkzev", model.details().contactGroups().get(0)); - Assertions.assertEquals("zr", model.details().contactRoles().get(0)); - Assertions.assertEquals("rfdwoyu", model.details().overridingAlert()); - Assertions.assertEquals("ziuiefozbhdm", model.details().departmentName()); - Assertions.assertEquals("l", model.details().companyName()); - Assertions.assertEquals("qhoftrmaequiah", model.details().enrollmentNumber()); - Assertions.assertEquals("cslfaoqzpiyylha", model.details().enrollmentStartDate()); - Assertions.assertEquals("swhccsphk", model.details().enrollmentEndDate()); - Assertions.assertEquals("witqscywuggwoluh", model.costEntityId()); - Assertions.assertEquals(AlertStatus.NONE, model.status()); - Assertions.assertEquals("emh", model.creationTime()); - Assertions.assertEquals("rsbrgzdwm", model.closeTime()); - Assertions.assertEquals("eypqwdxggicccn", model.modificationTime()); - Assertions.assertEquals("huexmk", model.statusModificationUsername()); - Assertions.assertEquals("lstvlzywe", model.statusModificationTime()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_MONTH, model.details().timeGrainType()); + Assertions.assertEquals("coebjvewzcj", model.details().periodStartDate()); + Assertions.assertEquals("m", model.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("8305188180696356392"), model.details().threshold()); + Assertions.assertEquals(AlertOperator.GREATER_THAN_OR_EQUAL_TO, model.details().operator()); + Assertions.assertEquals(new BigDecimal("2562090437731221877"), model.details().amount()); + Assertions.assertEquals("onfo", model.details().unit()); + Assertions.assertEquals(new BigDecimal("4529300263395127628"), model.details().currentSpend()); + Assertions.assertEquals("ukokwbqplhlvn", model.details().contactEmails().get(0)); + Assertions.assertEquals("nnrwrbiork", model.details().contactGroups().get(0)); + Assertions.assertEquals("sivfomilo", model.details().contactRoles().get(0)); + Assertions.assertEquals("gdufiqnd", model.details().overridingAlert()); + Assertions.assertEquals("uzaofjchvcyyy", model.details().departmentName()); + Assertions.assertEquals("gdotcubiipuipwo", model.details().companyName()); + Assertions.assertEquals("nmacj", model.details().enrollmentNumber()); + Assertions.assertEquals("nizshqvcim", model.details().enrollmentStartDate()); + Assertions.assertEquals("vfgmblrrilby", model.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("6657975485404354402"), model.details().invoicingThreshold()); + Assertions.assertEquals("icc", model.costEntityId()); + Assertions.assertEquals(AlertStatus.RESOLVED, model.status()); + Assertions.assertEquals("scjfnyns", model.creationTime()); + Assertions.assertEquals("ujiz", model.closeTime()); + Assertions.assertEquals("oqytibyowbblgy", model.modificationTime()); + Assertions.assertEquals("utp", model.statusModificationUsername()); + Assertions.assertEquals("joxoism", model.statusModificationTime()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDefinitionTests.java index cbb67d47f067..4ffec09dcb35 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -16,21 +16,21 @@ public final class AlertPropertiesDefinitionTests { public void testDeserialize() throws Exception { AlertPropertiesDefinition model = BinaryData .fromString( - "{\"type\":\"BudgetForecast\",\"category\":\"Billing\",\"criteria\":\"UsageThresholdExceeded\"}") + "{\"type\":\"General\",\"category\":\"System\",\"criteria\":\"ForecastUsageThresholdExceeded\"}") .toObject(AlertPropertiesDefinition.class); - Assertions.assertEquals(AlertType.BUDGET_FORECAST, model.type()); - Assertions.assertEquals(AlertCategory.BILLING, model.category()); - Assertions.assertEquals(AlertCriteria.USAGE_THRESHOLD_EXCEEDED, model.criteria()); + Assertions.assertEquals(AlertType.GENERAL, model.type()); + Assertions.assertEquals(AlertCategory.SYSTEM, model.category()); + Assertions.assertEquals(AlertCriteria.FORECAST_USAGE_THRESHOLD_EXCEEDED, model.criteria()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AlertPropertiesDefinition model = new AlertPropertiesDefinition().withType(AlertType.BUDGET_FORECAST) - .withCategory(AlertCategory.BILLING) - .withCriteria(AlertCriteria.USAGE_THRESHOLD_EXCEEDED); + AlertPropertiesDefinition model = new AlertPropertiesDefinition().withType(AlertType.GENERAL) + .withCategory(AlertCategory.SYSTEM) + .withCriteria(AlertCriteria.FORECAST_USAGE_THRESHOLD_EXCEEDED); model = BinaryData.fromObject(model).toObject(AlertPropertiesDefinition.class); - Assertions.assertEquals(AlertType.BUDGET_FORECAST, model.type()); - Assertions.assertEquals(AlertCategory.BILLING, model.category()); - Assertions.assertEquals(AlertCriteria.USAGE_THRESHOLD_EXCEEDED, model.criteria()); + Assertions.assertEquals(AlertType.GENERAL, model.type()); + Assertions.assertEquals(AlertCategory.SYSTEM, model.category()); + Assertions.assertEquals(AlertCriteria.FORECAST_USAGE_THRESHOLD_EXCEEDED, model.criteria()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDetailsTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDetailsTests.java index c1f677082621..84e09b08c3c1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDetailsTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -8,6 +8,7 @@ import com.azure.resourcemanager.costmanagement.models.AlertOperator; import com.azure.resourcemanager.costmanagement.models.AlertPropertiesDetails; import com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType; +import java.math.BigDecimal; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -15,58 +16,71 @@ public final class AlertPropertiesDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertPropertiesDetails model = BinaryData.fromString( - "{\"timeGrainType\":\"None\",\"periodStartDate\":\"wutwbdsre\",\"triggeredBy\":\"drhneuyow\",\"resourceGroupFilter\":[\"datawyt\"],\"resourceFilter\":[\"databi\"],\"meterFilter\":[\"datapikpz\",\"datamejzanlfzxia\",\"datarmbzo\"],\"tagFilter\":\"datakixrj\",\"operator\":\"GreaterThan\",\"unit\":\"pfrlazsz\",\"contactEmails\":[\"iin\",\"fpwpjylwbt\",\"h\"],\"contactGroups\":[\"jcdh\"],\"contactRoles\":[\"jvfbgofelja\",\"rqmq\",\"ldvriiiojnalghfk\",\"tvsexsowuel\"],\"overridingAlert\":\"hhahhxvrhmzkwpjg\",\"departmentName\":\"spughftqsxhq\",\"companyName\":\"j\",\"enrollmentNumber\":\"kndxdigrjgu\",\"enrollmentStartDate\":\"zdmsyqtfi\",\"enrollmentEndDate\":\"hbotzingamvppho\"}") + "{\"timeGrainType\":\"None\",\"periodStartDate\":\"xsspuunnoxyhk\",\"triggeredBy\":\"qddrihpfhoqcaae\",\"resourceGroupFilter\":[\"\\\"dataomdjvlpjxxkzbrm\\\"\",\"\\\"datageivsiykzkdncj\\\"\",\"\\\"dataxonbzoggculapz\\\"\"],\"resourceFilter\":[\"\\\"datapgogtqxepny\\\"\",\"\\\"datab\\\"\",\"\\\"datauajlyj\\\"\"],\"meterFilter\":[\"\\\"dataof\\\"\",\"\\\"datazhvfcibyfmowuxr\\\"\",\"\\\"datajpvd\\\"\"],\"tagFilter\":\"\\\"datafzwiivwzjbhyz\\\"\",\"threshold\":7980088587869256386,\"operator\":\"None\",\"amount\":9059402645056682319,\"unit\":\"negvmnvuqe\",\"currentSpend\":2749298665245055731,\"contactEmails\":[\"astjbkkdmflvestm\"],\"contactGroups\":[\"rriloz\",\"peewchpxlkt\",\"kuziycsle\"],\"contactRoles\":[\"uztcktyhjtqed\"],\"overridingAlert\":\"zulwmmrqzzrrj\",\"departmentName\":\"gl\",\"companyName\":\"zgkrvqe\",\"enrollmentNumber\":\"toepryu\",\"enrollmentStartDate\":\"wytpzdmovz\",\"enrollmentEndDate\":\"va\",\"invoicingThreshold\":5762318821070870686}") .toObject(AlertPropertiesDetails.class); Assertions.assertEquals(AlertTimeGrainType.NONE, model.timeGrainType()); - Assertions.assertEquals("wutwbdsre", model.periodStartDate()); - Assertions.assertEquals("drhneuyow", model.triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN, model.operator()); - Assertions.assertEquals("pfrlazsz", model.unit()); - Assertions.assertEquals("iin", model.contactEmails().get(0)); - Assertions.assertEquals("jcdh", model.contactGroups().get(0)); - Assertions.assertEquals("jvfbgofelja", model.contactRoles().get(0)); - Assertions.assertEquals("hhahhxvrhmzkwpjg", model.overridingAlert()); - Assertions.assertEquals("spughftqsxhq", model.departmentName()); - Assertions.assertEquals("j", model.companyName()); - Assertions.assertEquals("kndxdigrjgu", model.enrollmentNumber()); - Assertions.assertEquals("zdmsyqtfi", model.enrollmentStartDate()); - Assertions.assertEquals("hbotzingamvppho", model.enrollmentEndDate()); + Assertions.assertEquals("xsspuunnoxyhk", model.periodStartDate()); + Assertions.assertEquals("qddrihpfhoqcaae", model.triggeredBy()); + Assertions.assertEquals(new BigDecimal("7980088587869256386"), model.threshold()); + Assertions.assertEquals(AlertOperator.NONE, model.operator()); + Assertions.assertEquals(new BigDecimal("9059402645056682319"), model.amount()); + Assertions.assertEquals("negvmnvuqe", model.unit()); + Assertions.assertEquals(new BigDecimal("2749298665245055731"), model.currentSpend()); + Assertions.assertEquals("astjbkkdmflvestm", model.contactEmails().get(0)); + Assertions.assertEquals("rriloz", model.contactGroups().get(0)); + Assertions.assertEquals("uztcktyhjtqed", model.contactRoles().get(0)); + Assertions.assertEquals("zulwmmrqzzrrj", model.overridingAlert()); + Assertions.assertEquals("gl", model.departmentName()); + Assertions.assertEquals("zgkrvqe", model.companyName()); + Assertions.assertEquals("toepryu", model.enrollmentNumber()); + Assertions.assertEquals("wytpzdmovz", model.enrollmentStartDate()); + Assertions.assertEquals("va", model.enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("5762318821070870686"), model.invoicingThreshold()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AlertPropertiesDetails model = new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.NONE) - .withPeriodStartDate("wutwbdsre") - .withTriggeredBy("drhneuyow") - .withResourceGroupFilter(Arrays.asList("datawyt")) - .withResourceFilter(Arrays.asList("databi")) - .withMeterFilter(Arrays.asList("datapikpz", "datamejzanlfzxia", "datarmbzo")) - .withTagFilter("datakixrj") - .withOperator(AlertOperator.GREATER_THAN) - .withUnit("pfrlazsz") - .withContactEmails(Arrays.asList("iin", "fpwpjylwbt", "h")) - .withContactGroups(Arrays.asList("jcdh")) - .withContactRoles(Arrays.asList("jvfbgofelja", "rqmq", "ldvriiiojnalghfk", "tvsexsowuel")) - .withOverridingAlert("hhahhxvrhmzkwpjg") - .withDepartmentName("spughftqsxhq") - .withCompanyName("j") - .withEnrollmentNumber("kndxdigrjgu") - .withEnrollmentStartDate("zdmsyqtfi") - .withEnrollmentEndDate("hbotzingamvppho"); + .withPeriodStartDate("xsspuunnoxyhk") + .withTriggeredBy("qddrihpfhoqcaae") + .withResourceGroupFilter( + Arrays.asList("\"dataomdjvlpjxxkzbrm\"", "\"datageivsiykzkdncj\"", "\"dataxonbzoggculapz\"")) + .withResourceFilter(Arrays.asList("\"datapgogtqxepny\"", "\"datab\"", "\"datauajlyj\"")) + .withMeterFilter(Arrays.asList("\"dataof\"", "\"datazhvfcibyfmowuxr\"", "\"datajpvd\"")) + .withTagFilter("\"datafzwiivwzjbhyz\"") + .withThreshold(new BigDecimal("7980088587869256386")) + .withOperator(AlertOperator.NONE) + .withAmount(new BigDecimal("9059402645056682319")) + .withUnit("negvmnvuqe") + .withCurrentSpend(new BigDecimal("2749298665245055731")) + .withContactEmails(Arrays.asList("astjbkkdmflvestm")) + .withContactGroups(Arrays.asList("rriloz", "peewchpxlkt", "kuziycsle")) + .withContactRoles(Arrays.asList("uztcktyhjtqed")) + .withOverridingAlert("zulwmmrqzzrrj") + .withDepartmentName("gl") + .withCompanyName("zgkrvqe") + .withEnrollmentNumber("toepryu") + .withEnrollmentStartDate("wytpzdmovz") + .withEnrollmentEndDate("va") + .withInvoicingThreshold(new BigDecimal("5762318821070870686")); model = BinaryData.fromObject(model).toObject(AlertPropertiesDetails.class); Assertions.assertEquals(AlertTimeGrainType.NONE, model.timeGrainType()); - Assertions.assertEquals("wutwbdsre", model.periodStartDate()); - Assertions.assertEquals("drhneuyow", model.triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN, model.operator()); - Assertions.assertEquals("pfrlazsz", model.unit()); - Assertions.assertEquals("iin", model.contactEmails().get(0)); - Assertions.assertEquals("jcdh", model.contactGroups().get(0)); - Assertions.assertEquals("jvfbgofelja", model.contactRoles().get(0)); - Assertions.assertEquals("hhahhxvrhmzkwpjg", model.overridingAlert()); - Assertions.assertEquals("spughftqsxhq", model.departmentName()); - Assertions.assertEquals("j", model.companyName()); - Assertions.assertEquals("kndxdigrjgu", model.enrollmentNumber()); - Assertions.assertEquals("zdmsyqtfi", model.enrollmentStartDate()); - Assertions.assertEquals("hbotzingamvppho", model.enrollmentEndDate()); + Assertions.assertEquals("xsspuunnoxyhk", model.periodStartDate()); + Assertions.assertEquals("qddrihpfhoqcaae", model.triggeredBy()); + Assertions.assertEquals(new BigDecimal("7980088587869256386"), model.threshold()); + Assertions.assertEquals(AlertOperator.NONE, model.operator()); + Assertions.assertEquals(new BigDecimal("9059402645056682319"), model.amount()); + Assertions.assertEquals("negvmnvuqe", model.unit()); + Assertions.assertEquals(new BigDecimal("2749298665245055731"), model.currentSpend()); + Assertions.assertEquals("astjbkkdmflvestm", model.contactEmails().get(0)); + Assertions.assertEquals("rriloz", model.contactGroups().get(0)); + Assertions.assertEquals("uztcktyhjtqed", model.contactRoles().get(0)); + Assertions.assertEquals("zulwmmrqzzrrj", model.overridingAlert()); + Assertions.assertEquals("gl", model.departmentName()); + Assertions.assertEquals("zgkrvqe", model.companyName()); + Assertions.assertEquals("toepryu", model.enrollmentNumber()); + Assertions.assertEquals("wytpzdmovz", model.enrollmentStartDate()); + Assertions.assertEquals("va", model.enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("5762318821070870686"), model.invoicingThreshold()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesTests.java index 9eef60b1f2d1..3d950212020f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -15,6 +15,7 @@ import com.azure.resourcemanager.costmanagement.models.AlertStatus; import com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType; import com.azure.resourcemanager.costmanagement.models.AlertType; +import java.math.BigDecimal; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -22,34 +23,38 @@ public final class AlertPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertProperties model = BinaryData.fromString( - "{\"definition\":{\"type\":\"General\",\"category\":\"Usage\",\"criteria\":\"CostThresholdExceeded\"},\"description\":\"zis\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingMonth\",\"periodStartDate\":\"lppvksrpq\",\"triggeredBy\":\"jzraehtwdwrf\",\"resourceGroupFilter\":[\"dataiby\"],\"resourceFilter\":[\"datal\"],\"meterFilter\":[\"datahfwpracstwit\",\"datakhevxccedc\",\"datanmdyodnwzxl\",\"datajc\"],\"tagFilter\":\"datahlt\",\"operator\":\"GreaterThan\",\"unit\":\"avvwxqi\",\"contactEmails\":[\"nyowxwlmdjrkvfg\",\"vfvpdbodaciz\"],\"contactGroups\":[\"lhkrribdeibqipqk\"],\"contactRoles\":[\"xndzwm\",\"refajpjorwkqnyh\"],\"overridingAlert\":\"ij\",\"departmentName\":\"ivfxzsjabibsyst\",\"companyName\":\"fsdjpvkvp\",\"enrollmentNumber\":\"xbkzbzkdvncj\",\"enrollmentStartDate\":\"udurgkakmokz\",\"enrollmentEndDate\":\"jk\"},\"costEntityId\":\"hmouwqlgzrfze\",\"status\":\"Dismissed\",\"creationTime\":\"izikayuhq\",\"closeTime\":\"jbsybbqw\",\"modificationTime\":\"t\",\"statusModificationUserName\":\"gmfpgvmp\",\"statusModificationTime\":\"as\"}") + "{\"definition\":{\"type\":\"General\",\"category\":\"Usage\",\"criteria\":\"CrossCloudCollectionError\"},\"description\":\"in\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"BillingQuarter\",\"periodStartDate\":\"tsttktlahbq\",\"triggeredBy\":\"tx\",\"resourceGroupFilter\":[\"\\\"dataukxit\\\"\",\"\\\"datam\\\"\",\"\\\"datatg\\\"\",\"\\\"dataqqxhrnxrxcpj\\\"\"],\"resourceFilter\":[\"\\\"dataav\\\"\",\"\\\"datak\\\"\",\"\\\"datadzf\\\"\"],\"meterFilter\":[\"\\\"dataivjlfrqttbajlka\\\"\"],\"tagFilter\":\"\\\"datawxyiopidkqq\\\"\",\"threshold\":4633898061175838368,\"operator\":\"None\",\"amount\":306912031039998372,\"unit\":\"ligovibrxkpm\",\"currentSpend\":3604064084351024884,\"contactEmails\":[\"u\",\"cbgoor\"],\"contactGroups\":[\"oybfhjxakvvj\",\"slordilmyww\",\"kgkxn\",\"edabgyvudtjue\"],\"contactRoles\":[\"ihxuuwh\",\"j\",\"xccybvpa\"],\"overridingAlert\":\"kkudzp\",\"departmentName\":\"wjplma\",\"companyName\":\"tcyohpfkyrk\",\"enrollmentNumber\":\"dg\",\"enrollmentStartDate\":\"gsj\",\"enrollmentEndDate\":\"nwqjnoba\",\"invoicingThreshold\":2641783861935607406},\"costEntityId\":\"viacegfnmntfpmv\",\"status\":\"Active\",\"creationTime\":\"nczdwvv\",\"closeTime\":\"lxlllchpo\",\"modificationTime\":\"zevwrdnhfukuv\",\"statusModificationUserName\":\"cswsmystul\",\"statusModificationTime\":\"ypfcvlerchpqbmf\"}") .toObject(AlertProperties.class); Assertions.assertEquals(AlertType.GENERAL, model.definition().type()); Assertions.assertEquals(AlertCategory.USAGE, model.definition().category()); - Assertions.assertEquals(AlertCriteria.COST_THRESHOLD_EXCEEDED, model.definition().criteria()); - Assertions.assertEquals("zis", model.description()); - Assertions.assertEquals(AlertSource.PRESET, model.source()); - Assertions.assertEquals(AlertTimeGrainType.BILLING_MONTH, model.details().timeGrainType()); - Assertions.assertEquals("lppvksrpq", model.details().periodStartDate()); - Assertions.assertEquals("jzraehtwdwrf", model.details().triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN, model.details().operator()); - Assertions.assertEquals("avvwxqi", model.details().unit()); - Assertions.assertEquals("nyowxwlmdjrkvfg", model.details().contactEmails().get(0)); - Assertions.assertEquals("lhkrribdeibqipqk", model.details().contactGroups().get(0)); - Assertions.assertEquals("xndzwm", model.details().contactRoles().get(0)); - Assertions.assertEquals("ij", model.details().overridingAlert()); - Assertions.assertEquals("ivfxzsjabibsyst", model.details().departmentName()); - Assertions.assertEquals("fsdjpvkvp", model.details().companyName()); - Assertions.assertEquals("xbkzbzkdvncj", model.details().enrollmentNumber()); - Assertions.assertEquals("udurgkakmokz", model.details().enrollmentStartDate()); - Assertions.assertEquals("jk", model.details().enrollmentEndDate()); - Assertions.assertEquals("hmouwqlgzrfze", model.costEntityId()); - Assertions.assertEquals(AlertStatus.DISMISSED, model.status()); - Assertions.assertEquals("izikayuhq", model.creationTime()); - Assertions.assertEquals("jbsybbqw", model.closeTime()); - Assertions.assertEquals("t", model.modificationTime()); - Assertions.assertEquals("gmfpgvmp", model.statusModificationUsername()); - Assertions.assertEquals("as", model.statusModificationTime()); + Assertions.assertEquals(AlertCriteria.CROSS_CLOUD_COLLECTION_ERROR, model.definition().criteria()); + Assertions.assertEquals("in", model.description()); + Assertions.assertEquals(AlertSource.USER, model.source()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_QUARTER, model.details().timeGrainType()); + Assertions.assertEquals("tsttktlahbq", model.details().periodStartDate()); + Assertions.assertEquals("tx", model.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("4633898061175838368"), model.details().threshold()); + Assertions.assertEquals(AlertOperator.NONE, model.details().operator()); + Assertions.assertEquals(new BigDecimal("306912031039998372"), model.details().amount()); + Assertions.assertEquals("ligovibrxkpm", model.details().unit()); + Assertions.assertEquals(new BigDecimal("3604064084351024884"), model.details().currentSpend()); + Assertions.assertEquals("u", model.details().contactEmails().get(0)); + Assertions.assertEquals("oybfhjxakvvj", model.details().contactGroups().get(0)); + Assertions.assertEquals("ihxuuwh", model.details().contactRoles().get(0)); + Assertions.assertEquals("kkudzp", model.details().overridingAlert()); + Assertions.assertEquals("wjplma", model.details().departmentName()); + Assertions.assertEquals("tcyohpfkyrk", model.details().companyName()); + Assertions.assertEquals("dg", model.details().enrollmentNumber()); + Assertions.assertEquals("gsj", model.details().enrollmentStartDate()); + Assertions.assertEquals("nwqjnoba", model.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("2641783861935607406"), model.details().invoicingThreshold()); + Assertions.assertEquals("viacegfnmntfpmv", model.costEntityId()); + Assertions.assertEquals(AlertStatus.ACTIVE, model.status()); + Assertions.assertEquals("nczdwvv", model.creationTime()); + Assertions.assertEquals("lxlllchpo", model.closeTime()); + Assertions.assertEquals("zevwrdnhfukuv", model.modificationTime()); + Assertions.assertEquals("cswsmystul", model.statusModificationUsername()); + Assertions.assertEquals("ypfcvlerchpqbmf", model.statusModificationTime()); } @org.junit.jupiter.api.Test @@ -57,60 +62,69 @@ public void testSerialize() throws Exception { AlertProperties model = new AlertProperties() .withDefinition(new AlertPropertiesDefinition().withType(AlertType.GENERAL) .withCategory(AlertCategory.USAGE) - .withCriteria(AlertCriteria.COST_THRESHOLD_EXCEEDED)) - .withDescription("zis") - .withSource(AlertSource.PRESET) - .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.BILLING_MONTH) - .withPeriodStartDate("lppvksrpq") - .withTriggeredBy("jzraehtwdwrf") - .withResourceGroupFilter(Arrays.asList("dataiby")) - .withResourceFilter(Arrays.asList("datal")) - .withMeterFilter(Arrays.asList("datahfwpracstwit", "datakhevxccedc", "datanmdyodnwzxl", "datajc")) - .withTagFilter("datahlt") - .withOperator(AlertOperator.GREATER_THAN) - .withUnit("avvwxqi") - .withContactEmails(Arrays.asList("nyowxwlmdjrkvfg", "vfvpdbodaciz")) - .withContactGroups(Arrays.asList("lhkrribdeibqipqk")) - .withContactRoles(Arrays.asList("xndzwm", "refajpjorwkqnyh")) - .withOverridingAlert("ij") - .withDepartmentName("ivfxzsjabibsyst") - .withCompanyName("fsdjpvkvp") - .withEnrollmentNumber("xbkzbzkdvncj") - .withEnrollmentStartDate("udurgkakmokz") - .withEnrollmentEndDate("jk")) - .withCostEntityId("hmouwqlgzrfze") - .withStatus(AlertStatus.DISMISSED) - .withCreationTime("izikayuhq") - .withCloseTime("jbsybbqw") - .withModificationTime("t") - .withStatusModificationUsername("gmfpgvmp") - .withStatusModificationTime("as"); + .withCriteria(AlertCriteria.CROSS_CLOUD_COLLECTION_ERROR)) + .withDescription("in") + .withSource(AlertSource.USER) + .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.BILLING_QUARTER) + .withPeriodStartDate("tsttktlahbq") + .withTriggeredBy("tx") + .withResourceGroupFilter( + Arrays.asList("\"dataukxit\"", "\"datam\"", "\"datatg\"", "\"dataqqxhrnxrxcpj\"")) + .withResourceFilter(Arrays.asList("\"dataav\"", "\"datak\"", "\"datadzf\"")) + .withMeterFilter(Arrays.asList("\"dataivjlfrqttbajlka\"")) + .withTagFilter("\"datawxyiopidkqq\"") + .withThreshold(new BigDecimal("4633898061175838368")) + .withOperator(AlertOperator.NONE) + .withAmount(new BigDecimal("306912031039998372")) + .withUnit("ligovibrxkpm") + .withCurrentSpend(new BigDecimal("3604064084351024884")) + .withContactEmails(Arrays.asList("u", "cbgoor")) + .withContactGroups(Arrays.asList("oybfhjxakvvj", "slordilmyww", "kgkxn", "edabgyvudtjue")) + .withContactRoles(Arrays.asList("ihxuuwh", "j", "xccybvpa")) + .withOverridingAlert("kkudzp") + .withDepartmentName("wjplma") + .withCompanyName("tcyohpfkyrk") + .withEnrollmentNumber("dg") + .withEnrollmentStartDate("gsj") + .withEnrollmentEndDate("nwqjnoba") + .withInvoicingThreshold(new BigDecimal("2641783861935607406"))) + .withCostEntityId("viacegfnmntfpmv") + .withStatus(AlertStatus.ACTIVE) + .withCreationTime("nczdwvv") + .withCloseTime("lxlllchpo") + .withModificationTime("zevwrdnhfukuv") + .withStatusModificationUsername("cswsmystul") + .withStatusModificationTime("ypfcvlerchpqbmf"); model = BinaryData.fromObject(model).toObject(AlertProperties.class); Assertions.assertEquals(AlertType.GENERAL, model.definition().type()); Assertions.assertEquals(AlertCategory.USAGE, model.definition().category()); - Assertions.assertEquals(AlertCriteria.COST_THRESHOLD_EXCEEDED, model.definition().criteria()); - Assertions.assertEquals("zis", model.description()); - Assertions.assertEquals(AlertSource.PRESET, model.source()); - Assertions.assertEquals(AlertTimeGrainType.BILLING_MONTH, model.details().timeGrainType()); - Assertions.assertEquals("lppvksrpq", model.details().periodStartDate()); - Assertions.assertEquals("jzraehtwdwrf", model.details().triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN, model.details().operator()); - Assertions.assertEquals("avvwxqi", model.details().unit()); - Assertions.assertEquals("nyowxwlmdjrkvfg", model.details().contactEmails().get(0)); - Assertions.assertEquals("lhkrribdeibqipqk", model.details().contactGroups().get(0)); - Assertions.assertEquals("xndzwm", model.details().contactRoles().get(0)); - Assertions.assertEquals("ij", model.details().overridingAlert()); - Assertions.assertEquals("ivfxzsjabibsyst", model.details().departmentName()); - Assertions.assertEquals("fsdjpvkvp", model.details().companyName()); - Assertions.assertEquals("xbkzbzkdvncj", model.details().enrollmentNumber()); - Assertions.assertEquals("udurgkakmokz", model.details().enrollmentStartDate()); - Assertions.assertEquals("jk", model.details().enrollmentEndDate()); - Assertions.assertEquals("hmouwqlgzrfze", model.costEntityId()); - Assertions.assertEquals(AlertStatus.DISMISSED, model.status()); - Assertions.assertEquals("izikayuhq", model.creationTime()); - Assertions.assertEquals("jbsybbqw", model.closeTime()); - Assertions.assertEquals("t", model.modificationTime()); - Assertions.assertEquals("gmfpgvmp", model.statusModificationUsername()); - Assertions.assertEquals("as", model.statusModificationTime()); + Assertions.assertEquals(AlertCriteria.CROSS_CLOUD_COLLECTION_ERROR, model.definition().criteria()); + Assertions.assertEquals("in", model.description()); + Assertions.assertEquals(AlertSource.USER, model.source()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_QUARTER, model.details().timeGrainType()); + Assertions.assertEquals("tsttktlahbq", model.details().periodStartDate()); + Assertions.assertEquals("tx", model.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("4633898061175838368"), model.details().threshold()); + Assertions.assertEquals(AlertOperator.NONE, model.details().operator()); + Assertions.assertEquals(new BigDecimal("306912031039998372"), model.details().amount()); + Assertions.assertEquals("ligovibrxkpm", model.details().unit()); + Assertions.assertEquals(new BigDecimal("3604064084351024884"), model.details().currentSpend()); + Assertions.assertEquals("u", model.details().contactEmails().get(0)); + Assertions.assertEquals("oybfhjxakvvj", model.details().contactGroups().get(0)); + Assertions.assertEquals("ihxuuwh", model.details().contactRoles().get(0)); + Assertions.assertEquals("kkudzp", model.details().overridingAlert()); + Assertions.assertEquals("wjplma", model.details().departmentName()); + Assertions.assertEquals("tcyohpfkyrk", model.details().companyName()); + Assertions.assertEquals("dg", model.details().enrollmentNumber()); + Assertions.assertEquals("gsj", model.details().enrollmentStartDate()); + Assertions.assertEquals("nwqjnoba", model.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("2641783861935607406"), model.details().invoicingThreshold()); + Assertions.assertEquals("viacegfnmntfpmv", model.costEntityId()); + Assertions.assertEquals(AlertStatus.ACTIVE, model.status()); + Assertions.assertEquals("nczdwvv", model.creationTime()); + Assertions.assertEquals("lxlllchpo", model.closeTime()); + Assertions.assertEquals("zevwrdnhfukuv", model.modificationTime()); + Assertions.assertEquals("cswsmystul", model.statusModificationUsername()); + Assertions.assertEquals("ypfcvlerchpqbmf", model.statusModificationTime()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissWithResponseMockTests.java index 10291ddea906..f0e6705509c8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsDismissWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.Alert; @@ -21,6 +21,7 @@ import com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType; import com.azure.resourcemanager.costmanagement.models.AlertType; import com.azure.resourcemanager.costmanagement.models.DismissAlertPayload; +import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -32,75 +33,86 @@ public final class AlertsDismissWithResponseMockTests { @Test public void testDismissWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"System\",\"criteria\":\"InvoiceDueDateReached\"},\"description\":\"mpcbbprtugav\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"BillingMonth\",\"periodStartDate\":\"ivmfogdrtbf\",\"triggeredBy\":\"krftsjcwjjxsg\",\"resourceGroupFilter\":[\"datawvif\",\"dataxkecifhocj\",\"datawkloozr\"],\"resourceFilter\":[\"datavcmuf\",\"datanlcpxxviry\",\"datayngjgvrquvpygglp\"],\"meterFilter\":[\"datadcueljtiahxmfq\",\"datayarvsxzqbglcjk\",\"datayspthzod\"],\"tagFilter\":\"datatl\",\"operator\":\"EqualTo\",\"unit\":\"ioskkfmkmfdjxyxg\",\"contactEmails\":[\"vjcteoedlrslsk\",\"zpxvjnzdpvoc\"],\"contactGroups\":[\"pcnab\",\"zf\",\"nggy\"],\"contactRoles\":[\"vzilmhiv\"],\"overridingAlert\":\"wwwncknr\",\"departmentName\":\"ajlskzptj\",\"companyName\":\"lwe\",\"enrollmentNumber\":\"yrth\",\"enrollmentStartDate\":\"lehmcgcjeinueho\",\"enrollmentEndDate\":\"mvfejvqnttmbqd\"},\"costEntityId\":\"fiv\",\"status\":\"Resolved\",\"creationTime\":\"ysthhza\",\"closeTime\":\"fwy\",\"modificationTime\":\"lhgenuzejgvkv\",\"statusModificationUserName\":\"aqszllrzl\",\"statusModificationTime\":\"mdqgmihzpimcqr\"},\"eTag\":\"xtminklogxsvtzar\",\"id\":\"zvqnsqktcmbjwzzo\",\"name\":\"lpky\",\"type\":\"tglwkzpgajsqjc\"}"; + = "{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Cost\",\"criteria\":\"InvoiceDueDateApproaching\"},\"description\":\"aqbkixvvlwynpbbf\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingAnnual\",\"periodStartDate\":\"pu\",\"triggeredBy\":\"feuzjljmphfkye\",\"resourceGroupFilter\":[\"\\\"datagj\\\"\",\"\\\"datami\\\"\"],\"resourceFilter\":[\"\\\"datadoccnxshanzb\\\"\",\"\\\"dataiadhbatec\\\"\",\"\\\"dataatsdohzniucbdaom\\\"\",\"\\\"datawiinjdllw\\\"\"],\"meterFilter\":[\"\\\"datae\\\"\"],\"tagFilter\":\"\\\"datawavvqxuajgcqwuly\\\"\",\"threshold\":2415129657839639392,\"operator\":\"GreaterThan\",\"amount\":3735447334208219498,\"unit\":\"si\",\"currentSpend\":7437541342121277518,\"contactEmails\":[\"huulriqbyo\",\"vjgb\",\"sxebrslttfyhcdjw\"],\"contactGroups\":[\"ardnagttpufpbpgn\",\"holhujbfw\",\"iplkysolsyjprxs\"],\"contactRoles\":[\"dmcvhtbbz\",\"hfvhuwzbxpcqz\"],\"overridingAlert\":\"hotjec\",\"departmentName\":\"mx\",\"companyName\":\"lrrskap\",\"enrollmentNumber\":\"wie\",\"enrollmentStartDate\":\"uyader\",\"enrollmentEndDate\":\"fokyks\",\"invoicingThreshold\":2319068369289137293},\"costEntityId\":\"cgrvkcxzznnuifer\",\"status\":\"Dismissed\",\"creationTime\":\"gprkjgu\",\"closeTime\":\"jmwvvbtuqkxxi\",\"modificationTime\":\"gxql\",\"statusModificationUserName\":\"k\",\"statusModificationTime\":\"jgxieqfkyfh\"},\"eTag\":\"vjaqu\",\"id\":\"yynvskpa\",\"name\":\"bmgeumexmjbxcbc\",\"type\":\"wkqm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Alert response = manager.alerts() - .dismissWithResponse("etaoutnpdc", "uhspfefyihduy", new DismissAlertPayload() - .withDefinition(new AlertPropertiesDefinition().withType(AlertType.BUDGET) - .withCategory(AlertCategory.SYSTEM) - .withCriteria(AlertCriteria.CROSS_CLOUD_COLLECTION_ERROR)) - .withDescription("bkcgsuthhllnm") - .withSource(AlertSource.USER) - .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.MONTHLY) - .withPeriodStartDate("x") - .withTriggeredBy("ciatxtjrrl") - .withResourceGroupFilter(Arrays.asList("dataskjh", "dataxdlajfo", "datacxscvslxlh")) - .withResourceFilter(Arrays.asList("datakrmukmyjmkxett", "dataslojfkqidnqt", "dataqxjhqxcsqhtkbtnq")) - .withMeterFilter(Arrays.asList("datagldmbiipsnaww", "dataqkzn", "datahhl")) - .withTagFilter("dataricctkwmuqqoa") - .withOperator(AlertOperator.NONE) - .withUnit("lesrwva") - .withContactEmails(Arrays.asList("ctrceqnkbr", "pobe", "dmljzacvumepjp", "ibnzp")) - .withContactGroups(Arrays.asList("pife", "leqirccjclykcgxv", "pjlvczuoda", "punettepdjxq")) - .withContactRoles(Arrays.asList("oy", "uiylpc", "aewse", "vesk")) - .withOverridingAlert("egqphrgfnzhctm") - .withDepartmentName("sghpbcbcpzarpze") - .withCompanyName("cdl") - .withEnrollmentNumber("zmpypefcpczshnu") - .withEnrollmentStartDate("daizupf") - .withEnrollmentEndDate("uytuszxhmtvtv")) - .withCostEntityId("qiukvzwyd") - .withStatus(AlertStatus.DISMISSED) - .withCreationTime("aokgkskjivbsshaj") - .withCloseTime("u") - .withModificationTime("eexpgeumi") - .withStatusModificationUsername("wuit") - .withStatusModificationTime("exyionofninbd"), com.azure.core.util.Context.NONE) + .dismissWithResponse("xl", "fhglhrfo", + new DismissAlertPayload() + .withDefinition(new AlertPropertiesDefinition().withType(AlertType.X_CLOUD) + .withCategory(AlertCategory.BILLING) + .withCriteria(AlertCriteria.CREDIT_THRESHOLD_REACHED)) + .withDescription("cselqxovppqibuk") + .withSource(AlertSource.USER) + .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.QUARTERLY) + .withPeriodStartDate("mlccmetjscz") + .withTriggeredBy("fqbqnasd") + .withResourceGroupFilter(Arrays.asList("\"datanzsieuscplh\"")) + .withResourceFilter(Arrays.asList("\"datagxlyzkxitdshezs\"", "\"datakol\"", "\"dataupjo\"", + "\"datamozsayebrazwz\"")) + .withMeterFilter(Arrays.asList("\"databtzuykyk\"")) + .withTagFilter("\"datafsdyepfnocmbeza\"") + .withThreshold(new BigDecimal("8228844641001750307")) + .withOperator(AlertOperator.LESS_THAN_OR_EQUAL_TO) + .withAmount(new BigDecimal("8903127144257691178")) + .withUnit("qejg") + .withCurrentSpend(new BigDecimal("5786849339085789020")) + .withContactEmails(Arrays.asList("gkppgkqzkcyzmf", "ngdyfcixrhlcq", "hoe", "goiutgw")) + .withContactGroups(Arrays.asList("a", "p", "hazyntacihnco")) + .withContactRoles(Arrays.asList("pnmliq", "v", "bhikeaqgr")) + .withOverridingAlert("pomxpu") + .withDepartmentName("tsdfjyieso") + .withCompanyName("iqbuou") + .withEnrollmentNumber("py") + .withEnrollmentStartDate("leofj") + .withEnrollmentEndDate("gbww") + .withInvoicingThreshold(new BigDecimal("3175898386506027355"))) + .withCostEntityId("fw") + .withStatus(AlertStatus.ACTIVE) + .withCreationTime("maciqgjjrl") + .withCloseTime("qlwixvtbougu") + .withModificationTime("n") + .withStatusModificationUsername("pg") + .withStatusModificationTime("tbasu"), + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("xtminklogxsvtzar", response.etag()); + Assertions.assertEquals("vjaqu", response.etag()); Assertions.assertEquals(AlertType.QUOTA, response.definition().type()); - Assertions.assertEquals(AlertCategory.SYSTEM, response.definition().category()); - Assertions.assertEquals(AlertCriteria.INVOICE_DUE_DATE_REACHED, response.definition().criteria()); - Assertions.assertEquals("mpcbbprtugav", response.description()); - Assertions.assertEquals(AlertSource.USER, response.source()); - Assertions.assertEquals(AlertTimeGrainType.BILLING_MONTH, response.details().timeGrainType()); - Assertions.assertEquals("ivmfogdrtbf", response.details().periodStartDate()); - Assertions.assertEquals("krftsjcwjjxsg", response.details().triggeredBy()); - Assertions.assertEquals(AlertOperator.EQUAL_TO, response.details().operator()); - Assertions.assertEquals("ioskkfmkmfdjxyxg", response.details().unit()); - Assertions.assertEquals("vjcteoedlrslsk", response.details().contactEmails().get(0)); - Assertions.assertEquals("pcnab", response.details().contactGroups().get(0)); - Assertions.assertEquals("vzilmhiv", response.details().contactRoles().get(0)); - Assertions.assertEquals("wwwncknr", response.details().overridingAlert()); - Assertions.assertEquals("ajlskzptj", response.details().departmentName()); - Assertions.assertEquals("lwe", response.details().companyName()); - Assertions.assertEquals("yrth", response.details().enrollmentNumber()); - Assertions.assertEquals("lehmcgcjeinueho", response.details().enrollmentStartDate()); - Assertions.assertEquals("mvfejvqnttmbqd", response.details().enrollmentEndDate()); - Assertions.assertEquals("fiv", response.costEntityId()); - Assertions.assertEquals(AlertStatus.RESOLVED, response.status()); - Assertions.assertEquals("ysthhza", response.creationTime()); - Assertions.assertEquals("fwy", response.closeTime()); - Assertions.assertEquals("lhgenuzejgvkv", response.modificationTime()); - Assertions.assertEquals("aqszllrzl", response.statusModificationUsername()); - Assertions.assertEquals("mdqgmihzpimcqr", response.statusModificationTime()); + Assertions.assertEquals(AlertCategory.COST, response.definition().category()); + Assertions.assertEquals(AlertCriteria.INVOICE_DUE_DATE_APPROACHING, response.definition().criteria()); + Assertions.assertEquals("aqbkixvvlwynpbbf", response.description()); + Assertions.assertEquals(AlertSource.PRESET, response.source()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_ANNUAL, response.details().timeGrainType()); + Assertions.assertEquals("pu", response.details().periodStartDate()); + Assertions.assertEquals("feuzjljmphfkye", response.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("2415129657839639392"), response.details().threshold()); + Assertions.assertEquals(AlertOperator.GREATER_THAN, response.details().operator()); + Assertions.assertEquals(new BigDecimal("3735447334208219498"), response.details().amount()); + Assertions.assertEquals("si", response.details().unit()); + Assertions.assertEquals(new BigDecimal("7437541342121277518"), response.details().currentSpend()); + Assertions.assertEquals("huulriqbyo", response.details().contactEmails().get(0)); + Assertions.assertEquals("ardnagttpufpbpgn", response.details().contactGroups().get(0)); + Assertions.assertEquals("dmcvhtbbz", response.details().contactRoles().get(0)); + Assertions.assertEquals("hotjec", response.details().overridingAlert()); + Assertions.assertEquals("mx", response.details().departmentName()); + Assertions.assertEquals("lrrskap", response.details().companyName()); + Assertions.assertEquals("wie", response.details().enrollmentNumber()); + Assertions.assertEquals("uyader", response.details().enrollmentStartDate()); + Assertions.assertEquals("fokyks", response.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("2319068369289137293"), response.details().invoicingThreshold()); + Assertions.assertEquals("cgrvkcxzznnuifer", response.costEntityId()); + Assertions.assertEquals(AlertStatus.DISMISSED, response.status()); + Assertions.assertEquals("gprkjgu", response.creationTime()); + Assertions.assertEquals("jmwvvbtuqkxxi", response.closeTime()); + Assertions.assertEquals("gxql", response.modificationTime()); + Assertions.assertEquals("k", response.statusModificationUsername()); + Assertions.assertEquals("jgxieqfkyfh", response.statusModificationTime()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetWithResponseMockTests.java index a29957479230..bdfbb907c8b1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.Alert; @@ -18,6 +18,7 @@ import com.azure.resourcemanager.costmanagement.models.AlertStatus; import com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType; import com.azure.resourcemanager.costmanagement.models.AlertType; +import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -28,44 +29,47 @@ public final class AlertsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"definition\":{\"type\":\"Credit\",\"category\":\"Cost\",\"criteria\":\"QuotaThresholdApproaching\"},\"description\":\"llhdyzm\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"Annually\",\"periodStartDate\":\"xak\",\"triggeredBy\":\"ywymxgaabj\",\"resourceGroupFilter\":[\"datafohfaogzvki\",\"datarsiwdyjqur\"],\"resourceFilter\":[\"datarra\",\"dataeek\",\"datas\"],\"meterFilter\":[\"dataogd\"],\"tagFilter\":\"datacbcbgydlqidy\",\"operator\":\"GreaterThanOrEqualTo\",\"unit\":\"yrilkfb\",\"contactEmails\":[\"xvztpbnfnqtxj\",\"omals\",\"bnfddep\",\"dwq\"],\"contactGroups\":[\"f\",\"ygleexa\",\"vmywhsbrcarycsjj\"],\"contactRoles\":[\"oaqa\",\"uvehzptd\",\"krrbhmpful\",\"be\"],\"overridingAlert\":\"ybpmf\",\"departmentName\":\"ununm\",\"companyName\":\"krvfyifkdschl\",\"enrollmentNumber\":\"fict\",\"enrollmentStartDate\":\"jjwgcwnp\",\"enrollmentEndDate\":\"kgf\"},\"costEntityId\":\"ogmhmjpj\",\"status\":\"Dismissed\",\"creationTime\":\"pdqwtygevgwmse\",\"closeTime\":\"rxifvqnrx\",\"modificationTime\":\"bpjptnvwjhrsi\",\"statusModificationUserName\":\"pxlbtpakftngat\",\"statusModificationTime\":\"ykyutrymdwmfj\"},\"eTag\":\"y\",\"id\":\"vjqdvdwkq\",\"name\":\"ldrlefgnaavua\",\"type\":\"n\"}"; + = "{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Cost\",\"criteria\":\"QuotaThresholdReached\"},\"description\":\"ahwriuomzczfk\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingAnnual\",\"periodStartDate\":\"axwspcaxikhfjqeb\",\"triggeredBy\":\"cx\",\"resourceGroupFilter\":[\"\\\"datazzromvygysemtmes\\\"\",\"\\\"datafsvpink\\\"\"],\"resourceFilter\":[\"\\\"datatqtdis\\\"\",\"\\\"dataxspvckojazb\\\"\",\"\\\"datagspftesu\\\"\",\"\\\"datazpvpvdyly\\\"\"],\"meterFilter\":[\"\\\"datavqseus\\\"\",\"\\\"datafjb\\\"\",\"\\\"dataxzfxn\\\"\",\"\\\"datamlbmuoswkjm\\\"\"],\"tagFilter\":\"\\\"datahdcyyyzlwhbwzjn\\\"\",\"threshold\":6701605761474086946,\"operator\":\"EqualTo\",\"amount\":2201491063733786718,\"unit\":\"nn\",\"currentSpend\":6918607332230111951,\"contactEmails\":[\"edzuub\",\"tvgj\"],\"contactGroups\":[\"tyjjvavdpwwobt\"],\"contactRoles\":[\"titsf\",\"ofw\",\"nmhkscauwaz\"],\"overridingAlert\":\"wdfriwgybjpoz\",\"departmentName\":\"scvgl\",\"companyName\":\"x\",\"enrollmentNumber\":\"byfg\",\"enrollmentStartDate\":\"wqkjvx\",\"enrollmentEndDate\":\"wpxsoo\",\"invoicingThreshold\":6223400724980074151},\"costEntityId\":\"cskltezuuggg\",\"status\":\"None\",\"creationTime\":\"grdcgubsrtmdy\",\"closeTime\":\"erpi\",\"modificationTime\":\"tjzgczfcm\",\"statusModificationUserName\":\"fbodetresrgvts\",\"statusModificationTime\":\"vftwaiv\"},\"eTag\":\"qkevzgj\",\"id\":\"anhx\",\"name\":\"pdxxzetwwz\",\"type\":\"wot\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - Alert response - = manager.alerts().getWithResponse("oolzqocarkuzl", "cnn", com.azure.core.util.Context.NONE).getValue(); + Alert response = manager.alerts().getWithResponse("y", "it", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("y", response.etag()); - Assertions.assertEquals(AlertType.CREDIT, response.definition().type()); + Assertions.assertEquals("qkevzgj", response.etag()); + Assertions.assertEquals(AlertType.QUOTA, response.definition().type()); Assertions.assertEquals(AlertCategory.COST, response.definition().category()); - Assertions.assertEquals(AlertCriteria.QUOTA_THRESHOLD_APPROACHING, response.definition().criteria()); - Assertions.assertEquals("llhdyzm", response.description()); + Assertions.assertEquals(AlertCriteria.QUOTA_THRESHOLD_REACHED, response.definition().criteria()); + Assertions.assertEquals("ahwriuomzczfk", response.description()); Assertions.assertEquals(AlertSource.PRESET, response.source()); - Assertions.assertEquals(AlertTimeGrainType.ANNUALLY, response.details().timeGrainType()); - Assertions.assertEquals("xak", response.details().periodStartDate()); - Assertions.assertEquals("ywymxgaabj", response.details().triggeredBy()); - Assertions.assertEquals(AlertOperator.GREATER_THAN_OR_EQUAL_TO, response.details().operator()); - Assertions.assertEquals("yrilkfb", response.details().unit()); - Assertions.assertEquals("xvztpbnfnqtxj", response.details().contactEmails().get(0)); - Assertions.assertEquals("f", response.details().contactGroups().get(0)); - Assertions.assertEquals("oaqa", response.details().contactRoles().get(0)); - Assertions.assertEquals("ybpmf", response.details().overridingAlert()); - Assertions.assertEquals("ununm", response.details().departmentName()); - Assertions.assertEquals("krvfyifkdschl", response.details().companyName()); - Assertions.assertEquals("fict", response.details().enrollmentNumber()); - Assertions.assertEquals("jjwgcwnp", response.details().enrollmentStartDate()); - Assertions.assertEquals("kgf", response.details().enrollmentEndDate()); - Assertions.assertEquals("ogmhmjpj", response.costEntityId()); - Assertions.assertEquals(AlertStatus.DISMISSED, response.status()); - Assertions.assertEquals("pdqwtygevgwmse", response.creationTime()); - Assertions.assertEquals("rxifvqnrx", response.closeTime()); - Assertions.assertEquals("bpjptnvwjhrsi", response.modificationTime()); - Assertions.assertEquals("pxlbtpakftngat", response.statusModificationUsername()); - Assertions.assertEquals("ykyutrymdwmfj", response.statusModificationTime()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_ANNUAL, response.details().timeGrainType()); + Assertions.assertEquals("axwspcaxikhfjqeb", response.details().periodStartDate()); + Assertions.assertEquals("cx", response.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("6701605761474086946"), response.details().threshold()); + Assertions.assertEquals(AlertOperator.EQUAL_TO, response.details().operator()); + Assertions.assertEquals(new BigDecimal("2201491063733786718"), response.details().amount()); + Assertions.assertEquals("nn", response.details().unit()); + Assertions.assertEquals(new BigDecimal("6918607332230111951"), response.details().currentSpend()); + Assertions.assertEquals("edzuub", response.details().contactEmails().get(0)); + Assertions.assertEquals("tyjjvavdpwwobt", response.details().contactGroups().get(0)); + Assertions.assertEquals("titsf", response.details().contactRoles().get(0)); + Assertions.assertEquals("wdfriwgybjpoz", response.details().overridingAlert()); + Assertions.assertEquals("scvgl", response.details().departmentName()); + Assertions.assertEquals("x", response.details().companyName()); + Assertions.assertEquals("byfg", response.details().enrollmentNumber()); + Assertions.assertEquals("wqkjvx", response.details().enrollmentStartDate()); + Assertions.assertEquals("wpxsoo", response.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("6223400724980074151"), response.details().invoicingThreshold()); + Assertions.assertEquals("cskltezuuggg", response.costEntityId()); + Assertions.assertEquals(AlertStatus.NONE, response.status()); + Assertions.assertEquals("grdcgubsrtmdy", response.creationTime()); + Assertions.assertEquals("erpi", response.closeTime()); + Assertions.assertEquals("tjzgczfcm", response.modificationTime()); + Assertions.assertEquals("fbodetresrgvts", response.statusModificationUsername()); + Assertions.assertEquals("vftwaiv", response.statusModificationTime()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalWithResponseMockTests.java index c7d1a38f92c1..f6722b746bad 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListExternalWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AlertsResult; @@ -21,17 +21,17 @@ public final class AlertsListExternalWithResponseMockTests { @Test public void testListExternalWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Billing\",\"criteria\":\"InvoiceDueDateReached\"},\"description\":\"wxs\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingAnnual\",\"periodStartDate\":\"xekr\",\"triggeredBy\":\"k\",\"resourceGroupFilter\":[\"dataud\",\"datatwaokb\"],\"resourceFilter\":[\"dataytt\",\"dataaknwfrkebsmh\",\"datadujdigatoleksc\"],\"meterFilter\":[\"datananqimwbzxpdcldp\",\"dataawnsnlaimou\",\"dataw\"],\"tagFilter\":\"dataqmudmfcoibic\",\"operator\":\"None\",\"unit\":\"wjrkb\",\"contactEmails\":[\"btqqvyfs\",\"yrfwbivq\",\"ogfuyzwvbhlim\",\"yqe\"],\"contactGroups\":[\"odlikcdrdaasax\"],\"contactRoles\":[\"sm\",\"kwiy\",\"v\"],\"overridingAlert\":\"ko\",\"departmentName\":\"nawnvz\",\"companyName\":\"n\",\"enrollmentNumber\":\"ywsxvjabjqqaxu\",\"enrollmentStartDate\":\"y\",\"enrollmentEndDate\":\"nudn\"},\"costEntityId\":\"bhjxwxqweuipmpv\",\"status\":\"None\",\"creationTime\":\"tnsqxtlt\",\"closeTime\":\"krdpqgfhyrfr\",\"modificationTime\":\"kldgrcwfcmfc\",\"statusModificationUserName\":\"jajqmatxjt\",\"statusModificationTime\":\"ln\"},\"eTag\":\"gxxgfb\",\"id\":\"mtlpqagyno\",\"name\":\"prnzc\",\"type\":\"lin\"},{\"properties\":{\"definition\":{\"type\":\"xCloud\",\"category\":\"Cost\",\"criteria\":\"CreditThresholdApproaching\"},\"description\":\"ibmq\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"Annually\",\"periodStartDate\":\"uqguhfupetasvvoq\",\"triggeredBy\":\"pkflanfkgxsyao\",\"resourceGroupFilter\":[\"dataowpuohdkcpr\",\"dataukxrzti\",\"datachlutixmqru\",\"datajizcbfzmcrunfhiu\"],\"resourceFilter\":[\"datafbcpaqktkrumzu\",\"datadkyzbfvxov\",\"datakxiuxqggvqr\",\"datahyhlwcjsqg\"],\"meterFilter\":[\"dataffbxrqrkij\",\"dataeuqlsdxeqztv\"],\"tagFilter\":\"datamwwmjswenaww\",\"operator\":\"LessThan\",\"unit\":\"qioulndhzyoeojht\",\"contactEmails\":[\"svidmytzlnglx\"],\"contactGroups\":[\"vyoanfbcswqagywv\",\"xigvjrktpgaeuk\"],\"contactRoles\":[\"ohpmwhqn\",\"csklhsidsjt\",\"lpbnin\"],\"overridingAlert\":\"azlsvbzfcpuo\",\"departmentName\":\"dwjcciklhs\",\"companyName\":\"krdre\",\"enrollmentNumber\":\"olr\",\"enrollmentStartDate\":\"ehqbeivdlhydwbdb\",\"enrollmentEndDate\":\"rlpunytjlkesmmpa\"},\"costEntityId\":\"btahdeanii\",\"status\":\"None\",\"creationTime\":\"vgw\",\"closeTime\":\"fftedousnktj\",\"modificationTime\":\"ravaq\",\"statusModificationUserName\":\"fkbebauzl\",\"statusModificationTime\":\"txxwpfh\"},\"eTag\":\"zudrtpzk\",\"id\":\"meboywhczzq\",\"name\":\"hmngqb\",\"type\":\"dygisrzwnykd\"}],\"nextLink\":\"jch\"}"; + = "{\"value\":[{\"properties\":{\"definition\":{\"type\":\"General\",\"category\":\"System\",\"criteria\":\"ForecastUsageThresholdExceeded\"},\"description\":\"zbhur\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Monthly\",\"periodStartDate\":\"rhhmojusu\",\"triggeredBy\":\"fjzc\",\"resourceGroupFilter\":[\"\\\"dataxoia\\\"\",\"\\\"dataahfxwccok\\\"\",\"\\\"dataxkukm\\\"\",\"\\\"datac\\\"\"],\"resourceFilter\":[\"\\\"datauhhoqeqshavlj\\\"\",\"\\\"datak\\\"\",\"\\\"datayrqolnthbbnkgz\\\"\"],\"meterFilter\":[\"\\\"datadrnzkjthf\\\"\",\"\\\"dataeyjncjmlfuy\\\"\"],\"tagFilter\":\"\\\"databpfiddhlrufz\\\"\",\"threshold\":6885937330554679096,\"operator\":\"LessThan\",\"amount\":2017347006043496374,\"unit\":\"ocuselqk\",\"currentSpend\":9118825195845212240,\"contactEmails\":[\"xu\",\"dqmdtffis\"],\"contactGroups\":[\"kkhmwdmdlgyqixok\",\"tja\",\"hvagnqfqqdlcvmy\"],\"contactRoles\":[\"aymjchtvsnvlaq\",\"nzyzawatuwqko\",\"bczothymgobllms\",\"wgwima\"],\"overridingAlert\":\"eakhtmhobcya\",\"departmentName\":\"fvqtvkhgvoo\",\"companyName\":\"kfnaoaqymhc\",\"enrollmentNumber\":\"opuowyrnskbyhqu\",\"enrollmentStartDate\":\"zygxvha\",\"enrollmentEndDate\":\"xecxqnwh\",\"invoicingThreshold\":3619792924946856688},\"costEntityId\":\"wmvgxsmpknpwir\",\"status\":\"Active\",\"creationTime\":\"ewxqouoxudnm\",\"closeTime\":\"aprhknqiijgencdg\",\"modificationTime\":\"queqihk\",\"statusModificationUserName\":\"owl\",\"statusModificationTime\":\"ouwhldxwhie\"},\"eTag\":\"oqksmfxmcvpr\",\"id\":\"vkitb\",\"name\":\"jtdyotnplfa\",\"type\":\"qoccqrqxwetjt\"},{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Cost\",\"criteria\":\"CostThresholdExceeded\"},\"description\":\"txop\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Quarterly\",\"periodStartDate\":\"mdzgsszxvc\",\"triggeredBy\":\"bbxuharlsirn\",\"resourceGroupFilter\":[\"\\\"dataabvoyngsuxxcz\\\"\",\"\\\"datamyqjog\\\"\",\"\\\"datadsaidjanormovdxx\\\"\",\"\\\"datarntu\\\"\"],\"resourceFilter\":[\"\\\"datail\\\"\",\"\\\"datanwemhdeeljslkyo\\\"\",\"\\\"datad\\\"\"],\"meterFilter\":[\"\\\"datajue\\\"\",\"\\\"datarhrhtsl\\\"\"],\"tagFilter\":\"\\\"datatv\\\"\",\"threshold\":6792919774602104835,\"operator\":\"LessThanOrEqualTo\",\"amount\":4516384583842704902,\"unit\":\"obpnjodf\",\"currentSpend\":7906418026810627066,\"contactEmails\":[\"mtqsmoxsazu\",\"ejgwe\",\"ywnfyszzaczs\"],\"contactGroups\":[\"bdnd\"],\"contactRoles\":[\"ozsyvrm\",\"jmyitrchwudl\"],\"overridingAlert\":\"eihtpmnoejh\",\"departmentName\":\"fmsibzoyrfgxkyd\",\"companyName\":\"yp\",\"enrollmentNumber\":\"qvmtywhlakx\",\"enrollmentStartDate\":\"jpewpyjlfx\",\"enrollmentEndDate\":\"pqcrzgeuqxbpiat\",\"invoicingThreshold\":4282605635496729013},\"costEntityId\":\"egqdtadrakgd\",\"status\":\"Overridden\",\"creationTime\":\"rukizyhgsqt\",\"closeTime\":\"s\",\"modificationTime\":\"xqfpj\",\"statusModificationUserName\":\"ggweeiwdhdmncgb\",\"statusModificationTime\":\"uscstunmlh\"},\"eTag\":\"fbklciichgjsysmv\",\"id\":\"dgwxfkzsifcu\",\"name\":\"bdujgcwxvecbb\",\"type\":\"jtrdxr\"}],\"nextLink\":\"agbbgia\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AlertsResult response = manager.alerts() - .listExternalWithResponse(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "qbmfuvqarwz", + .listExternalWithResponse(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "awgazmxjqifh", com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListWithResponseMockTests.java index 9b6c71577912..f18fbd03df26 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsListWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AlertsResult; @@ -20,16 +20,17 @@ public final class AlertsListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"definition\":{\"type\":\"General\",\"category\":\"Cost\",\"criteria\":\"MultiCurrency\"},\"description\":\"gamxzkrrcoiis\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Monthly\",\"periodStartDate\":\"cekuz\",\"triggeredBy\":\"sbezaxyfukzxuizh\",\"resourceGroupFilter\":[\"dataepkpe\"],\"resourceFilter\":[\"datarx\",\"dataiubxdukec\"],\"meterFilter\":[\"dataazvdhctmmkosz\",\"datadblnsntrp\",\"dataaqkiofkb\"],\"tagFilter\":\"datamhklbnl\",\"operator\":\"EqualTo\",\"unit\":\"hez\",\"contactEmails\":[\"usqxutrpbrr\",\"yuuatvlmbjwcolbm\"],\"contactGroups\":[\"nwtpcpahprz\"],\"contactRoles\":[\"hmtfho\",\"nxzcm\",\"hngxnoqrxtd\"],\"overridingAlert\":\"njevhdlmydidw\",\"departmentName\":\"pfwwt\",\"companyName\":\"doesxxhmwcdb\",\"enrollmentNumber\":\"yo\",\"enrollmentStartDate\":\"xkxhnegknjzrbhtm\",\"enrollmentEndDate\":\"lvukaobrlb\"},\"costEntityId\":\"nbagnchj\",\"status\":\"Dismissed\",\"creationTime\":\"uowakyw\",\"closeTime\":\"hjym\",\"modificationTime\":\"gqtagd\",\"statusModificationUserName\":\"lss\",\"statusModificationTime\":\"jomevtfycnlb\"},\"eTag\":\"jcodkkgjiiytssi\",\"id\":\"izbcufqbvntnr\",\"name\":\"mqso\",\"type\":\"hcekxgnlykm\"},{\"properties\":{\"definition\":{\"type\":\"General\",\"category\":\"Cost\",\"criteria\":\"ForecastCostThresholdExceeded\"},\"description\":\"sqdtiwlwxlbon\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Monthly\",\"periodStartDate\":\"cqchygtvxbyjane\",\"triggeredBy\":\"bdpkxyqvgx\",\"resourceGroupFilter\":[\"datadetv\"],\"resourceFilter\":[\"dataxdxuwsaifmc\",\"datanosbz\",\"dataehgcvkbcknjo\",\"datagjyy\"],\"meterFilter\":[\"dataels\",\"dataerqzevxo\"],\"tagFilter\":\"dataintxwa\",\"operator\":\"GreaterThan\",\"unit\":\"blqwaafrqulhmzy\",\"contactEmails\":[\"vafjrqpjiyrqj\"],\"contactGroups\":[\"a\",\"wmzwdfkbnrzorpdl\",\"bqc\",\"qjf\"],\"contactRoles\":[\"saetgzdgvpyig\",\"aqqilzdcduwjoed\"],\"overridingAlert\":\"gucaif\",\"departmentName\":\"urwwgilfjq\",\"companyName\":\"cdmkxwxdcvjw\",\"enrollmentNumber\":\"z\",\"enrollmentStartDate\":\"keciqchxrtuicd\",\"enrollmentEndDate\":\"wdfmmpzhzzwvywr\"},\"costEntityId\":\"gydgrpxncakiq\",\"status\":\"Dismissed\",\"creationTime\":\"jrkc\",\"closeTime\":\"mgglvlmfe\",\"modificationTime\":\"oqeykglt\",\"statusModificationUserName\":\"xhqf\",\"statusModificationTime\":\"ka\"},\"eTag\":\"jsxtlgflwfgziiuc\",\"id\":\"jjceatlijjjr\",\"name\":\"va\",\"type\":\"caszk\"},{\"properties\":{\"definition\":{\"type\":\"Budget\",\"category\":\"Usage\",\"criteria\":\"ForecastUsageThresholdExceeded\"},\"description\":\"vkunmign\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"Monthly\",\"periodStartDate\":\"ogjwpindedvabbxb\",\"triggeredBy\":\"edeilb\",\"resourceGroupFilter\":[\"datafcfxzirzzihvwy\",\"datausuv\",\"dataslczwciidjsllf\"],\"resourceFilter\":[\"datadmvxadq\",\"datacfrgnawbabgfbkt\",\"datajmfczlfsyqkf\"],\"meterFilter\":[\"datag\",\"datawoxqm\"],\"tagFilter\":\"dataajcxnyqgxhl\",\"operator\":\"GreaterThanOrEqualTo\",\"unit\":\"simjceagbjqvlsu\",\"contactEmails\":[\"ashxgonoyjfqi\"],\"contactGroups\":[\"yznclkfkee\"],\"contactRoles\":[\"opemtu\"],\"overridingAlert\":\"ujlyegq\",\"departmentName\":\"nigflqqbtnyj\",\"companyName\":\"lxdbfvabmvms\",\"enrollmentNumber\":\"aevwjcnkot\",\"enrollmentStartDate\":\"wuhvaj\",\"enrollmentEndDate\":\"ilfemjj\"},\"costEntityId\":\"zwjiqullq\",\"status\":\"Dismissed\",\"creationTime\":\"vr\",\"closeTime\":\"mqerndb\",\"modificationTime\":\"yeofltfnnxrkad\",\"statusModificationUserName\":\"ynnfmuiii\",\"statusModificationTime\":\"pfoh\"},\"eTag\":\"fkx\",\"id\":\"bcbrwjiutgnjizbe\",\"name\":\"woiymrvz\",\"type\":\"juyrsrziuctixg\"},{\"properties\":{\"definition\":{\"type\":\"Budget\",\"category\":\"Billing\",\"criteria\":\"CostThresholdExceeded\"},\"description\":\"aapezkiswqjmdghs\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"BillingMonth\",\"periodStartDate\":\"ufptb\",\"triggeredBy\":\"z\",\"resourceGroupFilter\":[\"dataiuiyqvldas\",\"datav\",\"datapisqqzlgcndhzx\",\"datarfc\"],\"resourceFilter\":[\"datahkhg\"],\"meterFilter\":[\"datauww\",\"datapphefsbzx\"],\"tagFilter\":\"datazxomeikjclwz\",\"operator\":\"LessThanOrEqualTo\",\"unit\":\"fsuqtaazyqbxy\",\"contactEmails\":[\"puq\"],\"contactGroups\":[\"ezxlhdjzqdca\",\"wvpsoz\"],\"contactRoles\":[\"hjriyb\"],\"overridingAlert\":\"zo\",\"departmentName\":\"nxwdvwnjkg\",\"companyName\":\"nmx\",\"enrollmentNumber\":\"rsqftib\",\"enrollmentStartDate\":\"ibuyvpirf\",\"enrollmentEndDate\":\"pnqn\"},\"costEntityId\":\"sbede\",\"status\":\"None\",\"creationTime\":\"k\",\"closeTime\":\"hxvucnu\",\"modificationTime\":\"mnhjevdyzn\",\"statusModificationUserName\":\"jsvkskmqozzkivy\",\"statusModificationTime\":\"rl\"},\"eTag\":\"zji\",\"id\":\"lqfhefkwabs\",\"name\":\"lronqqlmg\",\"type\":\"lqxsjxtelex\"}],\"nextLink\":\"uqbo\"}"; + = "{\"value\":[{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"System\",\"criteria\":\"UsageThresholdExceeded\"},\"description\":\"huqimlda\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingQuarter\",\"periodStartDate\":\"ifmuadjnfsncsk\",\"triggeredBy\":\"oshjgcze\",\"resourceGroupFilter\":[\"\\\"datanxgztlcgctjchfj\\\"\",\"\\\"datamywj\\\"\"],\"resourceFilter\":[\"\\\"dataecu\\\"\",\"\\\"datalbefvwc\\\"\",\"\\\"datajkxpylrwoxzgwpsy\\\"\",\"\\\"datajijeypdvrb\\\"\"],\"meterFilter\":[\"\\\"datadkdkgawqwjxi\\\"\",\"\\\"datadfkcef\\\"\"],\"tagFilter\":\"\\\"datagzqpjoi\\\"\",\"threshold\":7970405155554870888,\"operator\":\"LessThan\",\"amount\":620249668581597127,\"unit\":\"xumentqontwhy\",\"currentSpend\":4099757386895740189,\"contactEmails\":[\"wi\",\"qtow\"],\"contactGroups\":[\"sycoybajasqub\",\"ajcywhjqw\"],\"contactRoles\":[\"qo\",\"tfxcpupuk\",\"ymjzpwdlvwtiws\"],\"overridingAlert\":\"sa\",\"departmentName\":\"hq\",\"companyName\":\"mppultas\",\"enrollmentNumber\":\"ekewnazeaj\",\"enrollmentStartDate\":\"aj\",\"enrollmentEndDate\":\"yizyddcvxodk\",\"invoicingThreshold\":5873155808619890798},\"costEntityId\":\"xbydesqlvgecpw\",\"status\":\"Resolved\",\"creationTime\":\"tzxnmxsdobygoog\",\"closeTime\":\"apjxvazyjfucsao\",\"modificationTime\":\"nosdkvi\",\"statusModificationUserName\":\"asgmatrnzpd\",\"statusModificationTime\":\"daaktuj\"},\"eTag\":\"zboimyfpqdo\",\"id\":\"ppnwyytfvpctfji\",\"name\":\"ffffg\",\"type\":\"uhznwhvuldbk\"}],\"nextLink\":\"jjkj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - AlertsResult response = manager.alerts().listWithResponse("scz", com.azure.core.util.Context.NONE).getValue(); + AlertsResult response + = manager.alerts().listWithResponse("xapeqiscrpi", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsResultInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsResultInnerTests.java index 7e2ffa03a192..9d0277040408 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsResultInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AlertsResultInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,13 +11,7 @@ public final class AlertsResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertsResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"definition\":{\"type\":\"General\",\"category\":\"Cost\",\"criteria\":\"InvoiceDueDateApproaching\"},\"description\":\"szkkfoqre\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Quarterly\",\"periodStartDate\":\"jawneaiv\",\"triggeredBy\":\"czelpcirel\",\"resourceGroupFilter\":[\"dataaenwabf\"],\"resourceFilter\":[\"datalddxbjhwua\"],\"meterFilter\":[\"datazjosp\"],\"tagFilter\":\"dataoulpjrv\",\"operator\":\"GreaterThan\",\"unit\":\"imjwosyt\",\"contactEmails\":[\"skfc\",\"tq\",\"miekkezzikhlyfjh\",\"gqggebdunygae\"],\"contactGroups\":[\"bqfatpxllrxcyjmo\"],\"contactRoles\":[\"uvarmywdmjsjq\"],\"overridingAlert\":\"hhyxxrw\",\"departmentName\":\"co\",\"companyName\":\"hp\",\"enrollmentNumber\":\"kgymareqnajxqug\",\"enrollmentStartDate\":\"ky\",\"enrollmentEndDate\":\"beddgssofw\"},\"costEntityId\":\"qal\",\"status\":\"Dismissed\",\"creationTime\":\"jijpxac\",\"closeTime\":\"udfnbyxba\",\"modificationTime\":\"bjyvay\",\"statusModificationUserName\":\"imrzrtuzqog\",\"statusModificationTime\":\"xnevfdnwn\"},\"eTag\":\"ewzsyyceuzsoib\",\"id\":\"ud\",\"name\":\"frxtrthzvaytdwk\",\"type\":\"brqubp\"},{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Cost\",\"criteria\":\"QuotaThresholdReached\"},\"description\":\"pdtii\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Monthly\",\"periodStartDate\":\"xoruzfgsquyfxrx\",\"triggeredBy\":\"eptra\",\"resourceGroupFilter\":[\"dataezw\",\"datawnwxuqlcvyd\"],\"resourceFilter\":[\"datatdooaoj\",\"dataniodkooeb\",\"datanuj\",\"dataemmsbvdkc\"],\"meterFilter\":[\"datatjinf\",\"datajlfltkacjvefkdlf\"],\"tagFilter\":\"datakggkfpa\",\"operator\":\"None\",\"unit\":\"lpqblylsyxk\",\"contactEmails\":[\"jervtia\",\"xsdszuempsb\"],\"contactGroups\":[\"z\"],\"contactRoles\":[\"v\",\"nqicvinvkjjxdxrb\",\"ukzclewyhmlwpaz\",\"zpof\"],\"overridingAlert\":\"ckw\",\"departmentName\":\"zqwhxxbuyqaxzfeq\",\"companyName\":\"ppriol\",\"enrollmentNumber\":\"rjaltolmncw\",\"enrollmentStartDate\":\"bqwcsdbnwdcf\",\"enrollmentEndDate\":\"cqdpfuv\"},\"costEntityId\":\"bjj\",\"status\":\"None\",\"creationTime\":\"xbvtvudu\",\"closeTime\":\"cormr\",\"modificationTime\":\"qtvcofudflvkgj\",\"statusModificationUserName\":\"gdknnqv\",\"statusModificationTime\":\"znqntoru\"},\"eTag\":\"gsahmkycgrauw\",\"id\":\"uetae\",\"name\":\"uruv\",\"type\":\"movsmzlxwabmqoe\"}],\"nextLink\":\"ifrvtpu\"}") + "{\"value\":[{\"properties\":{\"definition\":{\"type\":\"Invoice\",\"category\":\"Cost\",\"criteria\":\"UsageThresholdExceeded\"},\"description\":\"a\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"BillingAnnual\",\"periodStartDate\":\"tg\",\"triggeredBy\":\"nzeyqxtjj\",\"resourceGroupFilter\":[\"\\\"datalqhy\\\"\",\"\\\"dataavodg\\\"\",\"\\\"dataxdbeesmieknl\\\"\"],\"resourceFilter\":[\"\\\"dataiaa\\\"\"],\"meterFilter\":[\"\\\"dataagy\\\"\",\"\\\"datawqfbylyrfgiagt\\\"\",\"\\\"dataojocqwogf\\\"\",\"\\\"datazjvusfzldmo\\\"\"],\"tagFilter\":\"\\\"dataxylfsb\\\"\",\"threshold\":1611950859305469556,\"operator\":\"GreaterThanOrEqualTo\",\"amount\":3166391401625844640,\"unit\":\"btgkbugrjqctoj\",\"currentSpend\":7884042525688664629,\"contactEmails\":[\"ieypef\",\"jy\",\"dh\",\"u\"],\"contactGroups\":[\"plcwkhi\"],\"contactRoles\":[\"lhzdsqtzb\",\"rgnowcjhfgm\",\"ecactx\",\"wotey\"],\"overridingAlert\":\"cluqovekqvgqo\",\"departmentName\":\"ifzmpjwyivqi\",\"companyName\":\"xcvhrfs\",\"enrollmentNumber\":\"uagrttikteusqc\",\"enrollmentStartDate\":\"vyklxuby\",\"enrollmentEndDate\":\"ff\",\"invoicingThreshold\":5041771536859966290},\"costEntityId\":\"cqc\",\"status\":\"None\",\"creationTime\":\"qibrtalme\",\"closeTime\":\"t\",\"modificationTime\":\"dslqxihhrmooizqs\",\"statusModificationUserName\":\"pxiutc\",\"statusModificationTime\":\"pzhyr\"},\"eTag\":\"togebjoxsl\",\"id\":\"nhl\",\"name\":\"brqnkkzjcjb\",\"type\":\"rgaehvvibrxjj\"},{\"properties\":{\"definition\":{\"type\":\"BudgetForecast\",\"category\":\"Cost\",\"criteria\":\"ForecastCostThresholdExceeded\"},\"description\":\"xztmo\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"Quarterly\",\"periodStartDate\":\"dgfcwqmp\",\"triggeredBy\":\"aqxzhemjyho\",\"resourceGroupFilter\":[\"\\\"dataswtwkozzwc\\\"\",\"\\\"datalkb\\\"\",\"\\\"datawpfaj\\\"\"],\"resourceFilter\":[\"\\\"dataltlwtjjguktalhs\\\"\",\"\\\"datavkcdmxzr\\\"\",\"\\\"dataoaimlnw\\\"\",\"\\\"dataaaomylweazu\\\"\"],\"meterFilter\":[\"\\\"dataethwwnpjhlfz\\\"\",\"\\\"datawpchwahf\\\"\"],\"tagFilter\":\"\\\"datausnfepgfewet\\\"\",\"threshold\":7432084644277094724,\"operator\":\"GreaterThan\",\"amount\":7638833619552279954,\"unit\":\"xhdjhl\",\"currentSpend\":457347033640249193,\"contactEmails\":[\"f\"],\"contactGroups\":[\"po\",\"xvxcjzhq\",\"zxfpxtgqsc\"],\"contactRoles\":[\"ftjuh\",\"qaz\"],\"overridingAlert\":\"tgguwpijrajcivmm\",\"departmentName\":\"f\",\"companyName\":\"iwrxgkn\",\"enrollmentNumber\":\"vyi\",\"enrollmentStartDate\":\"qodfvp\",\"enrollmentEndDate\":\"hoxgsgbpf\",\"invoicingThreshold\":1586087299236435326},\"costEntityId\":\"xvzflbqv\",\"status\":\"None\",\"creationTime\":\"lgafcqusrdve\",\"closeTime\":\"wsdtutnwl\",\"modificationTime\":\"ycvuzhyrmewipmv\",\"statusModificationUserName\":\"dxukuqgsjjxundxg\",\"statusModificationTime\":\"twzhhzjhfjmhv\"},\"eTag\":\"uvgp\",\"id\":\"neqsxvmh\",\"name\":\"buzjyih\",\"type\":\"as\"},{\"properties\":{\"definition\":{\"type\":\"Credit\",\"category\":\"Billing\",\"criteria\":\"ForecastCostThresholdExceeded\"},\"description\":\"emslynsqyrp\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingQuarter\",\"periodStartDate\":\"tyms\",\"triggeredBy\":\"ygqdnfwqzdz\",\"resourceGroupFilter\":[\"\\\"datala\\\"\",\"\\\"datahnfhqlyvijouwi\\\"\"],\"resourceFilter\":[\"\\\"dataoyzunbixxr\\\"\",\"\\\"dataikvcpwp\\\"\",\"\\\"dataclrcivtsox\\\"\"],\"meterFilter\":[\"\\\"dataenxpmyyefr\\\"\"],\"tagFilter\":\"\\\"datapdnqqskawaoqvmmb\\\"\",\"threshold\":2313721487251926141,\"operator\":\"GreaterThanOrEqualTo\",\"amount\":6511698838376376158,\"unit\":\"megni\",\"currentSpend\":5642937888477682307,\"contactEmails\":[\"zyqdrfegcealzx\",\"hcans\"],\"contactGroups\":[\"yqhlwigdivbkbx\",\"omfaj\"],\"contactRoles\":[\"sqvdaeyygux\",\"kjsqzhzbezkgi\"],\"overridingAlert\":\"idxas\",\"departmentName\":\"ddyvvjskgfmo\",\"companyName\":\"ah\",\"enrollmentNumber\":\"gat\",\"enrollmentStartDate\":\"a\",\"enrollmentEndDate\":\"hvjhhnakzyb\",\"invoicingThreshold\":2360268264871837055},\"costEntityId\":\"jks\",\"status\":\"None\",\"creationTime\":\"xvxevblbjednljla\",\"closeTime\":\"uaulxunsm\",\"modificationTime\":\"nkppxynen\",\"statusModificationUserName\":\"vxei\",\"statusModificationTime\":\"gwklnsr\"},\"eTag\":\"feycxcktp\",\"id\":\"merteeammxqiek\",\"name\":\"kzddrtkgdojbmxva\",\"type\":\"refdee\"},{\"properties\":{\"definition\":{\"type\":\"BudgetForecast\",\"category\":\"System\",\"criteria\":\"QuotaThresholdReached\"},\"description\":\"xs\",\"source\":\"User\",\"details\":{\"timeGrainType\":\"Annually\",\"periodStartDate\":\"wsawddjibabxvi\",\"triggeredBy\":\"tvtzeexavoxtfg\",\"resourceGroupFilter\":[\"\\\"datadmdqb\\\"\"],\"resourceFilter\":[\"\\\"datapqtgsfjac\\\"\"],\"meterFilter\":[\"\\\"datahhxud\\\"\",\"\\\"dataxvodhtnsir\\\"\",\"\\\"datadhzmmesckdlp\\\"\",\"\\\"datagzrcxfailcfxwmdb\\\"\"],\"tagFilter\":\"\\\"datadfgsftufqobrj\\\"\",\"threshold\":1836085165477961052,\"operator\":\"None\",\"amount\":7176311738598981100,\"unit\":\"hxkizvytnrzv\",\"currentSpend\":6118746453005595939,\"contactEmails\":[\"eranokqgukkjqnv\",\"roylaxxu\",\"cdisd\",\"sfjbjsvg\"],\"contactGroups\":[\"hryvy\",\"ytdc\",\"xgccknfnw\"],\"contactRoles\":[\"mvpdvjdhttzaef\",\"dxihc\",\"rphkmcrjdqnsdfz\"],\"overridingAlert\":\"gtgkylkdghr\",\"departmentName\":\"uutlwxezwzhok\",\"companyName\":\"wnhhtqlgehgppip\",\"enrollmentNumber\":\"hpfeoajvgcxtxjc\",\"enrollmentStartDate\":\"eafidltugsresm\",\"enrollmentEndDate\":\"sjhoiftxfkfwegpr\",\"invoicingThreshold\":2543866141895923842},\"costEntityId\":\"lucbiqtgdqohm\",\"status\":\"Active\",\"creationTime\":\"drizetpwbr\",\"closeTime\":\"llibphbqzmizak\",\"modificationTime\":\"ankjpdnjzh\",\"statusModificationUserName\":\"oylhjlmuoyxprimr\",\"statusModificationTime\":\"pteecjme\"},\"eTag\":\"ls\",\"id\":\"asylwx\",\"name\":\"zaum\",\"type\":\"eoohguufuzboyj\"}],\"nextLink\":\"hwtzolb\"}") .toObject(AlertsResultInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsResultInner model = new AlertsResultInner(); - model = BinaryData.fromObject(model).toObject(AlertsResultInner.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsBenefitDetailsTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsBenefitDetailsTests.java index 8b5e5f55526d..1fe3eca5051c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsBenefitDetailsTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsBenefitDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -10,12 +10,8 @@ public final class AllSavingsBenefitDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AllSavingsBenefitDetails model = BinaryData.fromString("{}").toObject(AllSavingsBenefitDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllSavingsBenefitDetails model = new AllSavingsBenefitDetails(); - model = BinaryData.fromObject(model).toObject(AllSavingsBenefitDetails.class); + AllSavingsBenefitDetails model = BinaryData.fromString( + "{\"overageCost\":7806007898272414457,\"benefitCost\":9053238538257833941,\"totalCost\":2040247142384774722,\"savingsAmount\":249918472988744102,\"savingsPercentage\":1379717775548837237,\"coveragePercentage\":363773495915623992,\"commitmentAmount\":4941943034356922690,\"averageUtilizationPercentage\":5266325322755077300,\"wastageCost\":2222656597681815737}") + .toObject(AllSavingsBenefitDetails.class); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsListTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsListTests.java index 5bc80745e4f5..a2202d994dcf 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsListTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AllSavingsListTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -10,13 +10,8 @@ public final class AllSavingsListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AllSavingsList model = BinaryData.fromString("{\"value\":[{},{}],\"nextLink\":\"enbbklqpxzucafed\"}") + AllSavingsList model = BinaryData.fromString( + "{\"value\":[{\"overageCost\":4672392309994577286,\"benefitCost\":5096107233757283077,\"totalCost\":4206485028697506580,\"savingsAmount\":4461489025878240096,\"savingsPercentage\":3653577462373543887,\"coveragePercentage\":872677170884522891,\"commitmentAmount\":7853679514398869715,\"averageUtilizationPercentage\":3136768960228890949,\"wastageCost\":2729731278853847628},{\"overageCost\":1387562309618024001,\"benefitCost\":2310378494180433800,\"totalCost\":813568006427040129,\"savingsAmount\":6987184317668746644,\"savingsPercentage\":7164344086895072546,\"coveragePercentage\":4791971430751992803,\"commitmentAmount\":3331007678270504081,\"averageUtilizationPercentage\":814369979223329466,\"wastageCost\":415552596381941808},{\"overageCost\":3365280671327791435,\"benefitCost\":5181301429444209355,\"totalCost\":2313274218462985682,\"savingsAmount\":7191368843592335981,\"savingsPercentage\":112541729358028808,\"coveragePercentage\":742594223224193403,\"commitmentAmount\":8845155134951559876,\"averageUtilizationPercentage\":3326009979398188569,\"wastageCost\":7302398672549692336},{\"overageCost\":2014087584560801092,\"benefitCost\":811842344850344017,\"totalCost\":5720943727990735917,\"savingsAmount\":5603890376381404628,\"savingsPercentage\":3421816502617802165,\"coveragePercentage\":8686349552402466147,\"commitmentAmount\":5418262347442354968,\"averageUtilizationPercentage\":6247765991879321835,\"wastageCost\":6216578043867434539}],\"nextLink\":\"foiyjwpfilk\"}") .toObject(AllSavingsList.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllSavingsList model = new AllSavingsList(); - model = BinaryData.fromObject(model).toObject(AllSavingsList.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AsyncOperationStatusPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AsyncOperationStatusPropertiesTests.java new file mode 100644 index 000000000000..353075633842 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/AsyncOperationStatusPropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.AsyncOperationStatusProperties; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AsyncOperationStatusPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AsyncOperationStatusProperties model = BinaryData.fromString( + "{\"reportUrl\":\"UtilizedPercentage\",\"secondaryReportUrl\":\"UtilizedPercentage\",\"validUntil\":\"2021-12-03T16:31Z\"}") + .toObject(AsyncOperationStatusProperties.class); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.UTILIZED_PERCENTAGE, model.reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.UTILIZED_PERCENTAGE, model.secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T16:31Z"), model.validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitResourceTests.java index 2250dd542d95..d868d5b97b3e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitResourceTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitResourceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,8 @@ public final class BenefitResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BenefitResource model = BinaryData - .fromString( - "{\"kind\":\"IncludedQuantity\",\"id\":\"nlzafwxudgnh\",\"name\":\"ookrtalvnbw\",\"type\":\"pbeme\"}") + .fromString("{\"kind\":\"Reservation\",\"id\":\"qivbgkcvkh\",\"name\":\"zvuqdflvon\",\"type\":\"yp\"}") .toObject(BenefitResource.class); - Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BenefitResource model = new BenefitResource().withKind(BenefitKind.INCLUDED_QUANTITY); - model = BinaryData.fromObject(model).toObject(BenefitResource.class); - Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.kind()); + Assertions.assertEquals(BenefitKind.RESERVATION, model.kind()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdMockTests.java index c45a5b082a16..88c6cd9d6589 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingAccountIdMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummary; @@ -22,17 +22,17 @@ public final class BenefitUtilizationSummariesListByBillingAccountIdMockTests { @Test public void testListByBillingAccountId() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"j\",\"name\":\"ywhjqwmchq\",\"type\":\"htfxcpupuki\"}]}"; + = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"ttpfsmwgsgh\",\"name\":\"ucumlddauqml\",\"type\":\"feothxu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.benefitUtilizationSummaries() - .listByBillingAccountId("h", GrainParameter.HOURLY, "ycoybajasqubf", com.azure.core.util.Context.NONE); + .listByBillingAccountId("ypwyiulayno", GrainParameter.DAILY, "gkfh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdMockTests.java index 013c0dbb6064..533be345340b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListByBillingProfileIdMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummary; @@ -22,17 +22,17 @@ public final class BenefitUtilizationSummariesListByBillingProfileIdMockTests { @Test public void testListByBillingProfileId() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"amppultassaekewn\",\"name\":\"zeajbk\",\"type\":\"jlcyizy\"}]}"; + = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"l\",\"name\":\"oizwxvs\",\"type\":\"ksgfyyskyekg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.benefitUtilizationSummaries() - .listByBillingProfileId("mjzpwdlvwtiwsm", "sa", GrainParameter.HOURLY, "hq", + .listByBillingProfileId("rigrjdljlkq", "vkrbzkuastaxklpr", GrainParameter.DAILY, "l", com.azure.core.util.Context.NONE); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdMockTests.java index 1400fe88cc64..19a8a602df68 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanIdMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummary; @@ -22,17 +22,17 @@ public final class BenefitUtilizationSummariesListBySavingsPlanIdMockTests { @Test public void testListBySavingsPlanId() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"gmat\",\"name\":\"nzpducdaaktu\",\"type\":\"ktz\"}]}"; + = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"bu\",\"name\":\"avqdorbccqcd\",\"type\":\"thojvlirknucos\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.benefitUtilizationSummaries() - .listBySavingsPlanId("pjxvazyjf", "csa", "djnosdkvibf", GrainParameter.MONTHLY, + .listBySavingsPlanId("itzovnkr", "iklsmni", "qlcoqksyiibhyx", GrainParameter.DAILY, com.azure.core.util.Context.NONE); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderMockTests.java index 128a5c7c8eb8..398ab6928232 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListBySavingsPlanOrderMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummary; @@ -22,17 +22,17 @@ public final class BenefitUtilizationSummariesListBySavingsPlanOrderMockTests { @Test public void testListBySavingsPlanOrder() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"lvgecpwgoljtz\",\"name\":\"nm\",\"type\":\"sdobygoogxq\"}]}"; + = "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"wletyveszrtlhpdh\",\"name\":\"ynctaczcnjfmbbfn\",\"type\":\"j\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.benefitUtilizationSummaries() - .listBySavingsPlanOrder("dcvxodkrvfsxxby", "e", GrainParameter.DAILY, com.azure.core.util.Context.NONE); + .listBySavingsPlanOrder("fxcz", "fcck", GrainParameter.HOURLY, com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListResultTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListResultTests.java index c2936820b1cd..d22a048191c8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListResultTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.BenefitUtilizationSummariesListResult; +import org.junit.jupiter.api.Assertions; public final class BenefitUtilizationSummariesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BenefitUtilizationSummariesListResult model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"lvdjjukyr\",\"name\":\"nqodxahhxhq\",\"type\":\"aqnvzoqgyipemchg\"},{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"v\",\"name\":\"czuejdtxptl\",\"type\":\"h\"},{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"zhomewjjstliu\",\"name\":\"qawmoaianc\",\"type\":\"nvodrrs\"},{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"blxydkxr\",\"name\":\"vvbxiwkgfbqljnq\",\"type\":\"hychocokuleh\"}],\"nextLink\":\"qlrqffaweyurk\"}") + "{\"value\":[{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"olvdnd\",\"name\":\"iauogphuartv\",\"type\":\"iukyefchnmna\"},{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"nxhkxjqi\",\"name\":\"wrweoo\",\"type\":\"ffifhx\"}],\"nextLink\":\"snewmozqvbub\"}") .toObject(BenefitUtilizationSummariesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BenefitUtilizationSummariesListResult model = new BenefitUtilizationSummariesListResult(); - model = BinaryData.fromObject(model).toObject(BenefitUtilizationSummariesListResult.class); + Assertions.assertEquals("snewmozqvbub", model.nextLink()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesOperationStatusInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesOperationStatusInnerTests.java new file mode 100644 index 000000000000..38bda718f81c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesOperationStatusInnerTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.BenefitUtilizationSummariesOperationStatusInner; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BenefitUtilizationSummariesOperationStatusInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BenefitUtilizationSummariesOperationStatusInner model = BinaryData.fromString( + "{\"input\":{\"billingAccountId\":\"dlfgtdysnaq\",\"billingProfileId\":\"lqbctqhamzjrw\",\"benefitOrderId\":\"qzeqyjleziunjxdf\",\"benefitId\":\"ntkwcegy\",\"grain\":\"Daily\",\"startDate\":\"2021-02-09T22:26:38Z\",\"endDate\":\"2021-06-30T08:22:13Z\",\"kind\":\"SavingsPlan\"},\"status\":\"Running\",\"properties\":{\"reportUrl\":\"UsageDate\",\"secondaryReportUrl\":\"Kind\",\"validUntil\":\"2021-07-31T13:07:21Z\"}}") + .toObject(BenefitUtilizationSummariesOperationStatusInner.class); + Assertions.assertEquals("dlfgtdysnaq", model.input().billingAccountId()); + Assertions.assertEquals("lqbctqhamzjrw", model.input().billingProfileId()); + Assertions.assertEquals("qzeqyjleziunjxdf", model.input().benefitOrderId()); + Assertions.assertEquals("ntkwcegy", model.input().benefitId()); + Assertions.assertEquals(Grain.DAILY, model.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T22:26:38Z"), model.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T08:22:13Z"), model.input().endDate()); + Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.input().kind()); + Assertions.assertEquals(OperationStatusType.RUNNING, model.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.USAGE_DATE, model.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.KIND, model.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T13:07:21Z"), model.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesRequestTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesRequestTests.java new file mode 100644 index 000000000000..e72c47610644 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummariesRequestTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.Grain; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BenefitUtilizationSummariesRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BenefitUtilizationSummariesRequest model = BinaryData.fromString( + "{\"billingAccountId\":\"hgpdohzj\",\"billingProfileId\":\"tu\",\"benefitOrderId\":\"igebxncnwfepb\",\"benefitId\":\"gfmx\",\"grain\":\"Monthly\",\"startDate\":\"2021-04-20T03:41:42Z\",\"endDate\":\"2021-07-15T11:56:12Z\",\"kind\":\"SavingsPlan\"}") + .toObject(BenefitUtilizationSummariesRequest.class); + Assertions.assertEquals("hgpdohzj", model.billingAccountId()); + Assertions.assertEquals("tu", model.billingProfileId()); + Assertions.assertEquals("igebxncnwfepb", model.benefitOrderId()); + Assertions.assertEquals("gfmx", model.benefitId()); + Assertions.assertEquals(Grain.MONTHLY, model.grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T03:41:42Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T11:56:12Z"), model.endDate()); + Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.kind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BenefitUtilizationSummariesRequest model + = new BenefitUtilizationSummariesRequest().withBillingAccountId("hgpdohzj") + .withBillingProfileId("tu") + .withBenefitOrderId("igebxncnwfepb") + .withBenefitId("gfmx") + .withGrain(Grain.MONTHLY) + .withStartDate(OffsetDateTime.parse("2021-04-20T03:41:42Z")) + .withEndDate(OffsetDateTime.parse("2021-07-15T11:56:12Z")) + .withKind(BenefitKind.SAVINGS_PLAN); + model = BinaryData.fromObject(model).toObject(BenefitUtilizationSummariesRequest.class); + Assertions.assertEquals("hgpdohzj", model.billingAccountId()); + Assertions.assertEquals("tu", model.billingProfileId()); + Assertions.assertEquals("igebxncnwfepb", model.benefitOrderId()); + Assertions.assertEquals("gfmx", model.benefitId()); + Assertions.assertEquals(Grain.MONTHLY, model.grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T03:41:42Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T11:56:12Z"), model.endDate()); + Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.kind()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryInnerTests.java index b252e4c03f59..91267f394de3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -10,15 +10,8 @@ public final class BenefitUtilizationSummaryInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - BenefitUtilizationSummaryInner model = BinaryData - .fromString( - "{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"hy\",\"name\":\"dxravj\",\"type\":\"qdbrxmrgc\"}") + BenefitUtilizationSummaryInner model = BinaryData.fromString( + "{\"kind\":\"BenefitUtilizationSummary\",\"id\":\"amhsycxhxzgazt\",\"name\":\"abo\",\"type\":\"dvmfqhppub\"}") .toObject(BenefitUtilizationSummaryInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BenefitUtilizationSummaryInner model = new BenefitUtilizationSummaryInner(); - model = BinaryData.fromObject(model).toObject(BenefitUtilizationSummaryInner.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryPropertiesTests.java index 9b4a401b43e0..2794c2272ad1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BenefitUtilizationSummaryPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,8 @@ public final class BenefitUtilizationSummaryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BenefitUtilizationSummaryProperties model = BinaryData.fromString( - "{\"armSkuName\":\"wf\",\"benefitId\":\"tnuwjtkschgc\",\"benefitOrderId\":\"y\",\"benefitType\":\"IncludedQuantity\",\"usageDate\":\"2021-04-28T02:09:32Z\"}") + "{\"armSkuName\":\"owolbaui\",\"benefitId\":\"p\",\"benefitOrderId\":\"nszonwpngaj\",\"benefitType\":\"Reservation\",\"usageDate\":\"2021-06-01T23:38:48Z\"}") .toObject(BenefitUtilizationSummaryProperties.class); - Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.benefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BenefitUtilizationSummaryProperties model - = new BenefitUtilizationSummaryProperties().withBenefitType(BenefitKind.INCLUDED_QUANTITY); - model = BinaryData.fromObject(model).toObject(BenefitUtilizationSummaryProperties.class); - Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.benefitType()); + Assertions.assertEquals(BenefitKind.RESERVATION, model.benefitType()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BlobInfoTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BlobInfoTests.java index c7b9c831dca9..db7ec842eac3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BlobInfoTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BlobInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,17 +11,9 @@ public final class BlobInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - BlobInfo model = BinaryData.fromString("{\"blobLink\":\"cxneh\",\"byteCount\":4931484460692199053}") - .toObject(BlobInfo.class); - Assertions.assertEquals("cxneh", model.blobLink()); - Assertions.assertEquals(4931484460692199053L, model.byteCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BlobInfo model = new BlobInfo().withBlobLink("cxneh").withByteCount(4931484460692199053L); - model = BinaryData.fromObject(model).toObject(BlobInfo.class); - Assertions.assertEquals("cxneh", model.blobLink()); - Assertions.assertEquals(4931484460692199053L, model.byteCount()); + BlobInfo model + = BinaryData.fromString("{\"blobLink\":\"va\",\"byteCount\":1594393905994051179}").toObject(BlobInfo.class); + Assertions.assertEquals("va", model.blobLink()); + Assertions.assertEquals(1594393905994051179L, model.byteCount()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetComparisonExpressionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetComparisonExpressionTests.java new file mode 100644 index 000000000000..3d32432155ad --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetComparisonExpressionTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BudgetComparisonExpressionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetComparisonExpression model = BinaryData + .fromString("{\"name\":\"khbzhfepgzg\",\"operator\":\"In\",\"values\":[\"zloc\",\"scpai\",\"rhhbcs\"]}") + .toObject(BudgetComparisonExpression.class); + Assertions.assertEquals("khbzhfepgzg", model.name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.operator()); + Assertions.assertEquals("zloc", model.values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BudgetComparisonExpression model = new BudgetComparisonExpression().withName("khbzhfepgzg") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("zloc", "scpai", "rhhbcs")); + model = BinaryData.fromObject(model).toObject(BudgetComparisonExpression.class); + Assertions.assertEquals("khbzhfepgzg", model.name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.operator()); + Assertions.assertEquals("zloc", model.values().get(0)); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetFilterPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetFilterPropertiesTests.java new file mode 100644 index 000000000000..d96565ec559e --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetFilterPropertiesTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BudgetFilterPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetFilterProperties model = BinaryData.fromString( + "{\"dimensions\":{\"name\":\"rjb\",\"operator\":\"In\",\"values\":[\"rcjxvsnbyxqabn\",\"ocpcy\",\"hurzafblj\"]},\"tags\":{\"name\":\"pbtoqcjmkl\",\"operator\":\"In\",\"values\":[\"bqidtqaj\",\"yulpkudjkr\"]}}") + .toObject(BudgetFilterProperties.class); + Assertions.assertEquals("rjb", model.dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.dimensions().operator()); + Assertions.assertEquals("rcjxvsnbyxqabn", model.dimensions().values().get(0)); + Assertions.assertEquals("pbtoqcjmkl", model.tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.tags().operator()); + Assertions.assertEquals("bqidtqaj", model.tags().values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BudgetFilterProperties model = new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("rjb") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("rcjxvsnbyxqabn", "ocpcy", "hurzafblj"))) + .withTags(new BudgetComparisonExpression().withName("pbtoqcjmkl") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("bqidtqaj", "yulpkudjkr"))); + model = BinaryData.fromObject(model).toObject(BudgetFilterProperties.class); + Assertions.assertEquals("rjb", model.dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.dimensions().operator()); + Assertions.assertEquals("rcjxvsnbyxqabn", model.dimensions().values().get(0)); + Assertions.assertEquals("pbtoqcjmkl", model.tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.tags().operator()); + Assertions.assertEquals("bqidtqaj", model.tags().values().get(0)); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetFilterTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetFilterTests.java new file mode 100644 index 000000000000..fefed5a38c51 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetFilterTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BudgetFilterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetFilter model = BinaryData.fromString( + "{\"and\":[{\"dimensions\":{\"name\":\"lougpbkw\",\"operator\":\"In\",\"values\":[\"tduqktapspwgcuer\",\"umkdosvqwhbmd\",\"bbjfddgmbmbexp\",\"bhtqqrolfpfpsa\"]},\"tags\":{\"name\":\"bquxigjy\",\"operator\":\"In\",\"values\":[\"jaoyfhrtx\",\"lnerkujysvleju\",\"fqawrlyxw\"]}},{\"dimensions\":{\"name\":\"cpr\",\"operator\":\"In\",\"values\":[\"b\",\"gjvtbv\"]},\"tags\":{\"name\":\"sszdnru\",\"operator\":\"In\",\"values\":[\"uhmuouqfprwzwbn\",\"uitnwuiz\",\"a\"]}},{\"dimensions\":{\"name\":\"ufizuckyf\",\"operator\":\"In\",\"values\":[\"fidfvzw\",\"zuhtymwisdkfthwx\",\"nteiwaopv\"]},\"tags\":{\"name\":\"ijcmmx\",\"operator\":\"In\",\"values\":[\"fufsrpymzi\",\"nsez\"]}}],\"dimensions\":{\"name\":\"tbzsgfyccs\",\"operator\":\"In\",\"values\":[\"mdwzjeiachboo\",\"flnrosfqpteehzz\",\"ypyqrimzinp\",\"swjdkirso\"]},\"tags\":{\"name\":\"qxhcrmn\",\"operator\":\"In\",\"values\":[\"t\",\"kwh\",\"soifiyipjxsqw\"]}}") + .toObject(BudgetFilter.class); + Assertions.assertEquals("lougpbkw", model.and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.and().get(0).dimensions().operator()); + Assertions.assertEquals("tduqktapspwgcuer", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("bquxigjy", model.and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.and().get(0).tags().operator()); + Assertions.assertEquals("jaoyfhrtx", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("tbzsgfyccs", model.dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.dimensions().operator()); + Assertions.assertEquals("mdwzjeiachboo", model.dimensions().values().get(0)); + Assertions.assertEquals("qxhcrmn", model.tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.tags().operator()); + Assertions.assertEquals("t", model.tags().values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BudgetFilter model + = new BudgetFilter() + .withAnd( + Arrays.asList( + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("lougpbkw") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("tduqktapspwgcuer", "umkdosvqwhbmd", "bbjfddgmbmbexp", + "bhtqqrolfpfpsa"))) + .withTags(new BudgetComparisonExpression().withName("bquxigjy") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("jaoyfhrtx", "lnerkujysvleju", "fqawrlyxw"))), + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("cpr") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("b", "gjvtbv"))) + .withTags(new BudgetComparisonExpression().withName("sszdnru") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("uhmuouqfprwzwbn", "uitnwuiz", "a"))), + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("ufizuckyf") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("fidfvzw", "zuhtymwisdkfthwx", "nteiwaopv"))) + .withTags(new BudgetComparisonExpression().withName("ijcmmx") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("fufsrpymzi", "nsez"))))) + .withDimensions(new BudgetComparisonExpression().withName("tbzsgfyccs") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("mdwzjeiachboo", "flnrosfqpteehzz", "ypyqrimzinp", "swjdkirso"))) + .withTags(new BudgetComparisonExpression().withName("qxhcrmn") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("t", "kwh", "soifiyipjxsqw"))); + model = BinaryData.fromObject(model).toObject(BudgetFilter.class); + Assertions.assertEquals("lougpbkw", model.and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.and().get(0).dimensions().operator()); + Assertions.assertEquals("tduqktapspwgcuer", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("bquxigjy", model.and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.and().get(0).tags().operator()); + Assertions.assertEquals("jaoyfhrtx", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("tbzsgfyccs", model.dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.dimensions().operator()); + Assertions.assertEquals("mdwzjeiachboo", model.dimensions().values().get(0)); + Assertions.assertEquals("qxhcrmn", model.tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.tags().operator()); + Assertions.assertEquals("t", model.tags().values().get(0)); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetInnerTests.java new file mode 100644 index 000000000000..e70707c2ff3c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetInnerTests.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetInner; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class BudgetInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetInner model = BinaryData.fromString( + "{\"properties\":{\"category\":\"Cost\",\"amount\":23.09760612663575,\"timeGrain\":\"BillingMonth\",\"timePeriod\":{\"startDate\":\"2021-04-19T10:59:49Z\",\"endDate\":\"2021-05-26T11:31:55Z\"},\"filter\":{\"and\":[{\"dimensions\":{\"name\":\"grtfwvu\",\"operator\":\"In\",\"values\":[\"audccsnhs\",\"cnyejhkryhtnapcz\"]},\"tags\":{\"name\":\"okjye\",\"operator\":\"In\",\"values\":[\"vnipjox\",\"jnchgej\",\"podmailzydehojwy\"]}}],\"dimensions\":{\"name\":\"uxinpmqnjaq\",\"operator\":\"In\",\"values\":[\"jsprozvcpute\"]},\"tags\":{\"name\":\"vwmf\",\"operator\":\"In\",\"values\":[\"scmdvpjhulsuu\"]}},\"currentSpend\":{\"amount\":69.53250612295263,\"unit\":\"k\"},\"notifications\":{\"oxxjtfelluwf\":{\"enabled\":true,\"operator\":\"EqualTo\",\"threshold\":30.31799281681614,\"frequency\":\"Weekly\",\"contactEmails\":[\"slwejdpvw\",\"yoqpsoaccta\",\"akl\"],\"contactRoles\":[\"hbcryffdfdosyge\"],\"contactGroups\":[\"ojakhmsbzjhcrze\",\"dphlxaolt\",\"qtrgqjbpfzfsinzg\",\"f\"],\"thresholdType\":\"Forecasted\",\"locale\":\"de-de\"}},\"forecastSpend\":{\"amount\":89.04542637242062,\"unit\":\"eqfpj\"}},\"eTag\":\"lxofpdvhpfxxypin\",\"id\":\"mayhuybbkpodepoo\",\"name\":\"inuvamiheogn\",\"type\":\"rxzxtheo\"}") + .toObject(BudgetInner.class); + Assertions.assertEquals("lxofpdvhpfxxypin", model.eTag()); + Assertions.assertEquals(CategoryType.COST, model.category()); + Assertions.assertEquals(23.09760612663575D, model.amount()); + Assertions.assertEquals(TimeGrainType.BILLING_MONTH, model.timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T10:59:49Z"), model.timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T11:31:55Z"), model.timePeriod().endDate()); + Assertions.assertEquals("grtfwvu", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("audccsnhs", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("okjye", model.filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).tags().operator()); + Assertions.assertEquals("vnipjox", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("uxinpmqnjaq", model.filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().dimensions().operator()); + Assertions.assertEquals("jsprozvcpute", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("vwmf", model.filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().tags().operator()); + Assertions.assertEquals("scmdvpjhulsuu", model.filter().tags().values().get(0)); + Assertions.assertTrue(model.notifications().get("oxxjtfelluwf").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.EQUAL_TO, + model.notifications().get("oxxjtfelluwf").operator()); + Assertions.assertEquals(30.31799281681614, model.notifications().get("oxxjtfelluwf").threshold()); + Assertions.assertEquals(Frequency.WEEKLY, model.notifications().get("oxxjtfelluwf").frequency()); + Assertions.assertEquals("slwejdpvw", model.notifications().get("oxxjtfelluwf").contactEmails().get(0)); + Assertions.assertEquals("hbcryffdfdosyge", model.notifications().get("oxxjtfelluwf").contactRoles().get(0)); + Assertions.assertEquals("ojakhmsbzjhcrze", model.notifications().get("oxxjtfelluwf").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.FORECASTED, model.notifications().get("oxxjtfelluwf").thresholdType()); + Assertions.assertEquals(CultureCode.DE_DE, model.notifications().get("oxxjtfelluwf").locale()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BudgetInner model = new BudgetInner().withETag("lxofpdvhpfxxypin") + .withCategory(CategoryType.COST) + .withAmount(23.09760612663575D) + .withTimeGrain(TimeGrainType.BILLING_MONTH) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2021-04-19T10:59:49Z")) + .withEndDate(OffsetDateTime.parse("2021-05-26T11:31:55Z"))) + .withFilter(new BudgetFilter() + .withAnd(Arrays.asList(new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("grtfwvu") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("audccsnhs", "cnyejhkryhtnapcz"))) + .withTags(new BudgetComparisonExpression().withName("okjye") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("vnipjox", "jnchgej", "podmailzydehojwy"))))) + .withDimensions(new BudgetComparisonExpression().withName("uxinpmqnjaq") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("jsprozvcpute"))) + .withTags(new BudgetComparisonExpression().withName("vwmf") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("scmdvpjhulsuu")))) + .withNotifications(mapOf("oxxjtfelluwf", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.EQUAL_TO) + .withThreshold(30.31799281681614) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("slwejdpvw", "yoqpsoaccta", "akl")) + .withContactRoles(Arrays.asList("hbcryffdfdosyge")) + .withContactGroups(Arrays.asList("ojakhmsbzjhcrze", "dphlxaolt", "qtrgqjbpfzfsinzg", "f")) + .withThresholdType(ThresholdType.FORECASTED) + .withLocale(CultureCode.DE_DE))); + model = BinaryData.fromObject(model).toObject(BudgetInner.class); + Assertions.assertEquals("lxofpdvhpfxxypin", model.eTag()); + Assertions.assertEquals(CategoryType.COST, model.category()); + Assertions.assertEquals(23.09760612663575D, model.amount()); + Assertions.assertEquals(TimeGrainType.BILLING_MONTH, model.timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T10:59:49Z"), model.timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T11:31:55Z"), model.timePeriod().endDate()); + Assertions.assertEquals("grtfwvu", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("audccsnhs", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("okjye", model.filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).tags().operator()); + Assertions.assertEquals("vnipjox", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("uxinpmqnjaq", model.filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().dimensions().operator()); + Assertions.assertEquals("jsprozvcpute", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("vwmf", model.filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().tags().operator()); + Assertions.assertEquals("scmdvpjhulsuu", model.filter().tags().values().get(0)); + Assertions.assertTrue(model.notifications().get("oxxjtfelluwf").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.EQUAL_TO, + model.notifications().get("oxxjtfelluwf").operator()); + Assertions.assertEquals(30.31799281681614, model.notifications().get("oxxjtfelluwf").threshold()); + Assertions.assertEquals(Frequency.WEEKLY, model.notifications().get("oxxjtfelluwf").frequency()); + Assertions.assertEquals("slwejdpvw", model.notifications().get("oxxjtfelluwf").contactEmails().get(0)); + Assertions.assertEquals("hbcryffdfdosyge", model.notifications().get("oxxjtfelluwf").contactRoles().get(0)); + Assertions.assertEquals("ojakhmsbzjhcrze", model.notifications().get("oxxjtfelluwf").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.FORECASTED, model.notifications().get("oxxjtfelluwf").thresholdType()); + Assertions.assertEquals(CultureCode.DE_DE, model.notifications().get("oxxjtfelluwf").locale()); + } + + // 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; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetPropertiesTests.java new file mode 100644 index 000000000000..a31484578666 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetPropertiesTests.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.BudgetProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class BudgetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetProperties model = BinaryData.fromString( + "{\"category\":\"Cost\",\"amount\":93.13275743587602,\"timeGrain\":\"Quarterly\",\"timePeriod\":{\"startDate\":\"2021-11-04T11:49:42Z\",\"endDate\":\"2021-10-19T21:33:47Z\"},\"filter\":{\"and\":[{\"dimensions\":{\"name\":\"hn\",\"operator\":\"In\",\"values\":[\"gbwjzrnf\",\"gxg\"]},\"tags\":{\"name\":\"pemvtzfkufubljof\",\"operator\":\"In\",\"values\":[\"ofjaeqjhqjb\",\"s\",\"msmjqulngsntn\"]}}],\"dimensions\":{\"name\":\"bkzgcwrwclx\",\"operator\":\"In\",\"values\":[\"ljdousk\",\"qvkoc\",\"cjdkwtnhxbnjbi\"]},\"tags\":{\"name\":\"qrglssainqpjwn\",\"operator\":\"In\",\"values\":[\"jfm\",\"pee\"]}},\"currentSpend\":{\"amount\":47.19616106041333,\"unit\":\"abkyqduujitcjcz\"},\"notifications\":{\"lwckbasyypnddhs\":{\"enabled\":true,\"operator\":\"GreaterThan\",\"threshold\":90.92639559978281,\"frequency\":\"Daily\",\"contactEmails\":[\"pdappds\",\"dkvwrwjfe\",\"snhu\"],\"contactRoles\":[\"ltmrldh\",\"gjzzdatqxhocdg\",\"ablgphuticndvk\",\"ozwyiftyhxhuro\"],\"contactGroups\":[\"yxolniwp\",\"cukjf\",\"giawx\"],\"thresholdType\":\"Forecasted\",\"locale\":\"de-de\"},\"ytb\":{\"enabled\":true,\"operator\":\"GreaterThanOrEqualTo\",\"threshold\":62.380627059427496,\"frequency\":\"Daily\",\"contactEmails\":[\"jkot\"],\"contactRoles\":[\"gou\",\"zndlikwy\"],\"contactGroups\":[\"fgibmadgakeq\",\"rxybz\"],\"thresholdType\":\"Actual\",\"locale\":\"sv-se\"}},\"forecastSpend\":{\"amount\":80.0666334294689,\"unit\":\"flmmnk\"}}") + .toObject(BudgetProperties.class); + Assertions.assertEquals(CategoryType.COST, model.category()); + Assertions.assertEquals(93.13275743587602D, model.amount()); + Assertions.assertEquals(TimeGrainType.QUARTERLY, model.timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T11:49:42Z"), model.timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T21:33:47Z"), model.timePeriod().endDate()); + Assertions.assertEquals("hn", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("gbwjzrnf", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("pemvtzfkufubljof", model.filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).tags().operator()); + Assertions.assertEquals("ofjaeqjhqjb", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("bkzgcwrwclx", model.filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().dimensions().operator()); + Assertions.assertEquals("ljdousk", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("qrglssainqpjwn", model.filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().tags().operator()); + Assertions.assertEquals("jfm", model.filter().tags().values().get(0)); + Assertions.assertTrue(model.notifications().get("lwckbasyypnddhs").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.GREATER_THAN, + model.notifications().get("lwckbasyypnddhs").operator()); + Assertions.assertEquals(90.92639559978281, model.notifications().get("lwckbasyypnddhs").threshold()); + Assertions.assertEquals(Frequency.DAILY, model.notifications().get("lwckbasyypnddhs").frequency()); + Assertions.assertEquals("pdappds", model.notifications().get("lwckbasyypnddhs").contactEmails().get(0)); + Assertions.assertEquals("ltmrldh", model.notifications().get("lwckbasyypnddhs").contactRoles().get(0)); + Assertions.assertEquals("yxolniwp", model.notifications().get("lwckbasyypnddhs").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.FORECASTED, model.notifications().get("lwckbasyypnddhs").thresholdType()); + Assertions.assertEquals(CultureCode.DE_DE, model.notifications().get("lwckbasyypnddhs").locale()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BudgetProperties model = new BudgetProperties().withCategory(CategoryType.COST) + .withAmount(93.13275743587602D) + .withTimeGrain(TimeGrainType.QUARTERLY) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2021-11-04T11:49:42Z")) + .withEndDate(OffsetDateTime.parse("2021-10-19T21:33:47Z"))) + .withFilter(new BudgetFilter() + .withAnd(Arrays.asList(new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("hn") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("gbwjzrnf", "gxg"))) + .withTags(new BudgetComparisonExpression().withName("pemvtzfkufubljof") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("ofjaeqjhqjb", "s", "msmjqulngsntn"))))) + .withDimensions(new BudgetComparisonExpression().withName("bkzgcwrwclx") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("ljdousk", "qvkoc", "cjdkwtnhxbnjbi"))) + .withTags(new BudgetComparisonExpression().withName("qrglssainqpjwn") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("jfm", "pee")))) + .withNotifications(mapOf("lwckbasyypnddhs", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.GREATER_THAN) + .withThreshold(90.92639559978281) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("pdappds", "dkvwrwjfe", "snhu")) + .withContactRoles(Arrays.asList("ltmrldh", "gjzzdatqxhocdg", "ablgphuticndvk", "ozwyiftyhxhuro")) + .withContactGroups(Arrays.asList("yxolniwp", "cukjf", "giawx")) + .withThresholdType(ThresholdType.FORECASTED) + .withLocale(CultureCode.DE_DE), + "ytb", + new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.GREATER_THAN_OR_EQUAL_TO) + .withThreshold(62.380627059427496) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("jkot")) + .withContactRoles(Arrays.asList("gou", "zndlikwy")) + .withContactGroups(Arrays.asList("fgibmadgakeq", "rxybz")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.SV_SE))); + model = BinaryData.fromObject(model).toObject(BudgetProperties.class); + Assertions.assertEquals(CategoryType.COST, model.category()); + Assertions.assertEquals(93.13275743587602D, model.amount()); + Assertions.assertEquals(TimeGrainType.QUARTERLY, model.timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T11:49:42Z"), model.timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T21:33:47Z"), model.timePeriod().endDate()); + Assertions.assertEquals("hn", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("gbwjzrnf", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("pemvtzfkufubljof", model.filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().and().get(0).tags().operator()); + Assertions.assertEquals("ofjaeqjhqjb", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("bkzgcwrwclx", model.filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().dimensions().operator()); + Assertions.assertEquals("ljdousk", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("qrglssainqpjwn", model.filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, model.filter().tags().operator()); + Assertions.assertEquals("jfm", model.filter().tags().values().get(0)); + Assertions.assertTrue(model.notifications().get("lwckbasyypnddhs").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.GREATER_THAN, + model.notifications().get("lwckbasyypnddhs").operator()); + Assertions.assertEquals(90.92639559978281, model.notifications().get("lwckbasyypnddhs").threshold()); + Assertions.assertEquals(Frequency.DAILY, model.notifications().get("lwckbasyypnddhs").frequency()); + Assertions.assertEquals("pdappds", model.notifications().get("lwckbasyypnddhs").contactEmails().get(0)); + Assertions.assertEquals("ltmrldh", model.notifications().get("lwckbasyypnddhs").contactRoles().get(0)); + Assertions.assertEquals("yxolniwp", model.notifications().get("lwckbasyypnddhs").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.FORECASTED, model.notifications().get("lwckbasyypnddhs").thresholdType()); + Assertions.assertEquals(CultureCode.DE_DE, model.notifications().get("lwckbasyypnddhs").locale()); + } + + // 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; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetTimePeriodTests.java new file mode 100644 index 000000000000..fef0f9f2e0d1 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetTimePeriodTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BudgetTimePeriodTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetTimePeriod model + = BinaryData.fromString("{\"startDate\":\"2021-11-09T02:15:09Z\",\"endDate\":\"2021-10-01T10:06:40Z\"}") + .toObject(BudgetTimePeriod.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T02:15:09Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T10:06:40Z"), model.endDate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BudgetTimePeriod model = new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2021-11-09T02:15:09Z")) + .withEndDate(OffsetDateTime.parse("2021-10-01T10:06:40Z")); + model = BinaryData.fromObject(model).toObject(BudgetTimePeriod.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T02:15:09Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T10:06:40Z"), model.endDate()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsCreateOrUpdateWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..3105021d041c --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.Budget; +import com.azure.resourcemanager.costmanagement.models.BudgetComparisonExpression; +import com.azure.resourcemanager.costmanagement.models.BudgetFilter; +import com.azure.resourcemanager.costmanagement.models.BudgetFilterProperties; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetTimePeriod; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BudgetsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"category\":\"ReservationUtilization\",\"amount\":43.90513726690026,\"timeGrain\":\"BillingQuarter\",\"timePeriod\":{\"startDate\":\"2021-10-01T10:37:11Z\",\"endDate\":\"2021-06-06T02:37:24Z\"},\"filter\":{\"and\":[{\"dimensions\":{\"name\":\"msfe\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ihpq\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"grhrdic\",\"operator\":\"In\",\"values\":[\"y\",\"fowxwyovcxjsgbi\",\"cu\",\"dveksbuhoduch\"]},\"tags\":{\"name\":\"scrdp\",\"operator\":\"In\",\"values\":[\"dyjdussp\",\"szekbh\"]}},\"currentSpend\":{\"amount\":39.86546498364822,\"unit\":\"gkrehbf\"},\"notifications\":{\"rmmttjxop\":{\"enabled\":false,\"operator\":\"LessThan\",\"threshold\":9.53356906104592,\"frequency\":\"Weekly\",\"contactEmails\":[\"iimreoagsqta\",\"dusr\",\"xxfavsqwudohzilf\"],\"contactRoles\":[\"ikpsimsfeypof\"],\"contactGroups\":[\"bh\"],\"thresholdType\":\"Actual\",\"locale\":\"sv-se\"},\"hpclb\":{\"enabled\":false,\"operator\":\"GreaterThanOrEqualTo\",\"threshold\":94.96256200287651,\"frequency\":\"Monthly\",\"contactEmails\":[\"gohtwz\",\"qilrixysfn\"],\"contactRoles\":[\"qywwwmhk\",\"uwaedrympmlqoi\",\"hzdue\"],\"contactGroups\":[\"apfjiik\",\"jdiq\"],\"thresholdType\":\"Actual\",\"locale\":\"zh-tw\"},\"vqchoadhrs\":{\"enabled\":false,\"operator\":\"GreaterThanOrEqualTo\",\"threshold\":20.83248816151557,\"frequency\":\"Weekly\",\"contactEmails\":[\"eivbvz\"],\"contactRoles\":[\"wxgoooxzpra\",\"mskxknp\",\"gzigjsugswhgsaod\"],\"contactGroups\":[\"nbafoctohzhaquvw\",\"xbg\"],\"thresholdType\":\"Actual\",\"locale\":\"fr-fr\"}},\"forecastSpend\":{\"amount\":4.39463238238541,\"unit\":\"pabdsrg\"}},\"eTag\":\"jglzrsubklrxhjnl\",\"id\":\"etjdvqydieqqkwa\",\"name\":\"uwdxvqzxoebwgj\",\"type\":\"bibanbau\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Budget response = manager.budgets() + .define("tgxdncaqt") + .withExistingScope("zgczeu") + .withETag("lajmllp") + .withCategory(CategoryType.RESERVATION_UTILIZATION) + .withAmount(92.84868098604642D) + .withTimeGrain(TimeGrainType.LAST30DAYS) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2021-10-20T12:07:25Z")) + .withEndDate(OffsetDateTime.parse("2021-06-12T21:04:05Z"))) + .withFilter(new BudgetFilter() + .withAnd(Arrays.asList( + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("gix") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new BudgetComparisonExpression().withName("ihlgm") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())), + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("hlqtxnrflkn") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new BudgetComparisonExpression().withName("dpg") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())), + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("dhdaqotwfhipx") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new BudgetComparisonExpression().withName("abvcipowzaf") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())), + new BudgetFilterProperties() + .withDimensions(new BudgetComparisonExpression().withName("umljcirvpef") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new BudgetComparisonExpression().withName("veitit") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new BudgetComparisonExpression().withName("xzajlnsjhwjuyxxb") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("mvuaytuadxkxe"))) + .withTags(new BudgetComparisonExpression().withName("wp") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("h", "ksarcdrnxsluvl", "ladltxkpbqhvfd", "qjwkrhwz")))) + .withNotifications(mapOf("qetwpqrtvaozn", + new Notification().withEnabled(false) + .withOperator(BudgetNotificationOperatorType.GREATER_THAN) + .withThreshold(76.27317126911316) + .withFrequency(Frequency.WEEKLY) + .withContactEmails(Arrays.asList("ibpvbkaehxsmzyg", "fwakw")) + .withContactRoles(Arrays.asList("vmakxhysowljuxl", "bectvtfjmskdch")) + .withContactGroups(Arrays.asList("ubavlzwp", "gmfalkzazmgoked", "jqafkmkro")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.RU_RU), + "aesky", + new Notification().withEnabled(false) + .withOperator(BudgetNotificationOperatorType.GREATER_THAN) + .withThreshold(70.33071879590564) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("agmceituugedhfp", "stlzm", "lsyj")) + .withContactRoles(Arrays.asList("lctaeb", "syrled")) + .withContactGroups(Arrays.asList("stbvtqig", "xzvsgeafgf", "sehxlzsxezp")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.ZH_TW))) + .create(); + + Assertions.assertEquals("jglzrsubklrxhjnl", response.eTag()); + Assertions.assertEquals(CategoryType.RESERVATION_UTILIZATION, response.category()); + Assertions.assertEquals(43.90513726690026D, response.amount()); + Assertions.assertEquals(TimeGrainType.BILLING_QUARTER, response.timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T10:37:11Z"), response.timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-06T02:37:24Z"), response.timePeriod().endDate()); + Assertions.assertEquals("msfe", response.filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("ihpq", response.filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().and().get(0).tags().operator()); + Assertions.assertEquals("grhrdic", response.filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().dimensions().operator()); + Assertions.assertEquals("y", response.filter().dimensions().values().get(0)); + Assertions.assertEquals("scrdp", response.filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().tags().operator()); + Assertions.assertEquals("dyjdussp", response.filter().tags().values().get(0)); + Assertions.assertFalse(response.notifications().get("rmmttjxop").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.LESS_THAN, + response.notifications().get("rmmttjxop").operator()); + Assertions.assertEquals(9.53356906104592, response.notifications().get("rmmttjxop").threshold()); + Assertions.assertEquals(Frequency.WEEKLY, response.notifications().get("rmmttjxop").frequency()); + Assertions.assertEquals("iimreoagsqta", response.notifications().get("rmmttjxop").contactEmails().get(0)); + Assertions.assertEquals("ikpsimsfeypof", response.notifications().get("rmmttjxop").contactRoles().get(0)); + Assertions.assertEquals("bh", response.notifications().get("rmmttjxop").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.ACTUAL, response.notifications().get("rmmttjxop").thresholdType()); + Assertions.assertEquals(CultureCode.SV_SE, response.notifications().get("rmmttjxop").locale()); + } + + // 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; + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsDeleteByResourceGroupWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..aa09f9fd353d --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BudgetsDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.budgets().deleteByResourceGroupWithResponse("ywv", "xigvjrktpgaeuk", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsGetWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsGetWithResponseMockTests.java new file mode 100644 index 000000000000..31724b58e3b8 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsGetWithResponseMockTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.Budget; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BudgetsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"category\":\"Cost\",\"amount\":81.75259488096567,\"timeGrain\":\"BillingMonth\",\"timePeriod\":{\"startDate\":\"2021-01-11T02:12:01Z\",\"endDate\":\"2021-03-14T07:42:22Z\"},\"filter\":{\"and\":[{\"dimensions\":{\"name\":\"asaxxo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fkwiyjv\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"osrnawnvzmlnkoy\",\"operator\":\"In\",\"values\":[\"vjabjqqaxuyvym\",\"nudn\"]},\"tags\":{\"name\":\"abhjx\",\"operator\":\"In\",\"values\":[\"weuipmpvksmi\",\"nsqxtltc\"]}},\"currentSpend\":{\"amount\":57.23102168966058,\"unit\":\"gfhyrfra\"},\"notifications\":{\"hlutixmqrudjizc\":{\"enabled\":false,\"operator\":\"LessThan\",\"threshold\":82.95519355143381,\"frequency\":\"Monthly\",\"contactEmails\":[\"mfcnrjajqmatxj\",\"ielnz\",\"gxxgfb\"],\"contactRoles\":[\"lpqagyn\",\"iprnzcalincry\",\"xzxaqzibmqimiym\"],\"contactGroups\":[\"qguhfupetasvvo\",\"sbpkf\",\"anfkgxsyaowuzow\",\"uohdkcprgukxr\"],\"thresholdType\":\"Actual\",\"locale\":\"pt-br\"},\"mjswenawwamecle\":{\"enabled\":false,\"operator\":\"LessThan\",\"threshold\":64.93713767707764,\"frequency\":\"Daily\",\"contactEmails\":[\"fhi\",\"c\",\"mfbcpaqktkrum\"],\"contactRoles\":[\"dkyzbfvxov\"],\"contactGroups\":[\"iuxqggvqr\",\"hyhlwcjsqg\",\"jhffbxrqrkij\",\"euqlsdxeqztv\"],\"thresholdType\":\"Forecasted\",\"locale\":\"en-gb\"}},\"forecastSpend\":{\"amount\":56.6659766807774,\"unit\":\"dhzyoe\"}},\"eTag\":\"ht\",\"id\":\"lhsvidmytzlnglxp\",\"name\":\"ovyoanf\",\"type\":\"cswqa\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Budget response = manager.budgets() + .getWithResponse("bivqvogfuy", "wvbhlimbyq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ht", response.eTag()); + Assertions.assertEquals(CategoryType.COST, response.category()); + Assertions.assertEquals(81.75259488096567D, response.amount()); + Assertions.assertEquals(TimeGrainType.BILLING_MONTH, response.timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T02:12:01Z"), response.timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T07:42:22Z"), response.timePeriod().endDate()); + Assertions.assertEquals("asaxxo", response.filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("fkwiyjv", response.filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().and().get(0).tags().operator()); + Assertions.assertEquals("osrnawnvzmlnkoy", response.filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().dimensions().operator()); + Assertions.assertEquals("vjabjqqaxuyvym", response.filter().dimensions().values().get(0)); + Assertions.assertEquals("abhjx", response.filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.filter().tags().operator()); + Assertions.assertEquals("weuipmpvksmi", response.filter().tags().values().get(0)); + Assertions.assertFalse(response.notifications().get("hlutixmqrudjizc").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.LESS_THAN, + response.notifications().get("hlutixmqrudjizc").operator()); + Assertions.assertEquals(82.95519355143381, response.notifications().get("hlutixmqrudjizc").threshold()); + Assertions.assertEquals(Frequency.MONTHLY, response.notifications().get("hlutixmqrudjizc").frequency()); + Assertions.assertEquals("mfcnrjajqmatxj", + response.notifications().get("hlutixmqrudjizc").contactEmails().get(0)); + Assertions.assertEquals("lpqagyn", response.notifications().get("hlutixmqrudjizc").contactRoles().get(0)); + Assertions.assertEquals("qguhfupetasvvo", + response.notifications().get("hlutixmqrudjizc").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.ACTUAL, response.notifications().get("hlutixmqrudjizc").thresholdType()); + Assertions.assertEquals(CultureCode.PT_BR, response.notifications().get("hlutixmqrudjizc").locale()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListMockTests.java new file mode 100644 index 000000000000..298e7e501ea4 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListMockTests.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.Budget; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.BudgetOperatorType; +import com.azure.resourcemanager.costmanagement.models.CategoryType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import com.azure.resourcemanager.costmanagement.models.TimeGrainType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BudgetsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"category\":\"ReservationUtilization\",\"amount\":3.809008903236144,\"timeGrain\":\"Quarterly\",\"timePeriod\":{\"startDate\":\"2021-06-09T11:01:02Z\",\"endDate\":\"2021-06-12T09:14:47Z\"},\"filter\":{\"and\":[{\"dimensions\":{\"name\":\"injgazlsvbzfcpuo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wjcciklhsy\",\"operator\":\"In\",\"values\":[]}},{\"dimensions\":{\"name\":\"drenxol\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ehqbeivdlhydwbdb\",\"operator\":\"In\",\"values\":[]}},{\"dimensions\":{\"name\":\"lpu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"jlkesmmpath\",\"operator\":\"In\",\"values\":[]}},{\"dimensions\":{\"name\":\"ah\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"niiwllbvgwz\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"tedousnktjtgrava\",\"operator\":\"In\",\"values\":[\"fkbebauzl\",\"btxxwpfhnjzud\",\"tpzkgmeboywhcz\",\"qrhm\"]},\"tags\":{\"name\":\"qbedygisrzwn\",\"operator\":\"In\",\"values\":[\"id\"]}},\"currentSpend\":{\"amount\":76.57281548707645,\"unit\":\"pwctofl\"},\"notifications\":{\"ggvrbnyrukoilaci\":{\"enabled\":true,\"operator\":\"EqualTo\",\"threshold\":47.290187440990984,\"frequency\":\"Daily\",\"contactEmails\":[\"kbrfgdrwji\",\"ewhfjsrwqrxetf\"],\"contactRoles\":[\"vrrmdqntycn\",\"wthv\"],\"contactGroups\":[\"gnuyeamcmhu\",\"fjeceho\",\"wcpqtwl\"],\"thresholdType\":\"Forecasted\",\"locale\":\"fr-fr\"},\"ohoqkpjtnqjilayw\":{\"enabled\":false,\"operator\":\"GreaterThan\",\"threshold\":30.46783407284973,\"frequency\":\"Daily\",\"contactEmails\":[\"jlhwyxpzruzyt\"],\"contactRoles\":[\"kwhbgxve\",\"lvulnxdmnitmujdt\",\"mcl\",\"ymffhmjpddnyx\"],\"contactGroups\":[\"v\",\"zmzqmzjqrb\",\"pv\",\"mdyfoebojtj\"],\"thresholdType\":\"Actual\",\"locale\":\"ru-ru\"}},\"forecastSpend\":{\"amount\":7.344190854027321,\"unit\":\"syril\"}},\"eTag\":\"xdqaolfylnkkb\",\"id\":\"jvlywl\",\"name\":\"mfwo\",\"type\":\"bjwhlwyjfnqzocr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.budgets().list("awohpmw", "qnucs", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xdqaolfylnkkb", response.iterator().next().eTag()); + Assertions.assertEquals(CategoryType.RESERVATION_UTILIZATION, response.iterator().next().category()); + Assertions.assertEquals(3.809008903236144D, response.iterator().next().amount()); + Assertions.assertEquals(TimeGrainType.QUARTERLY, response.iterator().next().timeGrain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T11:01:02Z"), + response.iterator().next().timePeriod().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T09:14:47Z"), + response.iterator().next().timePeriod().endDate()); + Assertions.assertEquals("injgazlsvbzfcpuo", + response.iterator().next().filter().and().get(0).dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, + response.iterator().next().filter().and().get(0).dimensions().operator()); + Assertions.assertEquals("wjcciklhsy", response.iterator().next().filter().and().get(0).tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, + response.iterator().next().filter().and().get(0).tags().operator()); + Assertions.assertEquals("tedousnktjtgrava", response.iterator().next().filter().dimensions().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.iterator().next().filter().dimensions().operator()); + Assertions.assertEquals("fkbebauzl", response.iterator().next().filter().dimensions().values().get(0)); + Assertions.assertEquals("qbedygisrzwn", response.iterator().next().filter().tags().name()); + Assertions.assertEquals(BudgetOperatorType.IN, response.iterator().next().filter().tags().operator()); + Assertions.assertEquals("id", response.iterator().next().filter().tags().values().get(0)); + Assertions.assertTrue(response.iterator().next().notifications().get("ggvrbnyrukoilaci").enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.EQUAL_TO, + response.iterator().next().notifications().get("ggvrbnyrukoilaci").operator()); + Assertions.assertEquals(47.290187440990984, + response.iterator().next().notifications().get("ggvrbnyrukoilaci").threshold()); + Assertions.assertEquals(Frequency.DAILY, + response.iterator().next().notifications().get("ggvrbnyrukoilaci").frequency()); + Assertions.assertEquals("kbrfgdrwji", + response.iterator().next().notifications().get("ggvrbnyrukoilaci").contactEmails().get(0)); + Assertions.assertEquals("vrrmdqntycn", + response.iterator().next().notifications().get("ggvrbnyrukoilaci").contactRoles().get(0)); + Assertions.assertEquals("gnuyeamcmhu", + response.iterator().next().notifications().get("ggvrbnyrukoilaci").contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.FORECASTED, + response.iterator().next().notifications().get("ggvrbnyrukoilaci").thresholdType()); + Assertions.assertEquals(CultureCode.FR_FR, + response.iterator().next().notifications().get("ggvrbnyrukoilaci").locale()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListResultTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListResultTests.java new file mode 100644 index 000000000000..b5ead47a33b9 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/BudgetsListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.implementation.models.BudgetsListResult; +import org.junit.jupiter.api.Assertions; + +public final class BudgetsListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BudgetsListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"category\":\"ReservationUtilization\",\"amount\":54.51152923155526,\"timeGrain\":\"BillingMonth\",\"timePeriod\":{\"startDate\":\"2021-01-21T14:33:44Z\",\"endDate\":\"2021-09-12T01:29:13Z\"},\"filter\":{\"and\":[{},{},{}],\"dimensions\":{\"name\":\"bqe\",\"operator\":\"In\",\"values\":[\"xqbzvddntwnd\",\"icbtwnpzao\",\"vuhrhcffcyddgl\"]},\"tags\":{\"name\":\"t\",\"operator\":\"In\",\"values\":[\"kw\",\"yeicxmqciwqvhk\",\"ixuigdtopbobj\"]}},\"currentSpend\":{\"amount\":0.2398267434997159,\"unit\":\"u\"},\"notifications\":{\"yktz\":{\"enabled\":true,\"operator\":\"LessThan\",\"threshold\":31.15801521797653,\"frequency\":\"Daily\",\"contactEmails\":[\"vtpgvdfgiotkf\",\"utqxlngx\",\"efgugnxk\"],\"contactRoles\":[\"qmi\",\"tthzrvqd\"],\"contactGroups\":[\"hjybigehoqfbo\"],\"thresholdType\":\"Forecasted\",\"locale\":\"nl-nl\"}},\"forecastSpend\":{\"amount\":91.57710381294177,\"unit\":\"gqywgndrv\"}},\"eTag\":\"hzgpphrcgyncocpe\",\"id\":\"vmmcoofs\",\"name\":\"lzevgbmqjqab\",\"type\":\"y\"},{\"properties\":{\"category\":\"ReservationUtilization\",\"amount\":79.70230134472271,\"timeGrain\":\"Quarterly\",\"timePeriod\":{\"startDate\":\"2021-08-03T10:38:35Z\",\"endDate\":\"2021-03-08T19:23:26Z\"},\"filter\":{\"and\":[{},{}],\"dimensions\":{\"name\":\"nfnbacfionlebxe\",\"operator\":\"In\",\"values\":[\"tzxdpnqbqqwx\",\"jfeallnwsub\"]},\"tags\":{\"name\":\"njampm\",\"operator\":\"In\",\"values\":[\"zscxaqwo\",\"chcbonqvpkvlrxnj\"]}},\"currentSpend\":{\"amount\":80.0054787376229,\"unit\":\"heoflokeyyienjbd\"},\"notifications\":{\"pwlbjnpg\":{\"enabled\":true,\"operator\":\"GreaterThanOrEqualTo\",\"threshold\":70.62782921533196,\"frequency\":\"Weekly\",\"contactEmails\":[\"jumasx\"],\"contactRoles\":[\"pqyegualhbxxh\",\"jj\"],\"contactGroups\":[\"dudgwdslfhot\"],\"thresholdType\":\"Forecasted\",\"locale\":\"da-dk\"},\"dyggdtjixhbku\":{\"enabled\":false,\"operator\":\"LessThan\",\"threshold\":87.84718336741257,\"frequency\":\"Daily\",\"contactEmails\":[\"xnltyfsoppu\"],\"contactRoles\":[\"snzwd\",\"jbavorxzdm\"],\"contactGroups\":[\"tbqvudw\",\"dndnvow\",\"ujjugwdkcglh\"],\"thresholdType\":\"Actual\",\"locale\":\"ko-kr\"},\"qjpkcattpngjcrc\":{\"enabled\":true,\"operator\":\"GreaterThanOrEqualTo\",\"threshold\":15.419441528914513,\"frequency\":\"Weekly\",\"contactEmails\":[\"menevfyexfwh\",\"bcibvyvdcsitynn\",\"amdecte\",\"f\"],\"contactRoles\":[\"cj\",\"ypvhezrkg\"],\"contactGroups\":[\"jrefovgmkqsle\"],\"thresholdType\":\"Forecasted\",\"locale\":\"hu-hu\"},\"uiuaodsfcpkvxodp\":{\"enabled\":true,\"operator\":\"GreaterThanOrEqualTo\",\"threshold\":47.98949165876315,\"frequency\":\"Daily\",\"contactEmails\":[\"mdajv\",\"ysou\",\"q\"],\"contactRoles\":[\"noae\"],\"contactGroups\":[\"hy\",\"ltrpmopj\",\"cma\",\"u\"],\"thresholdType\":\"Forecasted\",\"locale\":\"pt-br\"}},\"forecastSpend\":{\"amount\":83.70553981890328,\"unit\":\"ydagfuaxbe\"}},\"eTag\":\"iu\",\"id\":\"ktwh\",\"name\":\"dxwzywqsmbsurexi\",\"type\":\"o\"}],\"nextLink\":\"ocfs\"}") + .toObject(BudgetsListResult.class); + Assertions.assertEquals("ocfs", model.nextLink()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityRequestTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityRequestTests.java index c71c136ab338..510ed97fa0d8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityRequestTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,18 +11,17 @@ public final class CheckNameAvailabilityRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"hcoeocnhzq\",\"type\":\"ttjzcfyjzpt\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("hcoeocnhzq", model.name()); - Assertions.assertEquals("ttjzcfyjzpt", model.type()); + CheckNameAvailabilityRequest model + = BinaryData.fromString("{\"name\":\"e\",\"type\":\"q\"}").toObject(CheckNameAvailabilityRequest.class); + Assertions.assertEquals("e", model.name()); + Assertions.assertEquals("q", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model - = new CheckNameAvailabilityRequest().withName("hcoeocnhzq").withType("ttjzcfyjzpt"); + CheckNameAvailabilityRequest model = new CheckNameAvailabilityRequest().withName("e").withType("q"); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("hcoeocnhzq", model.name()); - Assertions.assertEquals("ttjzcfyjzpt", model.type()); + Assertions.assertEquals("e", model.name()); + Assertions.assertEquals("q", model.type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityResponseInnerTests.java index 625b85a520d3..b78260a54243 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityResponseInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CheckNameAvailabilityResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,21 +13,10 @@ public final class CheckNameAvailabilityResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityResponseInner model - = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"pqinf\"}") + = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"fxapjwogqqnobpu\"}") .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(false, model.nameAvailable()); + Assertions.assertFalse(model.nameAvailable()); Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("pqinf", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(false) - .withReason(CheckNameAvailabilityReason.INVALID) - .withMessage("pqinf"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("pqinf", model.message()); + Assertions.assertEquals("fxapjwogqqnobpu", model.message()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationProportionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationProportionTests.java new file mode 100644 index 000000000000..086956e2ab6d --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationProportionTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationProportionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationProportion model + = BinaryData.fromString("{\"name\":\"viirhgfgrws\",\"percentage\":89.02822727819249}") + .toObject(CostAllocationProportion.class); + Assertions.assertEquals("viirhgfgrws", model.name()); + Assertions.assertEquals(89.02822727819249, model.percentage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CostAllocationProportion model + = new CostAllocationProportion().withName("viirhgfgrws").withPercentage(89.02822727819249); + model = BinaryData.fromObject(model).toObject(CostAllocationProportion.class); + Assertions.assertEquals("viirhgfgrws", model.name()); + Assertions.assertEquals(89.02822727819249, model.percentage()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationResourceTests.java new file mode 100644 index 000000000000..1eef585705ef --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationResourceTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationResource model = BinaryData.fromString("{\"resourceType\":\"Tag\",\"name\":\"hlisngw\"}") + .toObject(CostAllocationResource.class); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.resourceType()); + Assertions.assertEquals("hlisngw", model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CostAllocationResource model + = new CostAllocationResource().withResourceType(CostAllocationResourceType.TAG).withName("hlisngw"); + model = BinaryData.fromObject(model).toObject(CostAllocationResource.class); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.resourceType()); + Assertions.assertEquals("hlisngw", model.name()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleCheckNameAvailabilityRequestTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleCheckNameAvailabilityRequestTests.java new file mode 100644 index 000000000000..0032b6427ba8 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleCheckNameAvailabilityRequestTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationRuleCheckNameAvailabilityRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationRuleCheckNameAvailabilityRequest model + = BinaryData.fromString("{\"name\":\"rpddouifamo\",\"type\":\"z\"}") + .toObject(CostAllocationRuleCheckNameAvailabilityRequest.class); + Assertions.assertEquals("rpddouifamo", model.name()); + Assertions.assertEquals("z", model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CostAllocationRuleCheckNameAvailabilityRequest model + = new CostAllocationRuleCheckNameAvailabilityRequest().withName("rpddouifamo").withType("z"); + model = BinaryData.fromObject(model).toObject(CostAllocationRuleCheckNameAvailabilityRequest.class); + Assertions.assertEquals("rpddouifamo", model.name()); + Assertions.assertEquals("z", model.type()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleCheckNameAvailabilityResponseInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleCheckNameAvailabilityResponseInnerTests.java new file mode 100644 index 000000000000..7164b0b8092b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleCheckNameAvailabilityResponseInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleCheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.costmanagement.models.Reason; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationRuleCheckNameAvailabilityResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationRuleCheckNameAvailabilityResponseInner model + = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"qwzdvpiwhxq\"}") + .toObject(CostAllocationRuleCheckNameAvailabilityResponseInner.class); + Assertions.assertTrue(model.nameAvailable()); + Assertions.assertEquals(Reason.ALREADY_EXISTS, model.reason()); + Assertions.assertEquals("qwzdvpiwhxq", model.message()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleDefinitionInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleDefinitionInnerTests.java new file mode 100644 index 000000000000..396d960870c2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleDefinitionInnerTests.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationRuleDefinitionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationRuleDefinitionInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"qqwzt\",\"details\":{\"sourceResources\":[{\"values\":[\"kchcxwa\"],\"resourceType\":\"Dimension\",\"name\":\"ewzjkjexfd\"}],\"targetResources\":[{\"values\":[{\"name\":\"psylkkshkbffmbmx\",\"percentage\":69.7939833265792},{\"name\":\"gywwpgjxs\",\"percentage\":93.05453911127186},{\"name\":\"fujg\",\"percentage\":9.171463917640498}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"o\"},{\"values\":[{\"name\":\"ttaqutdew\",\"percentage\":67.6858251352624},{\"name\":\"swvr\",\"percentage\":53.2825247483097}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"jgehkf\"},{\"values\":[{\"name\":\"m\",\"percentage\":24.290489528608273}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"kffqyinljqepqwh\"},{\"values\":[{\"name\":\"monstshiyxgve\",\"percentage\":77.84885059067963},{\"name\":\"lduccbi\",\"percentage\":11.502263228736942},{\"name\":\"vuwcobiegstmnin\",\"percentage\":65.09561279427861}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"i\"}]},\"status\":\"NotActive\",\"createdDate\":\"2021-08-30T17:12:34Z\",\"updatedDate\":\"2021-05-08T09:43:36Z\"},\"id\":\"ejjtbxqmul\",\"name\":\"xlxqzvn\",\"type\":\"rsbycucrwn\"}") + .toObject(CostAllocationRuleDefinitionInner.class); + Assertions.assertEquals("qqwzt", model.properties().description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + model.properties().details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("ewzjkjexfd", model.properties().details().sourceResources().get(0).name()); + Assertions.assertEquals("kchcxwa", model.properties().details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, + model.properties().details().targetResources().get(0).resourceType()); + Assertions.assertEquals("o", model.properties().details().targetResources().get(0).name()); + Assertions.assertEquals("psylkkshkbffmbmx", + model.properties().details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(69.7939833265792, + model.properties().details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + model.properties().details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.NOT_ACTIVE, model.properties().status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CostAllocationRuleDefinitionInner model = new CostAllocationRuleDefinitionInner() + .withProperties(new CostAllocationRuleProperties().withDescription("qqwzt") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources(Arrays.asList( + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("ewzjkjexfd") + .withValues(Arrays.asList("kchcxwa")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("o") + .withValues(Arrays.asList(new CostAllocationProportion().withName("psylkkshkbffmbmx") + .withPercentage(69.7939833265792), + new CostAllocationProportion().withName("gywwpgjxs").withPercentage(93.05453911127186), + new CostAllocationProportion().withName("fujg").withPercentage(9.171463917640498))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION), + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("jgehkf") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("ttaqutdew").withPercentage(67.6858251352624), + new CostAllocationProportion().withName("swvr").withPercentage(53.2825247483097))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION), + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("kffqyinljqepqwh") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("m").withPercentage(24.290489528608273))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION), + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("i") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("monstshiyxgve") + .withPercentage(77.84885059067963), + new CostAllocationProportion().withName("lduccbi").withPercentage(11.502263228736942), + new CostAllocationProportion().withName("vuwcobiegstmnin") + .withPercentage(65.09561279427861))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.NOT_ACTIVE)); + model = BinaryData.fromObject(model).toObject(CostAllocationRuleDefinitionInner.class); + Assertions.assertEquals("qqwzt", model.properties().description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + model.properties().details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("ewzjkjexfd", model.properties().details().sourceResources().get(0).name()); + Assertions.assertEquals("kchcxwa", model.properties().details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, + model.properties().details().targetResources().get(0).resourceType()); + Assertions.assertEquals("o", model.properties().details().targetResources().get(0).name()); + Assertions.assertEquals("psylkkshkbffmbmx", + model.properties().details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(69.7939833265792, + model.properties().details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + model.properties().details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.NOT_ACTIVE, model.properties().status()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleDetailsTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleDetailsTests.java new file mode 100644 index 000000000000..e6d2a40cb8fc --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleDetailsTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationRuleDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationRuleDetails model = BinaryData.fromString( + "{\"sourceResources\":[{\"values\":[\"oamktcq\",\"os\",\"gbzahgxqdlyr\",\"ltlaprltzkatbhj\"],\"resourceType\":\"Tag\",\"name\":\"nnbsoqeqa\"},{\"values\":[\"rvlagunbtgfebwln\",\"mhyreeudz\",\"av\"],\"resourceType\":\"Tag\",\"name\":\"dqmjxly\"}],\"targetResources\":[{\"values\":[{\"name\":\"gouwtlmj\",\"percentage\":65.59043717507481},{\"name\":\"ojqtobaxk\",\"percentage\":24.97507584988814},{\"name\":\"tu\",\"percentage\":38.50871808835002}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"kwr\"},{\"values\":[{\"name\":\"nkqbhsyrq\",\"percentage\":53.86712600190917}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"denxau\"}]}") + .toObject(CostAllocationRuleDetails.class); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.sourceResources().get(0).resourceType()); + Assertions.assertEquals("nnbsoqeqa", model.sourceResources().get(0).name()); + Assertions.assertEquals("oamktcq", model.sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.targetResources().get(0).resourceType()); + Assertions.assertEquals("kwr", model.targetResources().get(0).name()); + Assertions.assertEquals("gouwtlmj", model.targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(65.59043717507481, model.targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, model.targetResources().get(0).policyType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CostAllocationRuleDetails model = new CostAllocationRuleDetails() + .withSourceResources(Arrays.asList( + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("nnbsoqeqa") + .withValues(Arrays.asList("oamktcq", "os", "gbzahgxqdlyr", "ltlaprltzkatbhj")), + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("dqmjxly") + .withValues(Arrays.asList("rvlagunbtgfebwln", "mhyreeudz", "av")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("kwr") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("gouwtlmj").withPercentage(65.59043717507481), + new CostAllocationProportion().withName("ojqtobaxk").withPercentage(24.97507584988814), + new CostAllocationProportion().withName("tu").withPercentage(38.50871808835002))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION), + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("denxau") + .withValues(Arrays + .asList(new CostAllocationProportion().withName("nkqbhsyrq").withPercentage(53.86712600190917))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION))); + model = BinaryData.fromObject(model).toObject(CostAllocationRuleDetails.class); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.sourceResources().get(0).resourceType()); + Assertions.assertEquals("nnbsoqeqa", model.sourceResources().get(0).name()); + Assertions.assertEquals("oamktcq", model.sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.targetResources().get(0).resourceType()); + Assertions.assertEquals("kwr", model.targetResources().get(0).name()); + Assertions.assertEquals("gouwtlmj", model.targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(65.59043717507481, model.targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, model.targetResources().get(0).policyType()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleListTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleListTests.java new file mode 100644 index 000000000000..b82d5f015581 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRuleListTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.implementation.models.CostAllocationRuleList; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationRuleListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationRuleList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"vzbglbyvi\",\"details\":{\"sourceResources\":[{\"values\":[],\"resourceType\":\"Dimension\",\"name\":\"brxkjzwr\"},{\"values\":[],\"resourceType\":\"Dimension\",\"name\":\"ffm\"},{\"values\":[],\"resourceType\":\"Tag\",\"name\":\"kwfbkgo\"},{\"values\":[],\"resourceType\":\"Tag\",\"name\":\"wopdbydpiz\"}],\"targetResources\":[{\"values\":[],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"apxbi\"},{\"values\":[],\"policyType\":\"FixedProportion\",\"resourceType\":\"Dimension\",\"name\":\"ugjknf\"},{\"values\":[],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"cttuxuu\"},{\"values\":[],\"policyType\":\"FixedProportion\",\"resourceType\":\"Dimension\",\"name\":\"flqo\"}]},\"status\":\"Processing\",\"createdDate\":\"2021-04-12T11:18Z\",\"updatedDate\":\"2021-01-22T06:05:29Z\"},\"id\":\"mrnjh\",\"name\":\"sujz\",\"type\":\"czytqjtwhauunfpr\"}],\"nextLink\":\"letlx\"}") + .toObject(CostAllocationRuleList.class); + Assertions.assertEquals("vzbglbyvi", model.value().get(0).properties().description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + model.value().get(0).properties().details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("brxkjzwr", + model.value().get(0).properties().details().sourceResources().get(0).name()); + Assertions.assertEquals(CostAllocationResourceType.TAG, + model.value().get(0).properties().details().targetResources().get(0).resourceType()); + Assertions.assertEquals("apxbi", model.value().get(0).properties().details().targetResources().get(0).name()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + model.value().get(0).properties().details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.PROCESSING, model.value().get(0).properties().status()); + Assertions.assertEquals("letlx", model.nextLink()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulePropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulePropertiesTests.java new file mode 100644 index 000000000000..2e7adee9e601 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulePropertiesTests.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CostAllocationRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostAllocationRuleProperties model = BinaryData.fromString( + "{\"description\":\"ikzebr\",\"details\":{\"sourceResources\":[{\"values\":[\"swziq\",\"fuhok\"],\"resourceType\":\"Dimension\",\"name\":\"uswhvhczznvfbycj\"},{\"values\":[\"jww\"],\"resourceType\":\"Dimension\",\"name\":\"z\"},{\"values\":[\"mwmxqhndvnoamld\",\"ehaohdjhh\",\"lzok\"],\"resourceType\":\"Tag\",\"name\":\"ox\"}],\"targetResources\":[{\"values\":[{\"name\":\"jetagltsxoatft\",\"percentage\":47.44257443494422}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"bs\"},{\"values\":[{\"name\":\"e\",\"percentage\":74.16314818019367},{\"name\":\"ccsrmozihmipgaw\",\"percentage\":54.34042226747206},{\"name\":\"pkyjcxcjxgrytfm\",\"percentage\":10.501728785325227},{\"name\":\"cil\",\"percentage\":25.763122247490998}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"kggnoxu\"},{\"values\":[{\"name\":\"rksxwpndfc\",\"percentage\":37.42458447196605}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"thjtwk\"}]},\"status\":\"Active\",\"createdDate\":\"2021-06-06T01:38:06Z\",\"updatedDate\":\"2021-07-22T12:28:11Z\"}") + .toObject(CostAllocationRuleProperties.class); + Assertions.assertEquals("ikzebr", model.description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + model.details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("uswhvhczznvfbycj", model.details().sourceResources().get(0).name()); + Assertions.assertEquals("swziq", model.details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, + model.details().targetResources().get(0).resourceType()); + Assertions.assertEquals("bs", model.details().targetResources().get(0).name()); + Assertions.assertEquals("jetagltsxoatft", model.details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(47.44257443494422, + model.details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + model.details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.ACTIVE, model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CostAllocationRuleProperties model = new CostAllocationRuleProperties().withDescription("ikzebr") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources(Arrays.asList( + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("uswhvhczznvfbycj") + .withValues(Arrays.asList("swziq", "fuhok")), + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("z") + .withValues(Arrays.asList("jww")), + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("ox") + .withValues(Arrays.asList("mwmxqhndvnoamld", "ehaohdjhh", "lzok")))) + .withTargetResources(Arrays.asList( + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("bs") + .withValues(Arrays.asList(new CostAllocationProportion().withName("jetagltsxoatft") + .withPercentage(47.44257443494422))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION), + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("kggnoxu") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("e").withPercentage(74.16314818019367), + new CostAllocationProportion().withName("ccsrmozihmipgaw") + .withPercentage(54.34042226747206), + new CostAllocationProportion().withName("pkyjcxcjxgrytfm") + .withPercentage(10.501728785325227), + new CostAllocationProportion().withName("cil").withPercentage(25.763122247490998))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION), + new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("thjtwk") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("rksxwpndfc").withPercentage(37.42458447196605))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.ACTIVE); + model = BinaryData.fromObject(model).toObject(CostAllocationRuleProperties.class); + Assertions.assertEquals("ikzebr", model.description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + model.details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("uswhvhczznvfbycj", model.details().sourceResources().get(0).name()); + Assertions.assertEquals("swziq", model.details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, + model.details().targetResources().get(0).resourceType()); + Assertions.assertEquals("bs", model.details().targetResources().get(0).name()); + Assertions.assertEquals("jetagltsxoatft", model.details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(47.44257443494422, + model.details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + model.details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.ACTIVE, model.status()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCheckNameAvailabilityWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCheckNameAvailabilityWithResponseMockTests.java new file mode 100644 index 000000000000..4bea0650edaf --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCheckNameAvailabilityWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityRequest; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleCheckNameAvailabilityResponse; +import com.azure.resourcemanager.costmanagement.models.Reason; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CostAllocationRulesCheckNameAvailabilityWithResponseMockTests { + @Test + public void testCheckNameAvailabilityWithResponse() throws Exception { + String responseStr = "{\"nameAvailable\":true,\"reason\":\"Valid\",\"message\":\"fdmxuqb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CostAllocationRuleCheckNameAvailabilityResponse response = manager.costAllocationRules() + .checkNameAvailabilityWithResponse("zdcqhyftcvb", + new CostAllocationRuleCheckNameAvailabilityRequest().withName("gwhgkgsoau").withType("rssat"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertTrue(response.nameAvailable()); + Assertions.assertEquals(Reason.VALID, response.reason()); + Assertions.assertEquals("fdmxuqb", response.message()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCreateOrUpdateWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..fc87191aa5c2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.fluent.models.CostAllocationRuleDefinitionInner; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDefinition; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDetails; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleProperties; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CostAllocationRulesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"nwplrr\",\"details\":{\"sourceResources\":[{\"values\":[\"tsbbibtic\",\"hqvumspbfs\"],\"resourceType\":\"Tag\",\"name\":\"qbbewfcuqfpyyxm\"},{\"values\":[\"mtmvwituwey\",\"jshcybwf\"],\"resourceType\":\"Tag\",\"name\":\"po\"},{\"values\":[\"rcmvouujx\",\"iikmoxrezsvavlrx\",\"kj\",\"oywlunpipcwyb\"],\"resourceType\":\"Dimension\",\"name\":\"fncn\"}],\"targetResources\":[{\"values\":[{\"name\":\"ftsaebwfwh\",\"percentage\":97.0400470366346},{\"name\":\"pwal\",\"percentage\":25.06662858794153},{\"name\":\"ugexojfccylht\",\"percentage\":62.62593338762574}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"azjpwexcdrzpro\"}]},\"status\":\"Processing\",\"createdDate\":\"2021-12-01T10:51:53Z\",\"updatedDate\":\"2021-09-08T23:35:04Z\"},\"id\":\"nrkjgpjeuxsph\",\"name\":\"okfpmijpdvz\",\"type\":\"fbhwbdqufvc\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CostAllocationRuleDefinition response = manager.costAllocationRules() + .createOrUpdateWithResponse("lwalhvu", "hg", + new CostAllocationRuleDefinitionInner().withProperties(new CostAllocationRuleProperties() + .withDescription("etxdqcmyctajqzj") + .withDetails(new CostAllocationRuleDetails() + .withSourceResources( + Arrays.asList( + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("ushlcxpblalh") + .withValues(Arrays.asList("cx", "ibiwksdegyxsb", "pzvoikv", "twczf")), + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("jq") + .withValues(Arrays.asList("zpfkis", "aidqzsaaoqdsgpto")), + new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("jzzca") + .withValues(Arrays.asList("afcnlrtb")))) + .withTargetResources(Arrays.asList(new TargetCostAllocationResource() + .withResourceType(CostAllocationResourceType.DIMENSION) + .withName("xre") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("lbuaukt").withPercentage(75.86690821784204), + new CostAllocationProportion().withName("opexelxqd").withPercentage(39.21040286096058), + new CostAllocationProportion().withName("wyil").withPercentage(72.65990018312758), + new CostAllocationProportion().withName("bkgx").withPercentage(41.324659153858))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION)))) + .withStatus(RuleStatus.PROCESSING)), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("nwplrr", response.properties().description()); + Assertions.assertEquals(CostAllocationResourceType.TAG, + response.properties().details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("qbbewfcuqfpyyxm", response.properties().details().sourceResources().get(0).name()); + Assertions.assertEquals("tsbbibtic", response.properties().details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, + response.properties().details().targetResources().get(0).resourceType()); + Assertions.assertEquals("azjpwexcdrzpro", response.properties().details().targetResources().get(0).name()); + Assertions.assertEquals("ftsaebwfwh", + response.properties().details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(97.0400470366346, + response.properties().details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + response.properties().details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.PROCESSING, response.properties().status()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesDeleteByResourceGroupWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..6006aff69895 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CostAllocationRulesDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.costAllocationRules() + .deleteByResourceGroupWithResponse("nrglaqrwyambhb", "febzxf", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesGetWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesGetWithResponseMockTests.java new file mode 100644 index 000000000000..68f231652b45 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesGetWithResponseMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDefinition; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CostAllocationRulesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"yc\",\"details\":{\"sourceResources\":[{\"values\":[\"seip\",\"quwzxhrptyodl\",\"kfktltdds\",\"bjop\"],\"resourceType\":\"Dimension\",\"name\":\"uhb\"},{\"values\":[\"zkqxsalu\",\"yigfcvcew\",\"wqhdgsjsa\"],\"resourceType\":\"Dimension\",\"name\":\"rncmazdfsqxh\"},{\"values\":[\"mrejparnpvgr\"],\"resourceType\":\"Tag\",\"name\":\"rbwtdrcwgzwl\"},{\"values\":[\"zlhhfix\"],\"resourceType\":\"Dimension\",\"name\":\"fculzjrmhpfyw\"}],\"targetResources\":[{\"values\":[{\"name\":\"qpzfzxsoxin\",\"percentage\":12.49321810016406}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"k\"},{\"values\":[{\"name\":\"ocqsxy\",\"percentage\":17.377094445158235},{\"name\":\"tcmiwd\",\"percentage\":9.952792373870645}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"mey\"}]},\"status\":\"Active\",\"createdDate\":\"2021-08-02T10:35:39Z\",\"updatedDate\":\"2021-03-22T22:28:08Z\"},\"id\":\"jyh\",\"name\":\"tpzcr\",\"type\":\"yklleynqanhkiggl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CostAllocationRuleDefinition response = manager.costAllocationRules() + .getWithResponse("i", "eslikyohzixyqhf", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("yc", response.properties().description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + response.properties().details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("uhb", response.properties().details().sourceResources().get(0).name()); + Assertions.assertEquals("seip", response.properties().details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.TAG, + response.properties().details().targetResources().get(0).resourceType()); + Assertions.assertEquals("k", response.properties().details().targetResources().get(0).name()); + Assertions.assertEquals("qpzfzxsoxin", + response.properties().details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(12.49321810016406, + response.properties().details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + response.properties().details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.ACTIVE, response.properties().status()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesListMockTests.java new file mode 100644 index 000000000000..ea98f0660271 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostAllocationRulesListMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationRuleDefinition; +import com.azure.resourcemanager.costmanagement.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CostAllocationRulesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"l\",\"details\":{\"sourceResources\":[{\"values\":[\"rvrk\",\"s\",\"bduxvzmlghnys\"],\"resourceType\":\"Dimension\",\"name\":\"pye\"},{\"values\":[\"kppdi\",\"qb\",\"lxvhhyqqegatxgrz\"],\"resourceType\":\"Dimension\",\"name\":\"gin\"},{\"values\":[\"sdixchwkibmg\",\"ymncjc\"],\"resourceType\":\"Dimension\",\"name\":\"airwcqzoofj\"}],\"targetResources\":[{\"values\":[{\"name\":\"vep\",\"percentage\":57.0686993152136},{\"name\":\"tlebe\",\"percentage\":16.276395056178806}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Dimension\",\"name\":\"eknfqnwjjqx\"},{\"values\":[{\"name\":\"kdnjrxgkrhwie\",\"percentage\":44.633031504752985},{\"name\":\"pnowawonoehrguql\",\"percentage\":38.66746642921716},{\"name\":\"afbjzmpy\",\"percentage\":92.45823106686063},{\"name\":\"yfazbkocb\",\"percentage\":78.23841492176197}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"rmxkbcjwwdxom\"},{\"values\":[{\"name\":\"wppk\",\"percentage\":84.61395675083942}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"fly\"},{\"values\":[{\"name\":\"agaedaoi\",\"percentage\":40.162162634433784},{\"name\":\"mgd\",\"percentage\":15.880504082941538},{\"name\":\"abdxfkuzb\",\"percentage\":62.26008941519914}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"oyvhtuqbpeln\"}]},\"status\":\"Processing\",\"createdDate\":\"2021-03-06T23:56:43Z\",\"updatedDate\":\"2021-12-09T02:53:26Z\"},\"id\":\"gdvcdqhftz\",\"name\":\"pyfaofdfp\",\"type\":\"tncwmhjobzrfpr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.costAllocationRules().list("jqut", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("l", response.iterator().next().properties().description()); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + response.iterator().next().properties().details().sourceResources().get(0).resourceType()); + Assertions.assertEquals("pye", + response.iterator().next().properties().details().sourceResources().get(0).name()); + Assertions.assertEquals("rvrk", + response.iterator().next().properties().details().sourceResources().get(0).values().get(0)); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, + response.iterator().next().properties().details().targetResources().get(0).resourceType()); + Assertions.assertEquals("eknfqnwjjqx", + response.iterator().next().properties().details().targetResources().get(0).name()); + Assertions.assertEquals("vep", + response.iterator().next().properties().details().targetResources().get(0).values().get(0).name()); + Assertions.assertEquals(57.0686993152136, + response.iterator().next().properties().details().targetResources().get(0).values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, + response.iterator().next().properties().details().targetResources().get(0).policyType()); + Assertions.assertEquals(RuleStatus.PROCESSING, response.iterator().next().properties().status()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostDetailsTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostDetailsTimePeriodTests.java index afee555e4001..3cd6bfbaecfe 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostDetailsTimePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostDetailsTimePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,17 +11,17 @@ public final class CostDetailsTimePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CostDetailsTimePeriod model = BinaryData.fromString("{\"start\":\"qqqagwwrxaomzi\",\"end\":\"glrrczez\"}") - .toObject(CostDetailsTimePeriod.class); - Assertions.assertEquals("qqqagwwrxaomzi", model.start()); - Assertions.assertEquals("glrrczez", model.end()); + CostDetailsTimePeriod model + = BinaryData.fromString("{\"start\":\"xjwet\",\"end\":\"psihcla\"}").toObject(CostDetailsTimePeriod.class); + Assertions.assertEquals("xjwet", model.start()); + Assertions.assertEquals("psihcla", model.end()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CostDetailsTimePeriod model = new CostDetailsTimePeriod().withStart("qqqagwwrxaomzi").withEnd("glrrczez"); + CostDetailsTimePeriod model = new CostDetailsTimePeriod().withStart("xjwet").withEnd("psihcla"); model = BinaryData.fromObject(model).toObject(CostDetailsTimePeriod.class); - Assertions.assertEquals("qqqagwwrxaomzi", model.start()); - Assertions.assertEquals("glrrczez", model.end()); + Assertions.assertEquals("xjwet", model.start()); + Assertions.assertEquals("psihcla", model.end()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementOperationInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementOperationInnerTests.java index 2226aa40b191..661acf78dde4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementOperationInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementOperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.CostManagementOperationInner; -import com.azure.resourcemanager.costmanagement.models.OperationDisplay; public final class CostManagementOperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CostManagementOperationInner model = BinaryData.fromString( - "{\"id\":\"fcqhsmyurkd\",\"name\":\"lx\",\"isDataAction\":true,\"display\":{\"provider\":\"sjtxukcdmp\",\"resource\":\"cryuan\",\"operation\":\"uxzdxtay\",\"description\":\"hmwhfpmrqo\"},\"origin\":\"system\",\"actionType\":\"Internal\"}") + "{\"id\":\"smy\",\"name\":\"kdtmlxhekuk\",\"isDataAction\":false,\"display\":{\"provider\":\"kc\",\"resource\":\"parcry\",\"operation\":\"nzwuxzd\",\"description\":\"a\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") .toObject(CostManagementOperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CostManagementOperationInner model = new CostManagementOperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(CostManagementOperationInner.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementProxyResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementProxyResourceTests.java index 544f526df0f9..bc75dfa36528 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementProxyResourceTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementProxyResourceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,16 +11,9 @@ public final class CostManagementProxyResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CostManagementProxyResource model = BinaryData.fromString( - "{\"eTag\":\"tdaaygdvwvg\",\"id\":\"iohgwxrtfud\",\"name\":\"epxgyqagvr\",\"type\":\"mnpkukghimdblxg\"}") + CostManagementProxyResource model = BinaryData + .fromString("{\"id\":\"tdbhrbnla\",\"name\":\"xmyskp\",\"type\":\"enbtkcxywny\",\"eTag\":\"rsyn\"}") .toObject(CostManagementProxyResource.class); - Assertions.assertEquals("tdaaygdvwvg", model.etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CostManagementProxyResource model = new CostManagementProxyResource().withEtag("tdaaygdvwvg"); - model = BinaryData.fromObject(model).toObject(CostManagementProxyResource.class); - Assertions.assertEquals("tdaaygdvwvg", model.etag()); + Assertions.assertEquals("rsyn", model.etag()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementResourceTests.java index 417d3554f242..5e9dda4512e2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementResourceTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CostManagementResourceTests.java @@ -1,43 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.models.CostManagementResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; public final class CostManagementResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CostManagementResource model = BinaryData.fromString( - "{\"sku\":\"hpfeoajvgcxtxjc\",\"eTag\":\"eafidltugsresm\",\"location\":\"ssjhoiftxfkf\",\"tags\":{\"biqtgdq\":\"prhptillu\"},\"id\":\"hm\",\"name\":\"wsldrizetpwbr\",\"type\":\"lllibph\"}") + "{\"id\":\"pkuwxeoioj\",\"name\":\"zfav\",\"type\":\"zwfbcyaykmmfzs\",\"location\":\"wxrzxmdewsrsxkrp\",\"sku\":\"jazejwwviyoyp\",\"eTag\":\"hbrnnhjx\",\"tags\":{\"yqiq\":\"jhqkbiwetpozy\"}}") .toObject(CostManagementResource.class); - Assertions.assertEquals("ssjhoiftxfkf", model.location()); - Assertions.assertEquals("prhptillu", model.tags().get("biqtgdq")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CostManagementResource model - = new CostManagementResource().withLocation("ssjhoiftxfkf").withTags(mapOf("biqtgdq", "prhptillu")); - model = BinaryData.fromObject(model).toObject(CostManagementResource.class); - Assertions.assertEquals("ssjhoiftxfkf", model.location()); - Assertions.assertEquals("prhptillu", model.tags().get("biqtgdq")); - } - - // 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; } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CurrentSpendTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CurrentSpendTests.java new file mode 100644 index 000000000000..f2664e15c5d9 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CurrentSpendTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CurrentSpend; + +public final class CurrentSpendTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CurrentSpend model + = BinaryData.fromString("{\"amount\":62.25381731358313,\"unit\":\"a\"}").toObject(CurrentSpend.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CustomerMetadataTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CustomerMetadataTests.java new file mode 100644 index 000000000000..d35c361f2e0a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/CustomerMetadataTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CustomerMetadata; +import org.junit.jupiter.api.Assertions; + +public final class CustomerMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomerMetadata model + = BinaryData.fromString("{\"billingAccountId\":\"hslhca\",\"billingProfileId\":\"jutifdwfmvigorqj\"}") + .toObject(CustomerMetadata.class); + Assertions.assertEquals("hslhca", model.billingAccountId()); + Assertions.assertEquals("jutifdwfmvigorqj", model.billingProfileId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomerMetadata model + = new CustomerMetadata().withBillingAccountId("hslhca").withBillingProfileId("jutifdwfmvigorqj"); + model = BinaryData.fromObject(model).toObject(CustomerMetadata.class); + Assertions.assertEquals("hslhca", model.billingAccountId()); + Assertions.assertEquals("jutifdwfmvigorqj", model.billingProfileId()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionInnerTests.java index e91eb8263597..b713b520fbfa 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionInnerTests.java @@ -1,47 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.DimensionInner; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class DimensionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DimensionInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"bb\",\"filterEnabled\":true,\"groupingEnabled\":true,\"data\":[\"chzyvlixqnrk\"],\"total\":2002873882,\"category\":\"ibn\",\"usageStart\":\"2021-01-19T00:22Z\",\"usageEnd\":\"2021-10-29T13:36:36Z\",\"nextLink\":\"swqrntvlwijp\"},\"sku\":\"texoqqpwc\",\"eTag\":\"ufmhrunc\",\"location\":\"wmqs\",\"tags\":{\"ctddun\":\"dqzh\",\"pchrqbn\":\"ndy\",\"gydcw\":\"jrcg\"},\"id\":\"oxjumvqqo\",\"name\":\"ihrraiouaub\",\"type\":\"jtlo\"}") + "{\"properties\":{\"description\":\"wtl\",\"filterEnabled\":true,\"groupingEnabled\":false,\"data\":[\"agk\"],\"total\":327208124,\"category\":\"rqtvbczsulmdgglm\",\"usageStart\":\"2021-11-03T05:48:09Z\",\"usageEnd\":\"2021-04-09T07:45:35Z\",\"nextLink\":\"eykgsangpszngaf\"},\"id\":\"ylkvecjuj\",\"name\":\"goadyedmzr\",\"type\":\"foknubnoitp\",\"location\":\"ztrgdgxvcoq\",\"sku\":\"sw\",\"eTag\":\"yxp\",\"tags\":{\"alwvskbu\":\"we\",\"caqt\":\"z\",\"jpds\":\"ltcoqc\",\"vbiztjofqcv\":\"zakuejk\"}}") .toObject(DimensionInner.class); - Assertions.assertEquals("wmqs", model.location()); - Assertions.assertEquals("dqzh", model.tags().get("ctddun")); - Assertions.assertEquals("chzyvlixqnrk", model.data().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DimensionInner model = new DimensionInner().withLocation("wmqs") - .withTags(mapOf("ctddun", "dqzh", "pchrqbn", "ndy", "gydcw", "jrcg")) - .withData(Arrays.asList("chzyvlixqnrk")); - model = BinaryData.fromObject(model).toObject(DimensionInner.class); - Assertions.assertEquals("wmqs", model.location()); - Assertions.assertEquals("dqzh", model.tags().get("ctddun")); - Assertions.assertEquals("chzyvlixqnrk", model.data().get(0)); - } - - // 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; + Assertions.assertEquals("agk", model.data().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionPropertiesTests.java index ff4a755e691a..bc03d3afc458 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionPropertiesTests.java @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.DimensionProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class DimensionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DimensionProperties model = BinaryData.fromString( - "{\"description\":\"fuojrngif\",\"filterEnabled\":false,\"groupingEnabled\":false,\"data\":[\"cb\",\"uimzdlyjd\",\"qwmkyoquf\",\"vruzslzojhpctfnm\"],\"total\":1889500647,\"category\":\"ngfdgugeyzihgrky\",\"usageStart\":\"2021-10-28T01:16:30Z\",\"usageEnd\":\"2021-02-21T09:37:08Z\",\"nextLink\":\"nmfpp\"}") + "{\"description\":\"juf\",\"filterEnabled\":false,\"groupingEnabled\":false,\"data\":[\"e\",\"yeji\"],\"total\":2023692780,\"category\":\"egthortudawl\",\"usageStart\":\"2020-12-31T10:27:05Z\",\"usageEnd\":\"2021-04-29T07:38:04Z\",\"nextLink\":\"erppt\"}") .toObject(DimensionProperties.class); - Assertions.assertEquals("cb", model.data().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DimensionProperties model - = new DimensionProperties().withData(Arrays.asList("cb", "uimzdlyjd", "qwmkyoquf", "vruzslzojhpctfnm")); - model = BinaryData.fromObject(model).toObject(DimensionProperties.class); - Assertions.assertEquals("cb", model.data().get(0)); + Assertions.assertEquals("e", model.data().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeMockTests.java index 7b5d399a7a4c..b5f7b8e83ed3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsByExternalCloudProviderTypeMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.Dimension; @@ -23,21 +23,19 @@ public final class DimensionsByExternalCloudProviderTypeMockTests { @Test public void testByExternalCloudProviderType() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"bqlotokhtvwtazn\",\"filterEnabled\":false,\"groupingEnabled\":true,\"data\":[\"jyofgwhnk\",\"tlwljssmcts\",\"ldkpwolgisu\",\"xbteogfgfiijryk\"],\"total\":348799566,\"category\":\"k\",\"usageStart\":\"2021-08-31T06:22:15Z\",\"usageEnd\":\"2021-06-16T14:15:44Z\",\"nextLink\":\"zfpxgnmqvzvluy\"},\"sku\":\"aiossscyvaifp\",\"eTag\":\"acvfyeowps\",\"location\":\"x\",\"tags\":{\"tehdpboujs\":\"hsoymhpvtyqf\",\"suenyg\":\"kfvvdshxcde\",\"nquktrfnslnlrxs\":\"xcgjtf\"},\"id\":\"ylt\",\"name\":\"wntfmtbgwjdxwna\",\"type\":\"kurrdreyzjwh\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"ijhggabqbg\",\"filterEnabled\":true,\"groupingEnabled\":false,\"data\":[\"rwdvffhsdpzou\"],\"total\":1339035720,\"category\":\"rxqwqnjxrd\",\"usageStart\":\"2021-03-13T12:01:45Z\",\"usageEnd\":\"2021-10-05T14:13:15Z\",\"nextLink\":\"lygtavczcxdfweap\"},\"id\":\"mlx\",\"name\":\"jphrasp\",\"type\":\"leimixlmdbgicehf\",\"location\":\"mdrjuqbpxt\",\"sku\":\"lj\",\"eTag\":\"znpaxwfqtyyqiprc\",\"tags\":{\"jck\":\"ngbso\",\"kuckgkdskswtiiq\":\"iigz\",\"lnssw\":\"cqikclsm\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.dimensions() - .byExternalCloudProviderType(ExternalCloudProviderType.EXTERNAL_SUBSCRIPTIONS, "tjlflecomi", "xojjl", - "xxdhilzzdzzqjm", "ezay", 954713869, com.azure.core.util.Context.NONE); + .byExternalCloudProviderType(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "mimrljdpoqfxyemh", "ftb", + "ewhtec", "oamfmxtllfltymqc", 2136490747, com.azure.core.util.Context.NONE); - Assertions.assertEquals("x", response.iterator().next().location()); - Assertions.assertEquals("hsoymhpvtyqf", response.iterator().next().tags().get("tehdpboujs")); - Assertions.assertEquals("jyofgwhnk", response.iterator().next().data().get(0)); + Assertions.assertEquals("rwdvffhsdpzou", response.iterator().next().data().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListMockTests.java index 5836c1bc8675..d59c20ceed0b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.Dimension; @@ -22,21 +22,18 @@ public final class DimensionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"vpaklozkxbz\",\"filterEnabled\":false,\"groupingEnabled\":true,\"data\":[\"s\",\"nbtttkgsuxu\",\"rswgkpjhboyikeb\",\"uhkslg\"],\"total\":949610294,\"category\":\"hueoijyzcqyp\",\"usageStart\":\"2021-11-16T09:04:28Z\",\"usageEnd\":\"2021-10-11T17:07:04Z\",\"nextLink\":\"s\"},\"sku\":\"ej\",\"eTag\":\"dwtfx\",\"location\":\"tpq\",\"tags\":{\"uullojkp\":\"mkncfgybmxsnxo\",\"j\":\"yhgww\"},\"id\":\"xdbdljzgdyrcvu\",\"name\":\"bsgzl\",\"type\":\"qhbjnqogdxwbsfpy\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"kderf\",\"filterEnabled\":true,\"groupingEnabled\":true,\"data\":[\"epwoggg\",\"cwn\"],\"total\":1181916258,\"category\":\"mcqbsudzpgchz\",\"usageStart\":\"2021-08-16T10:56:16Z\",\"usageEnd\":\"2021-09-22T20:30:36Z\",\"nextLink\":\"jdjxhzghgo\"},\"id\":\"ynrceqavfdbdf\",\"name\":\"xjdnajuo\",\"type\":\"y\",\"location\":\"mk\",\"sku\":\"hvcw\",\"eTag\":\"q\",\"tags\":{\"mtdtkwppthuzd\":\"kluxxrwzobuzmsxg\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.dimensions() - .list("hjnlt", "etjdvqydieqqkwa", "uwdxvqzxoebwgj", "bibanbau", 319172782, - com.azure.core.util.Context.NONE); + PagedIterable response + = manager.dimensions().list("okyfoz", "bn", "x", "ypfqpgaixw", 814660247, com.azure.core.util.Context.NONE); - Assertions.assertEquals("tpq", response.iterator().next().location()); - Assertions.assertEquals("mkncfgybmxsnxo", response.iterator().next().tags().get("uullojkp")); - Assertions.assertEquals("s", response.iterator().next().data().get(0)); + Assertions.assertEquals("epwoggg", response.iterator().next().data().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListResultTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListResultTests.java index 0006acbaef84..a7dedca52e19 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListResultTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DimensionsListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.costmanagement.models.DimensionsListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.DimensionsListResult; +import org.junit.jupiter.api.Assertions; public final class DimensionsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DimensionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"zakakankjpdn\",\"filterEnabled\":false,\"groupingEnabled\":false,\"data\":[\"lhjlmuoyxprimr\",\"opteecj\"],\"total\":1372597728,\"category\":\"ls\",\"usageStart\":\"2021-03-15T14:52:41Z\",\"usageEnd\":\"2021-10-17T18:13:46Z\",\"nextLink\":\"wxdzaumweoohgu\"},\"sku\":\"uzboyjathw\",\"eTag\":\"olbaemwmdx\",\"location\":\"ebwjscjpahlxvea\",\"tags\":{\"qcttadijaeukmrsi\":\"xnmwmqtibxyijddt\",\"eqw\":\"ekpndzaapmudq\"},\"id\":\"gp\",\"name\":\"bu\",\"type\":\"qwyxebeybpm\"},{\"properties\":{\"description\":\"rtffyaqitmh\",\"filterEnabled\":false,\"groupingEnabled\":true,\"data\":[\"hvseufuqyrx\",\"dlcgqlsismjqfr\",\"dgamquhiosrsj\"],\"total\":364566844,\"category\":\"cdisyir\",\"usageStart\":\"2021-04-23T01:56:39Z\",\"usageEnd\":\"2021-09-23T14:06:07Z\",\"nextLink\":\"exrxzbujrtrhq\"},\"sku\":\"revkhgnlnzo\",\"eTag\":\"lrpiqywnc\",\"location\":\"jtszcof\",\"tags\":{\"gbjkvreljeamur\":\"htd\"},\"id\":\"zmlovuanash\",\"name\":\"xlpm\",\"type\":\"erbdk\"},{\"properties\":{\"description\":\"idizozsdbccxjmo\",\"filterEnabled\":true,\"groupingEnabled\":true,\"data\":[\"cypuuwwlt\"],\"total\":740306752,\"category\":\"ctzenkeifzzhmkd\",\"usageStart\":\"2021-04-17T12:45:26Z\",\"usageEnd\":\"2021-07-18T07:20:07Z\",\"nextLink\":\"hbxcu\"},\"sku\":\"hxgsrboldfor\",\"eTag\":\"wjlvizbfhfov\",\"location\":\"acqpbtuodxesza\",\"tags\":{\"wumuaslzk\":\"l\",\"mdr\":\"rrwoycqucwyhahn\"},\"id\":\"ywuhpsvfuur\",\"name\":\"tlwexxwlalniexz\",\"type\":\"rzpgep\"}]}") + "{\"value\":[{\"properties\":{\"description\":\"noakiz\",\"filterEnabled\":false,\"groupingEnabled\":true,\"data\":[\"q\"],\"total\":427869575,\"category\":\"iguyxlykwphv\",\"usageStart\":\"2021-11-13T04:48:37Z\",\"usageEnd\":\"2021-06-18T05:52:26Z\",\"nextLink\":\"mpe\"},\"id\":\"lkexaonwivkcqh\",\"name\":\"hxknlccrmmkyupi\",\"type\":\"byqjfkakfqfrkem\",\"location\":\"ldudxjascowv\",\"sku\":\"jkpdxphlkksnm\",\"eTag\":\"vyfijdkzuqnw\",\"tags\":{\"ah\":\"huqol\",\"hyqezvqq\":\"uqwqulsutrjbhxyk\",\"rftb\":\"g\"}}],\"nextLink\":\"exreu\"}") .toObject(DimensionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DimensionsListResult model = new DimensionsListResult(); - model = BinaryData.fromObject(model).toObject(DimensionsListResult.class); + Assertions.assertEquals("exreu", model.nextLink()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DismissAlertPayloadTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DismissAlertPayloadTests.java index 9a70156ba66b..2ea994bd26f9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DismissAlertPayloadTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DismissAlertPayloadTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -15,6 +15,7 @@ import com.azure.resourcemanager.costmanagement.models.AlertTimeGrainType; import com.azure.resourcemanager.costmanagement.models.AlertType; import com.azure.resourcemanager.costmanagement.models.DismissAlertPayload; +import java.math.BigDecimal; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -22,95 +23,108 @@ public final class DismissAlertPayloadTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DismissAlertPayload model = BinaryData.fromString( - "{\"properties\":{\"definition\":{\"type\":\"Budget\",\"category\":\"Usage\",\"criteria\":\"ForecastUsageThresholdExceeded\"},\"description\":\"vdkfwynwcvtbvk\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"Quarterly\",\"periodStartDate\":\"yqiatkzwp\",\"triggeredBy\":\"p\",\"resourceGroupFilter\":[\"datajaesgvvsccya\",\"datag\",\"dataqfhwyg\"],\"resourceFilter\":[\"datadnkfx\",\"datasemdwzrmu\",\"dataapfcqdpsq\"],\"meterFilter\":[\"datapsvuoymgc\",\"dataelvezrypq\",\"datamfe\"],\"tagFilter\":\"dataerqwkyhkobopg\",\"operator\":\"EqualTo\",\"unit\":\"epbqpcrfkbw\",\"contactEmails\":[\"jvcdwxlpqekf\"],\"contactGroups\":[\"htjsying\"],\"contactRoles\":[\"atmtdhtmdvy\",\"gikdgsz\",\"w\"],\"overridingAlert\":\"irryuzhlh\",\"departmentName\":\"oqrvqqaatjin\",\"companyName\":\"goupmfiibfg\",\"enrollmentNumber\":\"ioolvrwxkvtkkgll\",\"enrollmentStartDate\":\"jygvjayvbl\",\"enrollmentEndDate\":\"vkzuhbxvvyhgso\"},\"costEntityId\":\"rqufegxuvwz\",\"status\":\"None\",\"creationTime\":\"lmctlpd\",\"closeTime\":\"itvgbmhrixkwm\",\"modificationTime\":\"jejveg\",\"statusModificationUserName\":\"bpnaixexccbdre\",\"statusModificationTime\":\"hcexdrrvqa\"}}") + "{\"properties\":{\"definition\":{\"type\":\"Quota\",\"category\":\"Cost\",\"criteria\":\"MultiCurrency\"},\"description\":\"glae\",\"source\":\"Preset\",\"details\":{\"timeGrainType\":\"BillingMonth\",\"periodStartDate\":\"okpvzm\",\"triggeredBy\":\"t\",\"resourceGroupFilter\":[\"\\\"datagxobfirclnp\\\"\",\"\\\"dataciayzriykhya\\\"\",\"\\\"datafvjlboxqvkjlmx\\\"\"],\"resourceFilter\":[\"\\\"datadynhdwdigum\\\"\"],\"meterFilter\":[\"\\\"dataaauzzptjazysd\\\"\",\"\\\"datahezwwvaiq\\\"\"],\"tagFilter\":\"\\\"datavv\\\"\",\"threshold\":2131613216637731959,\"operator\":\"EqualTo\",\"amount\":6342791013289994721,\"unit\":\"kvylauyavl\",\"currentSpend\":5660344912391881497,\"contactEmails\":[\"ttijfybvpoekrs\",\"sgbdhuz\",\"gnjdgkynscliqhz\"],\"contactGroups\":[\"nk\",\"mtk\",\"bo\"],\"contactRoles\":[\"nvdxzxhihfrbbc\",\"vqagtltdhlf\"],\"overridingAlert\":\"ojpykvgtrdc\",\"departmentName\":\"fmzzsdymbrny\",\"companyName\":\"xmprafwg\",\"enrollmentNumber\":\"hocxvdfffwafqrou\",\"enrollmentStartDate\":\"spave\",\"enrollmentEndDate\":\"r\",\"invoicingThreshold\":951472064558788618},\"costEntityId\":\"zoz\",\"status\":\"Active\",\"creationTime\":\"xg\",\"closeTime\":\"oyxcdyuib\",\"modificationTime\":\"fdn\",\"statusModificationUserName\":\"ydvfvfcjnae\",\"statusModificationTime\":\"srvhmgorffuki\"}}") .toObject(DismissAlertPayload.class); - Assertions.assertEquals(AlertType.BUDGET, model.definition().type()); - Assertions.assertEquals(AlertCategory.USAGE, model.definition().category()); - Assertions.assertEquals(AlertCriteria.FORECAST_USAGE_THRESHOLD_EXCEEDED, model.definition().criteria()); - Assertions.assertEquals("vdkfwynwcvtbvk", model.description()); + Assertions.assertEquals(AlertType.QUOTA, model.definition().type()); + Assertions.assertEquals(AlertCategory.COST, model.definition().category()); + Assertions.assertEquals(AlertCriteria.MULTI_CURRENCY, model.definition().criteria()); + Assertions.assertEquals("glae", model.description()); Assertions.assertEquals(AlertSource.PRESET, model.source()); - Assertions.assertEquals(AlertTimeGrainType.QUARTERLY, model.details().timeGrainType()); - Assertions.assertEquals("yqiatkzwp", model.details().periodStartDate()); - Assertions.assertEquals("p", model.details().triggeredBy()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_MONTH, model.details().timeGrainType()); + Assertions.assertEquals("okpvzm", model.details().periodStartDate()); + Assertions.assertEquals("t", model.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("2131613216637731959"), model.details().threshold()); Assertions.assertEquals(AlertOperator.EQUAL_TO, model.details().operator()); - Assertions.assertEquals("epbqpcrfkbw", model.details().unit()); - Assertions.assertEquals("jvcdwxlpqekf", model.details().contactEmails().get(0)); - Assertions.assertEquals("htjsying", model.details().contactGroups().get(0)); - Assertions.assertEquals("atmtdhtmdvy", model.details().contactRoles().get(0)); - Assertions.assertEquals("irryuzhlh", model.details().overridingAlert()); - Assertions.assertEquals("oqrvqqaatjin", model.details().departmentName()); - Assertions.assertEquals("goupmfiibfg", model.details().companyName()); - Assertions.assertEquals("ioolvrwxkvtkkgll", model.details().enrollmentNumber()); - Assertions.assertEquals("jygvjayvbl", model.details().enrollmentStartDate()); - Assertions.assertEquals("vkzuhbxvvyhgso", model.details().enrollmentEndDate()); - Assertions.assertEquals("rqufegxuvwz", model.costEntityId()); - Assertions.assertEquals(AlertStatus.NONE, model.status()); - Assertions.assertEquals("lmctlpd", model.creationTime()); - Assertions.assertEquals("itvgbmhrixkwm", model.closeTime()); - Assertions.assertEquals("jejveg", model.modificationTime()); - Assertions.assertEquals("bpnaixexccbdre", model.statusModificationUsername()); - Assertions.assertEquals("hcexdrrvqa", model.statusModificationTime()); + Assertions.assertEquals(new BigDecimal("6342791013289994721"), model.details().amount()); + Assertions.assertEquals("kvylauyavl", model.details().unit()); + Assertions.assertEquals(new BigDecimal("5660344912391881497"), model.details().currentSpend()); + Assertions.assertEquals("ttijfybvpoekrs", model.details().contactEmails().get(0)); + Assertions.assertEquals("nk", model.details().contactGroups().get(0)); + Assertions.assertEquals("nvdxzxhihfrbbc", model.details().contactRoles().get(0)); + Assertions.assertEquals("ojpykvgtrdc", model.details().overridingAlert()); + Assertions.assertEquals("fmzzsdymbrny", model.details().departmentName()); + Assertions.assertEquals("xmprafwg", model.details().companyName()); + Assertions.assertEquals("hocxvdfffwafqrou", model.details().enrollmentNumber()); + Assertions.assertEquals("spave", model.details().enrollmentStartDate()); + Assertions.assertEquals("r", model.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("951472064558788618"), model.details().invoicingThreshold()); + Assertions.assertEquals("zoz", model.costEntityId()); + Assertions.assertEquals(AlertStatus.ACTIVE, model.status()); + Assertions.assertEquals("xg", model.creationTime()); + Assertions.assertEquals("oyxcdyuib", model.closeTime()); + Assertions.assertEquals("fdn", model.modificationTime()); + Assertions.assertEquals("ydvfvfcjnae", model.statusModificationUsername()); + Assertions.assertEquals("srvhmgorffuki", model.statusModificationTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DismissAlertPayload model = new DismissAlertPayload() - .withDefinition(new AlertPropertiesDefinition().withType(AlertType.BUDGET) - .withCategory(AlertCategory.USAGE) - .withCriteria(AlertCriteria.FORECAST_USAGE_THRESHOLD_EXCEEDED)) - .withDescription("vdkfwynwcvtbvk") + .withDefinition(new AlertPropertiesDefinition().withType(AlertType.QUOTA) + .withCategory(AlertCategory.COST) + .withCriteria(AlertCriteria.MULTI_CURRENCY)) + .withDescription("glae") .withSource(AlertSource.PRESET) - .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.QUARTERLY) - .withPeriodStartDate("yqiatkzwp") - .withTriggeredBy("p") - .withResourceGroupFilter(Arrays.asList("datajaesgvvsccya", "datag", "dataqfhwyg")) - .withResourceFilter(Arrays.asList("datadnkfx", "datasemdwzrmu", "dataapfcqdpsq")) - .withMeterFilter(Arrays.asList("datapsvuoymgc", "dataelvezrypq", "datamfe")) - .withTagFilter("dataerqwkyhkobopg") + .withDetails(new AlertPropertiesDetails().withTimeGrainType(AlertTimeGrainType.BILLING_MONTH) + .withPeriodStartDate("okpvzm") + .withTriggeredBy("t") + .withResourceGroupFilter( + Arrays.asList("\"datagxobfirclnp\"", "\"dataciayzriykhya\"", "\"datafvjlboxqvkjlmx\"")) + .withResourceFilter(Arrays.asList("\"datadynhdwdigum\"")) + .withMeterFilter(Arrays.asList("\"dataaauzzptjazysd\"", "\"datahezwwvaiq\"")) + .withTagFilter("\"datavv\"") + .withThreshold(new BigDecimal("2131613216637731959")) .withOperator(AlertOperator.EQUAL_TO) - .withUnit("epbqpcrfkbw") - .withContactEmails(Arrays.asList("jvcdwxlpqekf")) - .withContactGroups(Arrays.asList("htjsying")) - .withContactRoles(Arrays.asList("atmtdhtmdvy", "gikdgsz", "w")) - .withOverridingAlert("irryuzhlh") - .withDepartmentName("oqrvqqaatjin") - .withCompanyName("goupmfiibfg") - .withEnrollmentNumber("ioolvrwxkvtkkgll") - .withEnrollmentStartDate("jygvjayvbl") - .withEnrollmentEndDate("vkzuhbxvvyhgso")) - .withCostEntityId("rqufegxuvwz") - .withStatus(AlertStatus.NONE) - .withCreationTime("lmctlpd") - .withCloseTime("itvgbmhrixkwm") - .withModificationTime("jejveg") - .withStatusModificationUsername("bpnaixexccbdre") - .withStatusModificationTime("hcexdrrvqa"); + .withAmount(new BigDecimal("6342791013289994721")) + .withUnit("kvylauyavl") + .withCurrentSpend(new BigDecimal("5660344912391881497")) + .withContactEmails(Arrays.asList("ttijfybvpoekrs", "sgbdhuz", "gnjdgkynscliqhz")) + .withContactGroups(Arrays.asList("nk", "mtk", "bo")) + .withContactRoles(Arrays.asList("nvdxzxhihfrbbc", "vqagtltdhlf")) + .withOverridingAlert("ojpykvgtrdc") + .withDepartmentName("fmzzsdymbrny") + .withCompanyName("xmprafwg") + .withEnrollmentNumber("hocxvdfffwafqrou") + .withEnrollmentStartDate("spave") + .withEnrollmentEndDate("r") + .withInvoicingThreshold(new BigDecimal("951472064558788618"))) + .withCostEntityId("zoz") + .withStatus(AlertStatus.ACTIVE) + .withCreationTime("xg") + .withCloseTime("oyxcdyuib") + .withModificationTime("fdn") + .withStatusModificationUsername("ydvfvfcjnae") + .withStatusModificationTime("srvhmgorffuki"); model = BinaryData.fromObject(model).toObject(DismissAlertPayload.class); - Assertions.assertEquals(AlertType.BUDGET, model.definition().type()); - Assertions.assertEquals(AlertCategory.USAGE, model.definition().category()); - Assertions.assertEquals(AlertCriteria.FORECAST_USAGE_THRESHOLD_EXCEEDED, model.definition().criteria()); - Assertions.assertEquals("vdkfwynwcvtbvk", model.description()); + Assertions.assertEquals(AlertType.QUOTA, model.definition().type()); + Assertions.assertEquals(AlertCategory.COST, model.definition().category()); + Assertions.assertEquals(AlertCriteria.MULTI_CURRENCY, model.definition().criteria()); + Assertions.assertEquals("glae", model.description()); Assertions.assertEquals(AlertSource.PRESET, model.source()); - Assertions.assertEquals(AlertTimeGrainType.QUARTERLY, model.details().timeGrainType()); - Assertions.assertEquals("yqiatkzwp", model.details().periodStartDate()); - Assertions.assertEquals("p", model.details().triggeredBy()); + Assertions.assertEquals(AlertTimeGrainType.BILLING_MONTH, model.details().timeGrainType()); + Assertions.assertEquals("okpvzm", model.details().periodStartDate()); + Assertions.assertEquals("t", model.details().triggeredBy()); + Assertions.assertEquals(new BigDecimal("2131613216637731959"), model.details().threshold()); Assertions.assertEquals(AlertOperator.EQUAL_TO, model.details().operator()); - Assertions.assertEquals("epbqpcrfkbw", model.details().unit()); - Assertions.assertEquals("jvcdwxlpqekf", model.details().contactEmails().get(0)); - Assertions.assertEquals("htjsying", model.details().contactGroups().get(0)); - Assertions.assertEquals("atmtdhtmdvy", model.details().contactRoles().get(0)); - Assertions.assertEquals("irryuzhlh", model.details().overridingAlert()); - Assertions.assertEquals("oqrvqqaatjin", model.details().departmentName()); - Assertions.assertEquals("goupmfiibfg", model.details().companyName()); - Assertions.assertEquals("ioolvrwxkvtkkgll", model.details().enrollmentNumber()); - Assertions.assertEquals("jygvjayvbl", model.details().enrollmentStartDate()); - Assertions.assertEquals("vkzuhbxvvyhgso", model.details().enrollmentEndDate()); - Assertions.assertEquals("rqufegxuvwz", model.costEntityId()); - Assertions.assertEquals(AlertStatus.NONE, model.status()); - Assertions.assertEquals("lmctlpd", model.creationTime()); - Assertions.assertEquals("itvgbmhrixkwm", model.closeTime()); - Assertions.assertEquals("jejveg", model.modificationTime()); - Assertions.assertEquals("bpnaixexccbdre", model.statusModificationUsername()); - Assertions.assertEquals("hcexdrrvqa", model.statusModificationTime()); + Assertions.assertEquals(new BigDecimal("6342791013289994721"), model.details().amount()); + Assertions.assertEquals("kvylauyavl", model.details().unit()); + Assertions.assertEquals(new BigDecimal("5660344912391881497"), model.details().currentSpend()); + Assertions.assertEquals("ttijfybvpoekrs", model.details().contactEmails().get(0)); + Assertions.assertEquals("nk", model.details().contactGroups().get(0)); + Assertions.assertEquals("nvdxzxhihfrbbc", model.details().contactRoles().get(0)); + Assertions.assertEquals("ojpykvgtrdc", model.details().overridingAlert()); + Assertions.assertEquals("fmzzsdymbrny", model.details().departmentName()); + Assertions.assertEquals("xmprafwg", model.details().companyName()); + Assertions.assertEquals("hocxvdfffwafqrou", model.details().enrollmentNumber()); + Assertions.assertEquals("spave", model.details().enrollmentStartDate()); + Assertions.assertEquals("r", model.details().enrollmentEndDate()); + Assertions.assertEquals(new BigDecimal("951472064558788618"), model.details().invoicingThreshold()); + Assertions.assertEquals("zoz", model.costEntityId()); + Assertions.assertEquals(AlertStatus.ACTIVE, model.status()); + Assertions.assertEquals("xg", model.creationTime()); + Assertions.assertEquals("oyxcdyuib", model.closeTime()); + Assertions.assertEquals("fdn", model.modificationTime()); + Assertions.assertEquals("ydvfvfcjnae", model.statusModificationUsername()); + Assertions.assertEquals("srvhmgorffuki", model.statusModificationTime()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DownloadUrlInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DownloadUrlInnerTests.java index 0ab9cd43e34d..544640982198 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DownloadUrlInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/DownloadUrlInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,18 +13,9 @@ public final class DownloadUrlInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DownloadUrlInner model = BinaryData.fromString( - "{\"expiryTime\":\"2021-06-06T13:44:54Z\",\"validTill\":\"2021-08-03T20:23:39Z\",\"downloadUrl\":\"vfkoxml\"}") + "{\"expiryTime\":\"2021-01-14T01:11:27Z\",\"validTill\":\"2021-03-02T03:48:42Z\",\"downloadUrl\":\"p\"}") .toObject(DownloadUrlInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-03T20:23:39Z"), model.validTill()); - Assertions.assertEquals("vfkoxml", model.downloadUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DownloadUrlInner model = new DownloadUrlInner().withValidTill(OffsetDateTime.parse("2021-08-03T20:23:39Z")) - .withDownloadUrl("vfkoxml"); - model = BinaryData.fromObject(model).toObject(DownloadUrlInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-03T20:23:39Z"), model.validTill()); - Assertions.assertEquals("vfkoxml", model.downloadUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T03:48:42Z"), model.validTill()); + Assertions.assertEquals("p", model.downloadUrl()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetConfigurationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetConfigurationTests.java index f3454a948334..4fa715aea1f3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetConfigurationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetConfigurationTests.java @@ -1,28 +1,42 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.models.ExportDatasetConfiguration; +import com.azure.resourcemanager.costmanagement.models.FilterItemNames; +import com.azure.resourcemanager.costmanagement.models.FilterItems; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ExportDatasetConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExportDatasetConfiguration model - = BinaryData.fromString("{\"columns\":[\"xhnpo\",\"yqwcabvnuil\",\"ey\",\"swlpaugmrmfj\"]}") - .toObject(ExportDatasetConfiguration.class); - Assertions.assertEquals("xhnpo", model.columns().get(0)); + ExportDatasetConfiguration model = BinaryData.fromString( + "{\"columns\":[\"vwhheunmmqhgyx\",\"konocu\",\"oklyaxuconuq\"],\"dataVersion\":\"fkbey\",\"filters\":[{\"name\":\"LookBackPeriod\",\"value\":\"mwvvjektcxsenhw\"},{\"name\":\"ResourceType\",\"value\":\"frzpwvlqdqgb\"},{\"name\":\"LookBackPeriod\",\"value\":\"ihkaetcktvfc\"},{\"name\":\"ResourceType\",\"value\":\"nkymuctqhjfbebrj\"}]}") + .toObject(ExportDatasetConfiguration.class); + Assertions.assertEquals("vwhheunmmqhgyx", model.columns().get(0)); + Assertions.assertEquals("fkbey", model.dataVersion()); + Assertions.assertEquals(FilterItemNames.LOOK_BACK_PERIOD, model.filters().get(0).name()); + Assertions.assertEquals("mwvvjektcxsenhw", model.filters().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExportDatasetConfiguration model - = new ExportDatasetConfiguration().withColumns(Arrays.asList("xhnpo", "yqwcabvnuil", "ey", "swlpaugmrmfj")); + = new ExportDatasetConfiguration().withColumns(Arrays.asList("vwhheunmmqhgyx", "konocu", "oklyaxuconuq")) + .withDataVersion("fkbey") + .withFilters(Arrays.asList( + new FilterItems().withName(FilterItemNames.LOOK_BACK_PERIOD).withValue("mwvvjektcxsenhw"), + new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("frzpwvlqdqgb"), + new FilterItems().withName(FilterItemNames.LOOK_BACK_PERIOD).withValue("ihkaetcktvfc"), + new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("nkymuctqhjfbebrj"))); model = BinaryData.fromObject(model).toObject(ExportDatasetConfiguration.class); - Assertions.assertEquals("xhnpo", model.columns().get(0)); + Assertions.assertEquals("vwhheunmmqhgyx", model.columns().get(0)); + Assertions.assertEquals("fkbey", model.dataVersion()); + Assertions.assertEquals(FilterItemNames.LOOK_BACK_PERIOD, model.filters().get(0).name()); + Assertions.assertEquals("mwvvjektcxsenhw", model.filters().get(0).value()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetTests.java index ad6ce92e1c00..24d381a7b561 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDatasetTests.java @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.models.ExportDataset; import com.azure.resourcemanager.costmanagement.models.ExportDatasetConfiguration; +import com.azure.resourcemanager.costmanagement.models.FilterItemNames; +import com.azure.resourcemanager.costmanagement.models.FilterItems; import com.azure.resourcemanager.costmanagement.models.GranularityType; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -14,19 +16,30 @@ public final class ExportDatasetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExportDataset model = BinaryData - .fromString("{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"mjpb\",\"ephmgtvljvrcmyfq\"]}}") + ExportDataset model = BinaryData.fromString( + "{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"wgipwhono\"],\"dataVersion\":\"gshwankixz\",\"filters\":[{\"name\":\"ReservationScope\",\"value\":\"uttmrywnuzoqft\"},{\"name\":\"ResourceType\",\"value\":\"rnkcqvyxlw\"},{\"name\":\"ReservationScope\",\"value\":\"icohoqqnwvl\"}]}}") .toObject(ExportDataset.class); - Assertions.assertEquals(GranularityType.DAILY, model.granularity()); - Assertions.assertEquals("mjpb", model.configuration().columns().get(0)); + Assertions.assertEquals(GranularityType.MONTHLY, model.granularity()); + Assertions.assertEquals("wgipwhono", model.configuration().columns().get(0)); + Assertions.assertEquals("gshwankixz", model.configuration().dataVersion()); + Assertions.assertEquals(FilterItemNames.RESERVATION_SCOPE, model.configuration().filters().get(0).name()); + Assertions.assertEquals("uttmrywnuzoqft", model.configuration().filters().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExportDataset model = new ExportDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ExportDatasetConfiguration().withColumns(Arrays.asList("mjpb", "ephmgtvljvrcmyfq"))); + ExportDataset model = new ExportDataset().withGranularity(GranularityType.MONTHLY) + .withConfiguration(new ExportDatasetConfiguration().withColumns(Arrays.asList("wgipwhono")) + .withDataVersion("gshwankixz") + .withFilters(Arrays.asList( + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("uttmrywnuzoqft"), + new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("rnkcqvyxlw"), + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("icohoqqnwvl")))); model = BinaryData.fromObject(model).toObject(ExportDataset.class); - Assertions.assertEquals(GranularityType.DAILY, model.granularity()); - Assertions.assertEquals("mjpb", model.configuration().columns().get(0)); + Assertions.assertEquals(GranularityType.MONTHLY, model.granularity()); + Assertions.assertEquals("wgipwhono", model.configuration().columns().get(0)); + Assertions.assertEquals("gshwankixz", model.configuration().dataVersion()); + Assertions.assertEquals(FilterItemNames.RESERVATION_SCOPE, model.configuration().filters().get(0).name()); + Assertions.assertEquals("uttmrywnuzoqft", model.configuration().filters().get(0).value()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDefinitionTests.java index 902fbc626bcf..cc846f7ae6fd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -10,6 +10,8 @@ import com.azure.resourcemanager.costmanagement.models.ExportDefinition; import com.azure.resourcemanager.costmanagement.models.ExportTimePeriod; import com.azure.resourcemanager.costmanagement.models.ExportType; +import com.azure.resourcemanager.costmanagement.models.FilterItemNames; +import com.azure.resourcemanager.costmanagement.models.FilterItems; import com.azure.resourcemanager.costmanagement.models.GranularityType; import com.azure.resourcemanager.costmanagement.models.TimeframeType; import java.time.OffsetDateTime; @@ -20,31 +22,43 @@ public final class ExportDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExportDefinition model = BinaryData.fromString( - "{\"type\":\"ActualCost\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-11-25T13:45:13Z\",\"to\":\"2021-04-13T05:47:21Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"nssqyzqed\",\"kdfrdbiqmrjgeihf\",\"lg\"]}}}") + "{\"type\":\"ReservationRecommendations\",\"timeframe\":\"BillingMonthToDate\",\"timePeriod\":{\"from\":\"2021-12-01T07:03:23Z\",\"to\":\"2021-12-09T16:13:48Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"wtiukbldn\",\"kpoc\",\"pazyxoegukg\",\"npiucgygevqznty\"],\"dataVersion\":\"rbpizc\",\"filters\":[{\"name\":\"ResourceType\",\"value\":\"pyd\"},{\"name\":\"ReservationScope\",\"value\":\"xdeoejzic\"},{\"name\":\"ReservationScope\",\"value\":\"jttgzf\"},{\"name\":\"ReservationScope\",\"value\":\"cbkhajdeyeamdph\"}]}}}") .toObject(ExportDefinition.class); - Assertions.assertEquals(ExportType.ACTUAL_COST, model.type()); - Assertions.assertEquals(TimeframeType.CUSTOM, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T13:45:13Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T05:47:21Z"), model.timePeriod().to()); - Assertions.assertEquals(GranularityType.DAILY, model.dataSet().granularity()); - Assertions.assertEquals("nssqyzqed", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals(ExportType.RESERVATION_RECOMMENDATIONS, model.type()); + Assertions.assertEquals(TimeframeType.BILLING_MONTH_TO_DATE, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T07:03:23Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T16:13:48Z"), model.timePeriod().to()); + Assertions.assertEquals(GranularityType.MONTHLY, model.dataSet().granularity()); + Assertions.assertEquals("wtiukbldn", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("rbpizc", model.dataSet().configuration().dataVersion()); + Assertions.assertEquals(FilterItemNames.RESOURCE_TYPE, model.dataSet().configuration().filters().get(0).name()); + Assertions.assertEquals("pyd", model.dataSet().configuration().filters().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExportDefinition model = new ExportDefinition().withType(ExportType.ACTUAL_COST) - .withTimeframe(TimeframeType.CUSTOM) - .withTimePeriod(new ExportTimePeriod().withFrom(OffsetDateTime.parse("2021-11-25T13:45:13Z")) - .withTo(OffsetDateTime.parse("2021-04-13T05:47:21Z"))) - .withDataSet(new ExportDataset().withGranularity(GranularityType.DAILY) + ExportDefinition model = new ExportDefinition().withType(ExportType.RESERVATION_RECOMMENDATIONS) + .withTimeframe(TimeframeType.BILLING_MONTH_TO_DATE) + .withTimePeriod(new ExportTimePeriod().withFrom(OffsetDateTime.parse("2021-12-01T07:03:23Z")) + .withTo(OffsetDateTime.parse("2021-12-09T16:13:48Z"))) + .withDataSet(new ExportDataset().withGranularity(GranularityType.MONTHLY) .withConfiguration(new ExportDatasetConfiguration() - .withColumns(Arrays.asList("nssqyzqed", "kdfrdbiqmrjgeihf", "lg")))); + .withColumns(Arrays.asList("wtiukbldn", "kpoc", "pazyxoegukg", "npiucgygevqznty")) + .withDataVersion("rbpizc") + .withFilters(Arrays.asList( + new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("pyd"), + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("xdeoejzic"), + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("jttgzf"), + new FilterItems().withName(FilterItemNames.RESERVATION_SCOPE).withValue("cbkhajdeyeamdph"))))); model = BinaryData.fromObject(model).toObject(ExportDefinition.class); - Assertions.assertEquals(ExportType.ACTUAL_COST, model.type()); - Assertions.assertEquals(TimeframeType.CUSTOM, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T13:45:13Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T05:47:21Z"), model.timePeriod().to()); - Assertions.assertEquals(GranularityType.DAILY, model.dataSet().granularity()); - Assertions.assertEquals("nssqyzqed", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals(ExportType.RESERVATION_RECOMMENDATIONS, model.type()); + Assertions.assertEquals(TimeframeType.BILLING_MONTH_TO_DATE, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T07:03:23Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-09T16:13:48Z"), model.timePeriod().to()); + Assertions.assertEquals(GranularityType.MONTHLY, model.dataSet().granularity()); + Assertions.assertEquals("wtiukbldn", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("rbpizc", model.dataSet().configuration().dataVersion()); + Assertions.assertEquals(FilterItemNames.RESOURCE_TYPE, model.dataSet().configuration().filters().get(0).name()); + Assertions.assertEquals("pyd", model.dataSet().configuration().filters().get(0).value()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRecurrencePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRecurrencePeriodTests.java index 1287285e972c..fd7654cedce9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRecurrencePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRecurrencePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,19 +13,19 @@ public final class ExportRecurrencePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExportRecurrencePeriod model - = BinaryData.fromString("{\"from\":\"2021-09-23T23:42:16Z\",\"to\":\"2021-03-28T11:22:10Z\"}") + = BinaryData.fromString("{\"from\":\"2021-05-07T21:37:49Z\",\"to\":\"2021-09-06T09:59:07Z\"}") .toObject(ExportRecurrencePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T23:42:16Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-28T11:22:10Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T21:37:49Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T09:59:07Z"), model.to()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExportRecurrencePeriod model - = new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2021-09-23T23:42:16Z")) - .withTo(OffsetDateTime.parse("2021-03-28T11:22:10Z")); + = new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2021-05-07T21:37:49Z")) + .withTo(OffsetDateTime.parse("2021-09-06T09:59:07Z")); model = BinaryData.fromObject(model).toObject(ExportRecurrencePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T23:42:16Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-28T11:22:10Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T21:37:49Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T09:59:07Z"), model.to()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRunRequestTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRunRequestTests.java new file mode 100644 index 000000000000..467aa7fc0785 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportRunRequestTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.ExportRunRequest; +import com.azure.resourcemanager.costmanagement.models.ExportTimePeriod; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ExportRunRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExportRunRequest model = BinaryData + .fromString("{\"timePeriod\":{\"from\":\"2021-02-12T14:22:27Z\",\"to\":\"2021-04-06T13:29:48Z\"}}") + .toObject(ExportRunRequest.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T14:22:27Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T13:29:48Z"), model.timePeriod().to()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExportRunRequest model = new ExportRunRequest() + .withTimePeriod(new ExportTimePeriod().withFrom(OffsetDateTime.parse("2021-02-12T14:22:27Z")) + .withTo(OffsetDateTime.parse("2021-04-06T13:29:48Z"))); + model = BinaryData.fromObject(model).toObject(ExportRunRequest.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T14:22:27Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T13:29:48Z"), model.timePeriod().to()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportScheduleTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportScheduleTests.java index a440750e79ad..3319f9f47514 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportScheduleTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportScheduleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -16,24 +16,24 @@ public final class ExportScheduleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExportSchedule model = BinaryData.fromString( - "{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2021-07-05T12:47:55Z\",\"to\":\"2021-05-06T00:06:36Z\"}}") + "{\"status\":\"Active\",\"recurrence\":\"Monthly\",\"recurrencePeriod\":{\"from\":\"2021-09-16T11:30:17Z\",\"to\":\"2020-12-28T21:21:46Z\"}}") .toObject(ExportSchedule.class); Assertions.assertEquals(StatusType.ACTIVE, model.status()); - Assertions.assertEquals(RecurrenceType.DAILY, model.recurrence()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T12:47:55Z"), model.recurrencePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T00:06:36Z"), model.recurrencePeriod().to()); + Assertions.assertEquals(RecurrenceType.MONTHLY, model.recurrence()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-16T11:30:17Z"), model.recurrencePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T21:21:46Z"), model.recurrencePeriod().to()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExportSchedule model = new ExportSchedule().withStatus(StatusType.ACTIVE) - .withRecurrence(RecurrenceType.DAILY) - .withRecurrencePeriod(new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2021-07-05T12:47:55Z")) - .withTo(OffsetDateTime.parse("2021-05-06T00:06:36Z"))); + .withRecurrence(RecurrenceType.MONTHLY) + .withRecurrencePeriod(new ExportRecurrencePeriod().withFrom(OffsetDateTime.parse("2021-09-16T11:30:17Z")) + .withTo(OffsetDateTime.parse("2020-12-28T21:21:46Z"))); model = BinaryData.fromObject(model).toObject(ExportSchedule.class); Assertions.assertEquals(StatusType.ACTIVE, model.status()); - Assertions.assertEquals(RecurrenceType.DAILY, model.recurrence()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T12:47:55Z"), model.recurrencePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T00:06:36Z"), model.recurrencePeriod().to()); + Assertions.assertEquals(RecurrenceType.MONTHLY, model.recurrence()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-16T11:30:17Z"), model.recurrencePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T21:21:46Z"), model.recurrencePeriod().to()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportTimePeriodTests.java index e638f75807ef..d243c2fdeb5a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportTimePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportTimePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,18 +13,18 @@ public final class ExportTimePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExportTimePeriod model - = BinaryData.fromString("{\"from\":\"2021-11-07T22:44:08Z\",\"to\":\"2021-04-19T02:56:34Z\"}") + = BinaryData.fromString("{\"from\":\"2021-04-08T03:04:22Z\",\"to\":\"2021-10-28T21:12:04Z\"}") .toObject(ExportTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T22:44:08Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T02:56:34Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T03:04:22Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T21:12:04Z"), model.to()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExportTimePeriod model = new ExportTimePeriod().withFrom(OffsetDateTime.parse("2021-11-07T22:44:08Z")) - .withTo(OffsetDateTime.parse("2021-04-19T02:56:34Z")); + ExportTimePeriod model = new ExportTimePeriod().withFrom(OffsetDateTime.parse("2021-04-08T03:04:22Z")) + .withTo(OffsetDateTime.parse("2021-10-28T21:12:04Z")); model = BinaryData.fromObject(model).toObject(ExportTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T22:44:08Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T02:56:34Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T03:04:22Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T21:12:04Z"), model.to()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteByResourceGroupWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteByResourceGroupWithResponseMockTests.java index a66d785d62b0..ac6bae88d1b3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsDeleteByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.exports().deleteByResourceGroupWithResponse("wkqyns", "gbvoffbkk", com.azure.core.util.Context.NONE); + manager.exports().deleteByResourceGroupWithResponse("jy", "cqypz", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteWithResponseMockTests.java index 96a65a93cfca..f9bbacd041a9 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsExecuteWithResponseMockTests.java @@ -1,15 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.ExportRunRequest; +import com.azure.resourcemanager.costmanagement.models.ExportTimePeriod; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; @@ -25,9 +27,14 @@ public void testExecuteWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.exports().executeWithResponse("vdxaexqokmyrljia", "zbnobr", com.azure.core.util.Context.NONE); + manager.exports() + .executeWithResponse("qogdx", "bsfp", + new ExportRunRequest() + .withTimePeriod(new ExportTimePeriod().withFrom(OffsetDateTime.parse("2021-07-18T00:46:31Z")) + .withTo(OffsetDateTime.parse("2021-01-23T06:57:05Z"))), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsListWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsListWithResponseMockTests.java deleted file mode 100644 index 4cd51ba2056b..000000000000 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ExportsListWithResponseMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.costmanagement.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.costmanagement.CostManagementManager; -import com.azure.resourcemanager.costmanagement.models.ExportListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExportsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2021-07-19T01:45:33Z\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"container\":\"et\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-01-12T18:34:48Z\",\"to\":\"2021-06-04T17:44:57Z\"},\"dataSet\":{}},\"runHistory\":{\"value\":[{\"id\":\"kyfwnwpiwxeiicr\",\"name\":\"p\",\"type\":\"pk\"}]},\"partitionData\":true,\"nextRunTimeEstimate\":\"2021-02-06T15:21:36Z\"},\"eTag\":\"ijvs\",\"id\":\"ws\",\"name\":\"gkjgya\",\"type\":\"wrasekw\"},{\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Monthly\",\"recurrencePeriod\":{\"from\":\"2021-07-19T15:07:46Z\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"container\":\"rtwy\"}},\"definition\":{\"type\":\"AmortizedCost\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2020-12-22T10:03:42Z\",\"to\":\"2021-08-01T11:14:17Z\"},\"dataSet\":{}},\"runHistory\":{\"value\":[{\"id\":\"davuqmcbyms\",\"name\":\"ob\",\"type\":\"lquvjezcjumvp\"},{\"id\":\"imioyo\",\"name\":\"glkmiqwnnr\",\"type\":\"clibbfqpsp\"},{\"id\":\"ladydgnhautwu\",\"name\":\"exzgpmnmabedd\",\"type\":\"ilwgdfpfqfpcvstc\"},{\"id\":\"gq\",\"name\":\"vwerfwxbsmtb\",\"type\":\"jj\"}]},\"partitionData\":false,\"nextRunTimeEstimate\":\"2021-02-16T12:19:52Z\"},\"eTag\":\"kwdvbtb\",\"id\":\"ekqhs\",\"name\":\"htfpwpqb\",\"type\":\"ejuwyqwdqigmghgi\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CostManagementManager manager = CostManagementManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExportListResult response - = manager.exports().listWithResponse("lbciphmsexro", "rndktx", com.azure.core.util.Context.NONE).getValue(); - - } -} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FileDestinationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FileDestinationTests.java index 5265c05a1172..9376d3292089 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FileDestinationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FileDestinationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,14 +13,13 @@ public final class FileDestinationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FileDestination model - = BinaryData.fromString("{\"fileFormats\":[\"Csv\",\"Csv\"]}").toObject(FileDestination.class); + FileDestination model = BinaryData.fromString("{\"fileFormats\":[\"Csv\"]}").toObject(FileDestination.class); Assertions.assertEquals(FileFormat.CSV, model.fileFormats().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FileDestination model = new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV)); + FileDestination model = new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV)); model = BinaryData.fromObject(model).toObject(FileDestination.class); Assertions.assertEquals(FileFormat.CSV, model.fileFormats().get(0)); } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FilterItemsTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FilterItemsTests.java new file mode 100644 index 000000000000..3fcd2f26b2fc --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/FilterItemsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.FilterItemNames; +import com.azure.resourcemanager.costmanagement.models.FilterItems; +import org.junit.jupiter.api.Assertions; + +public final class FilterItemsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FilterItems model + = BinaryData.fromString("{\"name\":\"ResourceType\",\"value\":\"fuwutttxf\"}").toObject(FilterItems.class); + Assertions.assertEquals(FilterItemNames.RESOURCE_TYPE, model.name()); + Assertions.assertEquals("fuwutttxf", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FilterItems model = new FilterItems().withName(FilterItemNames.RESOURCE_TYPE).withValue("fuwutttxf"); + model = BinaryData.fromObject(model).toObject(FilterItems.class); + Assertions.assertEquals(FilterItemNames.RESOURCE_TYPE, model.name()); + Assertions.assertEquals("fuwutttxf", model.value()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastAggregationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastAggregationTests.java index 2146b21c172d..f294579c6501 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastAggregationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastAggregationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,18 +13,18 @@ public final class ForecastAggregationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ForecastAggregation model - = BinaryData.fromString("{\"name\":\"CostUSD\",\"function\":\"Sum\"}").toObject(ForecastAggregation.class); - Assertions.assertEquals(FunctionName.COST_USD, model.name()); + ForecastAggregation model = BinaryData.fromString("{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}") + .toObject(ForecastAggregation.class); + Assertions.assertEquals(FunctionName.PRE_TAX_COST, model.name()); Assertions.assertEquals(FunctionType.SUM, model.function()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ForecastAggregation model - = new ForecastAggregation().withName(FunctionName.COST_USD).withFunction(FunctionType.SUM); + = new ForecastAggregation().withName(FunctionName.PRE_TAX_COST).withFunction(FunctionType.SUM); model = BinaryData.fromObject(model).toObject(ForecastAggregation.class); - Assertions.assertEquals(FunctionName.COST_USD, model.name()); + Assertions.assertEquals(FunctionName.PRE_TAX_COST, model.name()); Assertions.assertEquals(FunctionType.SUM, model.function()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastColumnTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastColumnTests.java index 1048096b1fe8..129df835cba8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastColumnTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastColumnTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,17 +11,9 @@ public final class ForecastColumnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ForecastColumn model = BinaryData.fromString("{\"name\":\"uutlwxezwzhok\",\"type\":\"wnhhtqlgehgppip\"}") - .toObject(ForecastColumn.class); - Assertions.assertEquals("uutlwxezwzhok", model.name()); - Assertions.assertEquals("wnhhtqlgehgppip", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastColumn model = new ForecastColumn().withName("uutlwxezwzhok").withType("wnhhtqlgehgppip"); - model = BinaryData.fromObject(model).toObject(ForecastColumn.class); - Assertions.assertEquals("uutlwxezwzhok", model.name()); - Assertions.assertEquals("wnhhtqlgehgppip", model.type()); + ForecastColumn model + = BinaryData.fromString("{\"name\":\"ggmuwdcho\",\"type\":\"nkf\"}").toObject(ForecastColumn.class); + Assertions.assertEquals("ggmuwdcho", model.name()); + Assertions.assertEquals("nkf", model.type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastComparisonExpressionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastComparisonExpressionTests.java index 7cbdcad9da04..e2ec86f1ccc5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastComparisonExpressionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastComparisonExpressionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,22 +13,22 @@ public final class ForecastComparisonExpressionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ForecastComparisonExpression model = BinaryData.fromString( - "{\"name\":\"xkyxvxevblbj\",\"operator\":\"In\",\"values\":[\"ljlageuaulxu\",\"smjbnkppxyn\",\"nlsvxeiz\"]}") - .toObject(ForecastComparisonExpression.class); - Assertions.assertEquals("xkyxvxevblbj", model.name()); + ForecastComparisonExpression model + = BinaryData.fromString("{\"name\":\"qyv\",\"operator\":\"In\",\"values\":[\"tae\"]}") + .toObject(ForecastComparisonExpression.class); + Assertions.assertEquals("qyv", model.name()); Assertions.assertEquals(ForecastOperatorType.IN, model.operator()); - Assertions.assertEquals("ljlageuaulxu", model.values().get(0)); + Assertions.assertEquals("tae", model.values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForecastComparisonExpression model = new ForecastComparisonExpression().withName("xkyxvxevblbj") + ForecastComparisonExpression model = new ForecastComparisonExpression().withName("qyv") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ljlageuaulxu", "smjbnkppxyn", "nlsvxeiz")); + .withValues(Arrays.asList("tae")); model = BinaryData.fromObject(model).toObject(ForecastComparisonExpression.class); - Assertions.assertEquals("xkyxvxevblbj", model.name()); + Assertions.assertEquals("qyv", model.name()); Assertions.assertEquals(ForecastOperatorType.IN, model.operator()); - Assertions.assertEquals("ljlageuaulxu", model.values().get(0)); + Assertions.assertEquals("tae", model.values().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetConfigurationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetConfigurationTests.java index b3296c897882..572c4509852b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetConfigurationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,15 +13,16 @@ public final class ForecastDatasetConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastDatasetConfiguration model - = BinaryData.fromString("{\"columns\":[\"wcfzqljyxgt\"]}").toObject(ForecastDatasetConfiguration.class); - Assertions.assertEquals("wcfzqljyxgt", model.columns().get(0)); + = BinaryData.fromString("{\"columns\":[\"nsq\",\"wxwcomli\",\"ytwvczcswkacve\"]}") + .toObject(ForecastDatasetConfiguration.class); + Assertions.assertEquals("nsq", model.columns().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ForecastDatasetConfiguration model - = new ForecastDatasetConfiguration().withColumns(Arrays.asList("wcfzqljyxgt")); + = new ForecastDatasetConfiguration().withColumns(Arrays.asList("nsq", "wxwcomli", "ytwvczcswkacve")); model = BinaryData.fromObject(model).toObject(ForecastDatasetConfiguration.class); - Assertions.assertEquals("wcfzqljyxgt", model.columns().get(0)); + Assertions.assertEquals("nsq", model.columns().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetTests.java index 4c4abf2346b0..b4e194133a77 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDatasetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -23,307 +23,361 @@ public final class ForecastDatasetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastDataset model = BinaryData.fromString( - "{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"jihy\",\"ozphvwauyqncygu\",\"kvi\"]},\"aggregation\":{\"cwxqu\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"zhfstot\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"jujbypelmcuvhixb\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"filter\":{\"and\":[{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"o\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"tpkiwkkbnujry\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"curdoiwiitht\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"b\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"ihwqknfdntwjchr\",\"operator\":\"In\",\"values\":[\"ihxumwctondzj\",\"uu\",\"fdlwg\",\"ytsbwtovv\"]},\"tags\":{\"name\":\"seinqfiuf\",\"operator\":\"In\",\"values\":[\"npirgnepttw\",\"msniffc\",\"mqnrojlpijnkr\",\"frddhcrati\"]}}],\"or\":[{\"and\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"tozqyzhftwesgo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"honnxkrlgnyhmos\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"gh\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"dhqxvcx\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"fbshrnsvbuswd\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ybycnunvj\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"nopqgikyzirtx\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"x\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"ntps\",\"operator\":\"In\",\"values\":[\"ioilqukrydxtq\",\"ieoxorggufhyaomt\"]},\"tags\":{\"name\":\"hhavgrvkffovjz\",\"operator\":\"In\",\"values\":[\"bibgjmfxumv\",\"cluyovwxnbkf\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"wzdgirujbzbo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"zbtd\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ujviylwdshfs\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bgye\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ojfmwnco\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fhir\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ftpipiwyczu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"cpqjlihhyu\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"mfwdgzxu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"vpa\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"vxurisjnhnytxifq\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"xmrhu\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"pcesutrg\",\"operator\":\"In\",\"values\":[\"auutpwoqhihe\",\"qg\"]},\"tags\":{\"name\":\"pnfqntcyp\",\"operator\":\"In\",\"values\":[\"vfoimwksli\"]}},{\"and\":[{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"dfcea\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"hvygdyftumr\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"iw\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"gcyztsfmznbae\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"chqnrnrpxehuwry\",\"operator\":\"In\",\"values\":[\"aifmvikl\",\"ydv\"]},\"tags\":{\"name\":\"bejdznxcv\",\"operator\":\"In\",\"values\":[\"hnjivo\"]}}],\"dimensions\":{\"name\":\"tnovqfzgemjdftul\",\"operator\":\"In\",\"values\":[\"duceamtmc\",\"u\"]},\"tags\":{\"name\":\"ejwcwwqiok\",\"operator\":\"In\",\"values\":[\"xmojmsvpkjp\"]}}}") + "{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"bmxuqib\",\"xtkcudfbsfar\",\"siowlkjxnqpv\"]},\"aggregation\":{\"tmhqykiz\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"filter\":{\"and\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"qvoxmycj\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"yvwgcwwpbmzgwe\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"fo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bvopwndyqle\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"khlowkxxpv\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fjmzsyzfho\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"h\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"jlpjrtwszhv\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"trrmhwrb\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"yflubhvjglroc\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"lw\",\"operator\":\"In\",\"values\":[\"emhooclutnpq\",\"emc\",\"jk\",\"mykyujxsglhs\"]},\"tags\":{\"name\":\"rye\",\"operator\":\"In\",\"values\":[\"m\",\"kzudn\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"jewlpxuzzjg\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fqyhqoto\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"wf\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wpzdqtvhcspo\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"pie\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"eb\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"lbmoichd\",\"operator\":\"In\",\"values\":[\"fpubntnbatz\",\"iqsowsaaelc\",\"ttcjuhplrvkmjc\"]},\"tags\":{\"name\":\"jvlgfggcvkyyliz\",\"operator\":\"In\",\"values\":[\"jpsfxsfu\",\"tl\",\"tmvag\",\"w\"]}},{\"and\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"oveofizrvjfnmj\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wyzgiblkuj\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"jpu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ucejikzoeovvtz\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"nt\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"juzkdbqz\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"qjwt\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"gv\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"c\",\"operator\":\"In\",\"values\":[\"olawjmjsmwrokcdx\",\"zzzwy\",\"afitlhguynuchlg\",\"ltxdwhmozu\"]},\"tags\":{\"name\":\"zvlnsnnjz\",\"operator\":\"In\",\"values\":[\"folpymwamxqzra\",\"p\",\"dphtv\",\"ulajvlejchc\"]}}],\"or\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"nrupdwvnphcnzqtp\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"qrhvthlaiwdcxsml\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"etlgydlhqvlnnpx\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fiqgeaar\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"klbyulidwcw\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"eg\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"rwgdnqzbrfks\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"zmtksjci\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"l\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"keuachtomf\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"pfmdgycx\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"kwhqj\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"pshhkvpedwqslsr\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"qvwwsko\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"muvqejosovyr\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"a\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"nu\",\"operator\":\"In\",\"values\":[\"jqo\",\"bpihehcecybmrqbr\",\"bbmpxdlvykfre\",\"crse\"]},\"tags\":{\"name\":\"jksghudg\",\"operator\":\"In\",\"values\":[\"ogjggsvoujkxibda\"]}}],\"dimensions\":{\"name\":\"rkmdyom\",\"operator\":\"In\",\"values\":[\"bv\",\"bhdyir\"]},\"tags\":{\"name\":\"wpg\",\"operator\":\"In\",\"values\":[\"im\",\"wzovgk\",\"um\",\"ikjcjcazt\"]}}}") .toObject(ForecastDataset.class); Assertions.assertEquals(GranularityType.DAILY, model.granularity()); - Assertions.assertEquals("jihy", model.configuration().columns().get(0)); - Assertions.assertEquals(FunctionName.PRE_TAX_COST, model.aggregation().get("cwxqu").name()); - Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("cwxqu").function()); - Assertions.assertEquals("o", model.filter().and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("bmxuqib", model.configuration().columns().get(0)); + Assertions.assertEquals(FunctionName.PRE_TAX_COST, model.aggregation().get("tmhqykiz").name()); + Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("tmhqykiz").function()); + Assertions.assertEquals("qvoxmycj", model.filter().and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("tpkiwkkbnujry", model.filter().and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("yvwgcwwpbmzgwe", model.filter().and().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("curdoiwiitht", model.filter().and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("h", model.filter().and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("b", model.filter().and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("jlpjrtwszhv", model.filter().and().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("ihwqknfdntwjchr", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals("lw", model.filter().and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("ihxumwctondzj", model.filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("seinqfiuf", model.filter().and().get(0).tags().name()); + Assertions.assertEquals("emhooclutnpq", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("rye", model.filter().and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).tags().operator()); - Assertions.assertEquals("npirgnepttw", model.filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("tozqyzhftwesgo", model.filter().or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("m", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("nrupdwvnphcnzqtp", model.filter().or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("honnxkrlgnyhmos", model.filter().or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("qrhvthlaiwdcxsml", model.filter().or().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("gh", model.filter().or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("l", model.filter().or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("dhqxvcx", model.filter().or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("keuachtomf", model.filter().or().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("ntps", model.filter().or().get(0).dimensions().name()); + Assertions.assertEquals("nu", model.filter().or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("ioilqukrydxtq", model.filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("hhavgrvkffovjz", model.filter().or().get(0).tags().name()); + Assertions.assertEquals("jqo", model.filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("jksghudg", model.filter().or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).tags().operator()); - Assertions.assertEquals("bibgjmfxumv", model.filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("tnovqfzgemjdftul", model.filter().dimensions().name()); + Assertions.assertEquals("ogjggsvoujkxibda", model.filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("rkmdyom", model.filter().dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().dimensions().operator()); - Assertions.assertEquals("duceamtmc", model.filter().dimensions().values().get(0)); - Assertions.assertEquals("ejwcwwqiok", model.filter().tags().name()); + Assertions.assertEquals("bv", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("wpg", model.filter().tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().tags().operator()); - Assertions.assertEquals("xmojmsvpkjp", model.filter().tags().values().get(0)); + Assertions.assertEquals("im", model.filter().tags().values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ForecastDataset model = new ForecastDataset().withGranularity(GranularityType.DAILY) - .withConfiguration( - new ForecastDatasetConfiguration().withColumns(Arrays.asList("jihy", "ozphvwauyqncygu", "kvi"))) - .withAggregation( - mapOf("cwxqu", - new ForecastAggregation().withName(FunctionName.PRE_TAX_COST).withFunction(FunctionType.SUM), - "zhfstot", new ForecastAggregation().withName(FunctionName.COST).withFunction(FunctionType.SUM), - "jujbypelmcuvhixb", - new ForecastAggregation().withName(FunctionName.PRE_TAX_COST).withFunction(FunctionType.SUM))) + .withConfiguration(new ForecastDatasetConfiguration() + .withColumns(Arrays.asList("bmxuqib", "xtkcudfbsfar", "siowlkjxnqpv"))) + .withAggregation(mapOf("tmhqykiz", + new ForecastAggregation().withName(FunctionName.PRE_TAX_COST).withFunction(FunctionType.SUM))) .withFilter( new ForecastFilter() .withAnd( - Arrays - .asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("o") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression() - .withName("tpkiwkkbnujry") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("curdoiwiitht") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("b") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new ForecastComparisonExpression().withName("ihwqknfdntwjchr") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ihxumwctondzj", "uu", "fdlwg", "ytsbwtovv"))) - .withTags( - new ForecastComparisonExpression().withName("seinqfiuf") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("npirgnepttw", "msniffc", "mqnrojlpijnkr", - "frddhcrati"))))) - .withOr( Arrays .asList( new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions( - new ForecastComparisonExpression().withName("tozqyzhftwesgo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("honnxkrlgnyhmos") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( + .withAnd(Arrays.asList( new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("gh") + .withDimensions(new ForecastComparisonExpression().withName("qvoxmycj") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())) .withTags(new ForecastComparisonExpression() - .withName("dhqxvcx") + .withName("yvwgcwwpbmzgwe") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions( - new ForecastComparisonExpression().withName("fbshrnsvbuswd") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags( - new ForecastComparisonExpression().withName("ybycnunvj") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions( - new ForecastComparisonExpression().withName("nopqgikyzirtx") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("x") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new ForecastComparisonExpression() - .withName("ntps") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ioilqukrydxtq", "ieoxorggufhyaomt"))) - .withTags(new ForecastComparisonExpression() - .withName("hhavgrvkffovjz") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("bibgjmfxumv", "cluyovwxnbkf"))), - new ForecastFilter() - .withAnd(Arrays.asList( new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions( - new ForecastComparisonExpression().withName("wzdgirujbzbo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("zbtd") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions( - new ForecastComparisonExpression().withName("ujviylwdshfs") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("bgye") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("ojfmwnco") + .withDimensions(new ForecastComparisonExpression() + .withName("fo") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())) .withTags(new ForecastComparisonExpression() - .withName("fhir") + .withName("bvopwndyqle") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())), new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) .withDimensions( - new ForecastComparisonExpression().withName("ftpipiwyczu") + new ForecastComparisonExpression().withName("khlowkxxpv") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression() - .withName("cpqjlihhyu") + .withTags(new ForecastComparisonExpression().withName("fjmzsyzfho") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())))) .withOr(Arrays.asList( new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) + new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("mfwdgzxu") + .withDimensions(new ForecastComparisonExpression().withName("h") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("vpa") + .withTags(new ForecastComparisonExpression().withName("jlpjrtwszhv") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions( - new ForecastComparisonExpression().withName("vxurisjnhnytxifq") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("xmrhu") + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("trrmhwrb") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("yflubhvjglroc") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new ForecastComparisonExpression().withName("pcesutrg") + .withDimensions(new ForecastComparisonExpression().withName("lw") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("emhooclutnpq", "emc", "jk", "mykyujxsglhs"))) + .withTags(new ForecastComparisonExpression().withName("rye") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("auutpwoqhihe", "qg"))) + .withValues(Arrays.asList("m", "kzudn"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("jewlpxuzzjg") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("fqyhqoto") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr( + Arrays + .asList( + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions( + new ForecastComparisonExpression().withName("wf") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("wpzdqtvhcspo") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions( + new ForecastComparisonExpression().withName("pie") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("eb") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new ForecastComparisonExpression().withName("lbmoichd") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("fpubntnbatz", "iqsowsaaelc", "ttcjuhplrvkmjc"))) .withTags(new ForecastComparisonExpression() - .withName("pnfqntcyp") + .withName("jvlgfggcvkyyliz") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("vfoimwksli"))), + .withValues(Arrays.asList("jpsfxsfu", "tl", "tmvag", "w"))), new ForecastFilter() .withAnd(Arrays .asList(new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions( + new ForecastComparisonExpression().withName("oveofizrvjfnmj") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("wyzgiblkuj") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("dfcea") + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("jpu") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("hvygdyftumr") + .withTags(new ForecastComparisonExpression().withName("ucejikzoeovvtz") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays - .asList(new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("iw") + .withDimensions(new ForecastComparisonExpression().withName("nt") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("gcyztsfmznbae") + .withTags(new ForecastComparisonExpression().withName("juzkdbqz") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("qjwt") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("gv") .withOperator(ForecastOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new ForecastComparisonExpression().withName("chqnrnrpxehuwry") + .withDimensions(new ForecastComparisonExpression().withName("c") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("aifmvikl", "ydv"))) - .withTags(new ForecastComparisonExpression().withName("bejdznxcv") + .withValues(Arrays.asList("olawjmjsmwrokcdx", "zzzwy", "afitlhguynuchlg", + "ltxdwhmozu"))) + .withTags(new ForecastComparisonExpression() + .withName("zvlnsnnjz") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("hnjivo"))))) - .withDimensions(new ForecastComparisonExpression().withName("tnovqfzgemjdftul") + .withValues(Arrays.asList("folpymwamxqzra", "p", "dphtv", "ulajvlejchc"))))) + .withOr(Arrays.asList(new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("nrupdwvnphcnzqtp") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("qrhvthlaiwdcxsml") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("etlgydlhqvlnnpx") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("fiqgeaar") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("klbyulidwcw") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("eg") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("rwgdnqzbrfks") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("zmtksjci") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("l") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("keuachtomf") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("pfmdgycx") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("kwhqj") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("pshhkvpedwqslsr") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("qvwwsko") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("muvqejosovyr") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("a") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new ForecastComparisonExpression().withName("nu") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("jqo", "bpihehcecybmrqbr", "bbmpxdlvykfre", "crse"))) + .withTags(new ForecastComparisonExpression().withName("jksghudg") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("ogjggsvoujkxibda"))))) + .withDimensions(new ForecastComparisonExpression().withName("rkmdyom") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("duceamtmc", "u"))) - .withTags(new ForecastComparisonExpression().withName("ejwcwwqiok") + .withValues(Arrays.asList("bv", "bhdyir"))) + .withTags(new ForecastComparisonExpression().withName("wpg") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("xmojmsvpkjp")))); + .withValues(Arrays.asList("im", "wzovgk", "um", "ikjcjcazt")))); model = BinaryData.fromObject(model).toObject(ForecastDataset.class); Assertions.assertEquals(GranularityType.DAILY, model.granularity()); - Assertions.assertEquals("jihy", model.configuration().columns().get(0)); - Assertions.assertEquals(FunctionName.PRE_TAX_COST, model.aggregation().get("cwxqu").name()); - Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("cwxqu").function()); - Assertions.assertEquals("o", model.filter().and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("bmxuqib", model.configuration().columns().get(0)); + Assertions.assertEquals(FunctionName.PRE_TAX_COST, model.aggregation().get("tmhqykiz").name()); + Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("tmhqykiz").function()); + Assertions.assertEquals("qvoxmycj", model.filter().and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("tpkiwkkbnujry", model.filter().and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("yvwgcwwpbmzgwe", model.filter().and().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("curdoiwiitht", model.filter().and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("h", model.filter().and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("b", model.filter().and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("jlpjrtwszhv", model.filter().and().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("ihwqknfdntwjchr", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals("lw", model.filter().and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("ihxumwctondzj", model.filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("seinqfiuf", model.filter().and().get(0).tags().name()); + Assertions.assertEquals("emhooclutnpq", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("rye", model.filter().and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().and().get(0).tags().operator()); - Assertions.assertEquals("npirgnepttw", model.filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("tozqyzhftwesgo", model.filter().or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("m", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("nrupdwvnphcnzqtp", model.filter().or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("honnxkrlgnyhmos", model.filter().or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("qrhvthlaiwdcxsml", model.filter().or().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("gh", model.filter().or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("l", model.filter().or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("dhqxvcx", model.filter().or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("keuachtomf", model.filter().or().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("ntps", model.filter().or().get(0).dimensions().name()); + Assertions.assertEquals("nu", model.filter().or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("ioilqukrydxtq", model.filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("hhavgrvkffovjz", model.filter().or().get(0).tags().name()); + Assertions.assertEquals("jqo", model.filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("jksghudg", model.filter().or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().or().get(0).tags().operator()); - Assertions.assertEquals("bibgjmfxumv", model.filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("tnovqfzgemjdftul", model.filter().dimensions().name()); + Assertions.assertEquals("ogjggsvoujkxibda", model.filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("rkmdyom", model.filter().dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().dimensions().operator()); - Assertions.assertEquals("duceamtmc", model.filter().dimensions().values().get(0)); - Assertions.assertEquals("ejwcwwqiok", model.filter().tags().name()); + Assertions.assertEquals("bv", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("wpg", model.filter().tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.filter().tags().operator()); - Assertions.assertEquals("xmojmsvpkjp", model.filter().tags().values().get(0)); + Assertions.assertEquals("im", model.filter().tags().values().get(0)); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDefinitionTests.java index ba9c5d5f1b40..5d990180425d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -28,110 +28,179 @@ public final class ForecastDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastDefinition model = BinaryData.fromString( - "{\"type\":\"AmortizedCost\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-09-17T04:04:44Z\",\"to\":\"2021-04-01T21:28:03Z\"},\"dataset\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"hyjsvfycx\",\"bfvoowvrv\"]},\"aggregation\":{\"qp\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"filter\":{\"and\":[{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"myhgfipnsxkmc\",\"operator\":\"In\",\"values\":[\"krrjrea\",\"xt\"]},\"tags\":{\"name\":\"umh\",\"operator\":\"In\",\"values\":[\"ikkx\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"vuzlm\",\"operator\":\"In\",\"values\":[\"lfktgplcrpwjxe\"]},\"tags\":{\"name\":\"oi\",\"operator\":\"In\",\"values\":[\"njwmwkpnbsazejj\",\"qkagfhsxt\"]}}],\"dimensions\":{\"name\":\"ugzxnf\",\"operator\":\"In\",\"values\":[\"pxdtnkdmkq\",\"jlwuenvrkp\"]},\"tags\":{\"name\":\"uaibrebqaaysj\",\"operator\":\"In\",\"values\":[\"qtnqtt\",\"zlwfffiakp\"]}}},\"includeActualCost\":true,\"includeFreshPartialCost\":false}") + "{\"type\":\"ActualCost\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-01-14T06:51:31Z\",\"to\":\"2021-09-29T07:38:32Z\"},\"dataset\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"tmvcop\",\"xcmjurbu\"]},\"aggregation\":{\"yqltqsro\":{\"name\":\"CostUSD\",\"function\":\"Sum\"},\"wkffdjkt\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"idfv\":{\"name\":\"CostUSD\",\"function\":\"Sum\"}},\"filter\":{\"and\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"jtkbusqogsfika\",\"operator\":\"In\",\"values\":[\"nsharujtjiqxfzyj\",\"ttvwkpqh\",\"penuy\",\"bqeqqekewvnqvcd\"]},\"tags\":{\"name\":\"uaucmf\",\"operator\":\"In\",\"values\":[\"nlaxpunjqikcz\",\"vitac\"]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"serxht\",\"operator\":\"In\",\"values\":[\"xhlw\",\"tsjgqrsx\"]},\"tags\":{\"name\":\"ruuuybnch\",\"operator\":\"In\",\"values\":[\"izoyuelyetndnbf\",\"yggagflnlgmt\",\"wahzjmucftbyr\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"pigqfusuckzmkw\",\"operator\":\"In\",\"values\":[\"noxaxmqeqal\",\"hjnhgwydyynfsvk\",\"gbv\"]},\"tags\":{\"name\":\"anarfdlpukhpyrne\",\"operator\":\"In\",\"values\":[\"cpeogkhnmgbrou\",\"ddbhf\",\"pfpazjzoywjxhpdu\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"np\",\"operator\":\"In\",\"values\":[\"ehtuevrhr\",\"jyoogwxh\",\"sd\",\"ugwbsreurfqkf\"]},\"tags\":{\"name\":\"renlvhhtklnvnafv\",\"operator\":\"In\",\"values\":[\"f\",\"devjb\",\"slcqxypokkh\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"zng\",\"operator\":\"In\",\"values\":[\"xxewu\",\"invudbch\",\"qdtvqecrqctmxx\"]},\"tags\":{\"name\":\"ddm\",\"operator\":\"In\",\"values\":[\"uytxzvtznapxban\",\"o\",\"voxczytpr\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ev\",\"operator\":\"In\",\"values\":[\"yo\",\"rrrouuxvnsa\",\"bcrymodizrx\"]},\"tags\":{\"name\":\"obdxnazpmkmlm\",\"operator\":\"In\",\"values\":[\"f\",\"zopjhbzxliohr\"]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"xqbawpc\",\"operator\":\"In\",\"values\":[\"zqcyknap\",\"ofyuicd\"]},\"tags\":{\"name\":\"bd\",\"operator\":\"In\",\"values\":[\"wgbdvibidmhmwffp\",\"fmuvapckccr\"]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"xoy\",\"operator\":\"In\",\"values\":[\"phaimmoi\"]},\"tags\":{\"name\":\"qboshbra\",\"operator\":\"In\",\"values\":[\"yyrmfsvbp\",\"vbopfppdbwnu\"]}}],\"dimensions\":{\"name\":\"ahxku\",\"operator\":\"In\",\"values\":[\"jcaacfdmmcpugm\",\"hqepvufhbzehewh\",\"qhnlbqnbld\",\"eaclgschorimk\"]},\"tags\":{\"name\":\"r\",\"operator\":\"In\",\"values\":[\"ucsofldpuviyf\"]}}},\"includeActualCost\":true,\"includeFreshPartialCost\":true}") .toObject(ForecastDefinition.class); - Assertions.assertEquals(ForecastType.AMORTIZED_COST, model.type()); + Assertions.assertEquals(ForecastType.ACTUAL_COST, model.type()); Assertions.assertEquals(ForecastTimeframe.CUSTOM, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T04:04:44Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-01T21:28:03Z"), model.timePeriod().to()); - Assertions.assertEquals(GranularityType.DAILY, model.dataset().granularity()); - Assertions.assertEquals("hyjsvfycx", model.dataset().configuration().columns().get(0)); - Assertions.assertEquals(FunctionName.COST, model.dataset().aggregation().get("qp").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("qp").function()); - Assertions.assertEquals("myhgfipnsxkmc", model.dataset().filter().and().get(0).dimensions().name()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-14T06:51:31Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T07:38:32Z"), model.timePeriod().to()); + Assertions.assertEquals(GranularityType.MONTHLY, model.dataset().granularity()); + Assertions.assertEquals("tmvcop", model.dataset().configuration().columns().get(0)); + Assertions.assertEquals(FunctionName.COST_USD, model.dataset().aggregation().get("yqltqsro").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("yqltqsro").function()); + Assertions.assertEquals("jtkbusqogsfika", model.dataset().filter().and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("krrjrea", model.dataset().filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("umh", model.dataset().filter().and().get(0).tags().name()); + Assertions.assertEquals("nsharujtjiqxfzyj", model.dataset().filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("uaucmf", model.dataset().filter().and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().and().get(0).tags().operator()); - Assertions.assertEquals("ikkx", model.dataset().filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("vuzlm", model.dataset().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("nlaxpunjqikcz", model.dataset().filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("zng", model.dataset().filter().or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("lfktgplcrpwjxe", model.dataset().filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("oi", model.dataset().filter().or().get(0).tags().name()); + Assertions.assertEquals("xxewu", model.dataset().filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ddm", model.dataset().filter().or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().or().get(0).tags().operator()); - Assertions.assertEquals("njwmwkpnbsazejj", model.dataset().filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("ugzxnf", model.dataset().filter().dimensions().name()); + Assertions.assertEquals("uytxzvtznapxban", model.dataset().filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("ahxku", model.dataset().filter().dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().dimensions().operator()); - Assertions.assertEquals("pxdtnkdmkq", model.dataset().filter().dimensions().values().get(0)); - Assertions.assertEquals("uaibrebqaaysj", model.dataset().filter().tags().name()); + Assertions.assertEquals("jcaacfdmmcpugm", model.dataset().filter().dimensions().values().get(0)); + Assertions.assertEquals("r", model.dataset().filter().tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().tags().operator()); - Assertions.assertEquals("qtnqtt", model.dataset().filter().tags().values().get(0)); - Assertions.assertEquals(true, model.includeActualCost()); - Assertions.assertEquals(false, model.includeFreshPartialCost()); + Assertions.assertEquals("ucsofldpuviyf", model.dataset().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeActualCost()); + Assertions.assertTrue(model.includeFreshPartialCost()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ForecastDefinition model - = new ForecastDefinition().withType(ForecastType.AMORTIZED_COST) + = new ForecastDefinition().withType(ForecastType.ACTUAL_COST) .withTimeframe(ForecastTimeframe.CUSTOM) - .withTimePeriod(new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-09-17T04:04:44Z")) - .withTo(OffsetDateTime.parse("2021-04-01T21:28:03Z"))) + .withTimePeriod(new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-01-14T06:51:31Z")) + .withTo(OffsetDateTime.parse("2021-09-29T07:38:32Z"))) .withDataset( - new ForecastDataset().withGranularity(GranularityType.DAILY) + new ForecastDataset().withGranularity(GranularityType.MONTHLY) .withConfiguration( - new ForecastDatasetConfiguration().withColumns(Arrays.asList("hyjsvfycx", "bfvoowvrv"))) - .withAggregation(mapOf("qp", - new ForecastAggregation().withName(FunctionName.COST).withFunction(FunctionType.SUM))) - .withFilter(new ForecastFilter() - .withAnd( - Arrays.asList(new ForecastFilter() - .withAnd( - Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("myhgfipnsxkmc") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("krrjrea", "xt"))) - .withTags(new ForecastComparisonExpression().withName("umh") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ikkx"))))) - .withOr(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("vuzlm") + new ForecastDatasetConfiguration().withColumns(Arrays.asList("tmvcop", "xcmjurbu"))) + .withAggregation( + mapOf("yqltqsro", + new ForecastAggregation().withName(FunctionName.COST_USD) + .withFunction(FunctionType.SUM), + "wkffdjkt", + new ForecastAggregation().withName(FunctionName.COST).withFunction(FunctionType.SUM), + "idfv", + new ForecastAggregation().withName(FunctionName.COST_USD) + .withFunction(FunctionType.SUM))) + .withFilter( + new ForecastFilter() + .withAnd(Arrays.asList( + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("jtkbusqogsfika") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("nsharujtjiqxfzyj", "ttvwkpqh", "penuy", + "bqeqqekewvnqvcd"))) + .withTags(new ForecastComparisonExpression() + .withName("uaucmf") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("nlaxpunjqikcz", "vitac"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("serxht") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("xhlw", "tsjgqrsx"))) + .withTags(new ForecastComparisonExpression() + .withName("ruuuybnch") + .withOperator(ForecastOperatorType.IN) + .withValues( + Arrays.asList("izoyuelyetndnbf", "yggagflnlgmt", "wahzjmucftbyr"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("pigqfusuckzmkw") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("noxaxmqeqal", "hjnhgwydyynfsvk", "gbv"))) + .withTags(new ForecastComparisonExpression().withName("anarfdlpukhpyrne") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("cpeogkhnmgbrou", "ddbhf", "pfpazjzoywjxhpdu"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("np") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("ehtuevrhr", "jyoogwxh", "sd", "ugwbsreurfqkf"))) + .withTags(new ForecastComparisonExpression().withName("renlvhhtklnvnafv") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("f", "devjb", "slcqxypokkh"))))) + .withOr(Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("zng") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("xxewu", "invudbch", "qdtvqecrqctmxx"))) + .withTags(new ForecastComparisonExpression().withName("ddm") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("uytxzvtznapxban", "o", "voxczytpr"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("ev") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("yo", "rrrouuxvnsa", "bcrymodizrx"))) + .withTags(new ForecastComparisonExpression().withName("obdxnazpmkmlm") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("f", "zopjhbzxliohr"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("xqbawpc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("zqcyknap", "ofyuicd"))) + .withTags(new ForecastComparisonExpression().withName("bd") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("wgbdvibidmhmwffp", "fmuvapckccr"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("xoy") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("phaimmoi"))) + .withTags(new ForecastComparisonExpression().withName("qboshbra") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("yyrmfsvbp", "vbopfppdbwnu"))))) + .withDimensions(new ForecastComparisonExpression().withName("ahxku") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("lfktgplcrpwjxe"))) - .withTags(new ForecastComparisonExpression().withName("oi") + .withValues(Arrays.asList("jcaacfdmmcpugm", "hqepvufhbzehewh", "qhnlbqnbld", + "eaclgschorimk"))) + .withTags(new ForecastComparisonExpression().withName("r") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("njwmwkpnbsazejj", "qkagfhsxt"))))) - .withDimensions(new ForecastComparisonExpression().withName("ugzxnf") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("pxdtnkdmkq", "jlwuenvrkp"))) - .withTags(new ForecastComparisonExpression().withName("uaibrebqaaysj") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("qtnqtt", "zlwfffiakp"))))) + .withValues(Arrays.asList("ucsofldpuviyf"))))) .withIncludeActualCost(true) - .withIncludeFreshPartialCost(false); + .withIncludeFreshPartialCost(true); model = BinaryData.fromObject(model).toObject(ForecastDefinition.class); - Assertions.assertEquals(ForecastType.AMORTIZED_COST, model.type()); + Assertions.assertEquals(ForecastType.ACTUAL_COST, model.type()); Assertions.assertEquals(ForecastTimeframe.CUSTOM, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T04:04:44Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-01T21:28:03Z"), model.timePeriod().to()); - Assertions.assertEquals(GranularityType.DAILY, model.dataset().granularity()); - Assertions.assertEquals("hyjsvfycx", model.dataset().configuration().columns().get(0)); - Assertions.assertEquals(FunctionName.COST, model.dataset().aggregation().get("qp").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("qp").function()); - Assertions.assertEquals("myhgfipnsxkmc", model.dataset().filter().and().get(0).dimensions().name()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-14T06:51:31Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T07:38:32Z"), model.timePeriod().to()); + Assertions.assertEquals(GranularityType.MONTHLY, model.dataset().granularity()); + Assertions.assertEquals("tmvcop", model.dataset().configuration().columns().get(0)); + Assertions.assertEquals(FunctionName.COST_USD, model.dataset().aggregation().get("yqltqsro").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("yqltqsro").function()); + Assertions.assertEquals("jtkbusqogsfika", model.dataset().filter().and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("krrjrea", model.dataset().filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("umh", model.dataset().filter().and().get(0).tags().name()); + Assertions.assertEquals("nsharujtjiqxfzyj", model.dataset().filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("uaucmf", model.dataset().filter().and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().and().get(0).tags().operator()); - Assertions.assertEquals("ikkx", model.dataset().filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("vuzlm", model.dataset().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("nlaxpunjqikcz", model.dataset().filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("zng", model.dataset().filter().or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("lfktgplcrpwjxe", model.dataset().filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("oi", model.dataset().filter().or().get(0).tags().name()); + Assertions.assertEquals("xxewu", model.dataset().filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ddm", model.dataset().filter().or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().or().get(0).tags().operator()); - Assertions.assertEquals("njwmwkpnbsazejj", model.dataset().filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("ugzxnf", model.dataset().filter().dimensions().name()); + Assertions.assertEquals("uytxzvtznapxban", model.dataset().filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("ahxku", model.dataset().filter().dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().dimensions().operator()); - Assertions.assertEquals("pxdtnkdmkq", model.dataset().filter().dimensions().values().get(0)); - Assertions.assertEquals("uaibrebqaaysj", model.dataset().filter().tags().name()); + Assertions.assertEquals("jcaacfdmmcpugm", model.dataset().filter().dimensions().values().get(0)); + Assertions.assertEquals("r", model.dataset().filter().tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dataset().filter().tags().operator()); - Assertions.assertEquals("qtnqtt", model.dataset().filter().tags().values().get(0)); - Assertions.assertEquals(true, model.includeActualCost()); - Assertions.assertEquals(false, model.includeFreshPartialCost()); + Assertions.assertEquals("ucsofldpuviyf", model.dataset().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeActualCost()); + Assertions.assertTrue(model.includeFreshPartialCost()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastFilterTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastFilterTests.java index 250f86936ae9..f8df20f777a5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastFilterTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastFilterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -15,465 +15,484 @@ public final class ForecastFilterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastFilter model = BinaryData.fromString( - "{\"and\":[{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"kx\",\"operator\":\"In\",\"values\":[\"hvbbxuripltfnh\",\"baxk\",\"xywr\"]},\"tags\":{\"name\":\"pyklyhpluodpvru\",\"operator\":\"In\",\"values\":[\"gzibthostgktstv\"]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"edqbc\",\"operator\":\"In\",\"values\":[\"lhpl\"]},\"tags\":{\"name\":\"qkdlw\",\"operator\":\"In\",\"values\":[\"bum\",\"kxtrq\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"btx\",\"operator\":\"In\",\"values\":[\"fwsrtawcoezbrhu\",\"skh\"]},\"tags\":{\"name\":\"ygo\",\"operator\":\"In\",\"values\":[\"kqfqjbvl\",\"orfmluiqt\",\"zf\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"qybaryeua\",\"operator\":\"In\",\"values\":[\"qabqgzslesjcb\"]},\"tags\":{\"name\":\"rnntiewdjcv\",\"operator\":\"In\",\"values\":[\"wr\",\"ehwagoh\",\"uffkmrqemvvh\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"tac\",\"operator\":\"In\",\"values\":[\"jvewzcjznmwcp\"]},\"tags\":{\"name\":\"uaadraufactkahzo\",\"operator\":\"In\",\"values\":[\"j\",\"iuxxpshneekulfg\",\"lqubkwdlen\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"jbazpjuohminy\",\"operator\":\"In\",\"values\":[\"orwmduvwpklv\",\"w\",\"ygdxpgpqchis\",\"epn\"]},\"tags\":{\"name\":\"jcrxgibbdaxcon\",\"operator\":\"In\",\"values\":[\"auorsukokw\",\"qplhlvnu\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"phwzsoldweyuqdu\",\"operator\":\"In\",\"values\":[\"nnrwrbiork\",\"alywjhhgdn\"]},\"tags\":{\"name\":\"msi\",\"operator\":\"In\",\"values\":[\"miloxggdufiqndie\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"chvcyyysfgdo\",\"operator\":\"In\",\"values\":[\"biipuip\",\"oqonma\",\"jeknizshq\",\"cimpevfg\"]},\"tags\":{\"name\":\"lrri\",\"operator\":\"In\",\"values\":[\"wdxsm\",\"ccwr\"]}}],\"dimensions\":{\"name\":\"scjfnyns\",\"operator\":\"In\",\"values\":[\"jizdvoqyt\"]},\"tags\":{\"name\":\"yo\",\"operator\":\"In\",\"values\":[\"lgy\",\"vutpthjoxo\",\"smsks\"]}},{\"and\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"jxkcgxxlxsff\",\"operator\":\"In\",\"values\":[\"izqzdwlvwlyou\",\"fgfb\"]},\"tags\":{\"name\":\"ubdyhgk\",\"operator\":\"In\",\"values\":[\"nsgowzfttst\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"actxtgzukxitm\",\"operator\":\"In\",\"values\":[\"gqqqxh\"]},\"tags\":{\"name\":\"xrxc\",\"operator\":\"In\",\"values\":[\"isavok\",\"dzf\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"l\",\"operator\":\"In\",\"values\":[\"ttbaj\",\"katnwxyi\"]},\"tags\":{\"name\":\"id\",\"operator\":\"In\",\"values\":[\"fku\",\"s\",\"xkdmligo\",\"ibrxkp\"]}}],\"dimensions\":{\"name\":\"oaz\",\"operator\":\"In\",\"values\":[\"ocbgoorbteoyb\"]},\"tags\":{\"name\":\"jxakv\",\"operator\":\"In\",\"values\":[\"slordilmyww\",\"kgkxn\",\"edabgyvudtjue\"]}}],\"or\":[{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"c\",\"operator\":\"In\",\"values\":[\"ccybvp\",\"yakk\"]},\"tags\":{\"name\":\"zp\",\"operator\":\"In\",\"values\":[\"jplmagstcy\",\"hpfkyrkdbdgi\"]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"nwqjnoba\",\"operator\":\"In\",\"values\":[\"ddviacegfnmntfpm\"]},\"tags\":{\"name\":\"emfnczdwvvbal\",\"operator\":\"In\",\"values\":[\"lchpodbzevwrdn\"]}},{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"sjcswsmystuluqyp\",\"operator\":\"In\",\"values\":[\"lerchpq\",\"mfpjbabw\",\"dfc\",\"sspuunnoxyhkx\"]},\"tags\":{\"name\":\"ddrihpf\",\"operator\":\"In\",\"values\":[\"caaewdao\",\"djvlpj\",\"xkzb\",\"msgeivsiykzk\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"onbzoggculapzwy\",\"operator\":\"In\",\"values\":[\"ogtqxepnylbf\",\"ajlyjtlvofqzhv\",\"cib\",\"fmo\"]},\"tags\":{\"name\":\"xrkjpvdw\",\"operator\":\"In\",\"values\":[\"wiivwzjbhyzsx\",\"rkambt\",\"negvmnvuqe\",\"vldspa\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"flvestmjlxrrilo\",\"operator\":\"In\",\"values\":[\"eewchpxlktw\",\"uziycsl\",\"vu\"]},\"tags\":{\"name\":\"ztcktyh\",\"operator\":\"In\",\"values\":[\"edcg\",\"ulwm\",\"rqzz\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"lydzgk\",\"operator\":\"In\",\"values\":[\"eevt\",\"epr\"]},\"tags\":{\"name\":\"t\",\"operator\":\"In\",\"values\":[\"tpzdmovzvfvaawzq\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ur\",\"operator\":\"In\",\"values\":[\"aecxndtic\",\"kpvzmlq\",\"mldgxobfirc\"]},\"tags\":{\"name\":\"pkc\",\"operator\":\"In\",\"values\":[\"zriykhy\",\"wf\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"qvkjlmxho\",\"operator\":\"In\",\"values\":[\"nhdwdigumbnra\",\"uzzptjazysdz\",\"ezwwv\"]},\"tags\":{\"name\":\"qyuvvfonkp\",\"operator\":\"In\",\"values\":[\"yik\",\"y\"]}}],\"dimensions\":{\"name\":\"uyav\",\"operator\":\"In\",\"values\":[\"mncsttijfybvp\"]},\"tags\":{\"name\":\"krsgsgb\",\"operator\":\"In\",\"values\":[\"zq\",\"njdgkynscliq\",\"zvhxnk\",\"mtk\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"dxzxhi\",\"operator\":\"In\",\"values\":[\"bbc\",\"vqagtltdhlf\"]},\"tags\":{\"name\":\"ojpykvgtrdc\",\"operator\":\"In\",\"values\":[\"mzzs\",\"ymbrnysuxmpraf\",\"g\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"vdff\",\"operator\":\"In\",\"values\":[\"fqroudas\"]},\"tags\":{\"name\":\"vehhrvkbunzozu\",\"operator\":\"In\",\"values\":[\"xg\",\"moy\",\"cdyuibhmfdnbzyd\",\"f\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"isrvhm\",\"operator\":\"In\",\"values\":[\"ffukiscvw\"]},\"tags\":{\"name\":\"hwplefaxvx\",\"operator\":\"In\",\"values\":[\"btgn\",\"nzeyqxtjj\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ycavodggxdbees\",\"operator\":\"In\",\"values\":[\"knlrariaawiuagy\",\"wqfbylyrfgiagt\"]},\"tags\":{\"name\":\"jocqwogfnzjvusf\",\"operator\":\"In\",\"values\":[\"mozuxylfsb\",\"kadpysown\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"grjqctojcmi\",\"operator\":\"In\",\"values\":[\"ieypef\",\"jy\",\"dh\",\"u\"]},\"tags\":{\"name\":\"cp\",\"operator\":\"In\",\"values\":[\"khihihlhzds\",\"tzbsrgnowcjhf\",\"mvec\",\"ctxmwoteyowcluq\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"gqouwifzmpj\",\"operator\":\"In\",\"values\":[\"vqikfxcvhrfsphu\",\"grttikteusqczk\",\"yklxubyjaffmmfbl\"]},\"tags\":{\"name\":\"cuubgq\",\"operator\":\"In\",\"values\":[\"talmett\",\"wgdsl\"]}}],\"dimensions\":{\"name\":\"ihhrmo\",\"operator\":\"In\",\"values\":[\"qseypxiutcxa\"]},\"tags\":{\"name\":\"hyrpetogebjoxs\",\"operator\":\"In\",\"values\":[\"nhl\"]}},{\"and\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"jcjbt\",\"operator\":\"In\",\"values\":[\"ehvvib\",\"xjjs\",\"oqbeitpkxzt\",\"oobklftidgfcwq\"]},\"tags\":{\"name\":\"imaq\",\"operator\":\"In\",\"values\":[\"em\",\"yhohujswtwkozzwc\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"pfajnjwltlwtjj\",\"operator\":\"In\",\"values\":[\"talhsnvkcdmxzr\",\"oaimlnw\",\"aaomylweazu\",\"cse\"]},\"tags\":{\"name\":\"wwnpj\",\"operator\":\"In\",\"values\":[\"zswpchwa\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"nfepgf\",\"operator\":\"In\",\"values\":[\"twly\",\"gncxykxhdj\",\"limmbcxf\"]},\"tags\":{\"name\":\"cporxvxcjz\",\"operator\":\"In\",\"values\":[\"zxfpxtgqsc\",\"avft\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"mtggu\",\"operator\":\"In\",\"values\":[\"jrajcivm\"]},\"tags\":{\"name\":\"hfcf\",\"operator\":\"In\",\"values\":[\"xgkn\",\"uvyinzqodfvpgs\"]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"bpfgzdj\",\"operator\":\"In\",\"values\":[\"zflbqvg\",\"qvlgafcqusrdvetn\"]},\"tags\":{\"name\":\"dtutnwldu\",\"operator\":\"In\",\"values\":[\"uzhyrmewipmvekdx\",\"kuqgsjjxundxgket\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"hfjmhvv\",\"operator\":\"In\",\"values\":[\"gpmuneqsxvmhfbuz\",\"yihsasbhudypohyu\"]},\"tags\":{\"name\":\"slynsqyrpfoo\",\"operator\":\"In\",\"values\":[\"ttymsjny\",\"qdnfwqzdz\"]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"hnfhqlyvijouwi\",\"operator\":\"In\",\"values\":[\"oyzunbixxr\",\"ikvcpwp\",\"clrcivtsox\"]},\"tags\":{\"name\":\"kenx\",\"operator\":\"In\",\"values\":[\"yefrpmpdnqqska\",\"ao\",\"vmm\",\"npqfrtqlkzmeg\"]}}],\"dimensions\":{\"name\":\"tgvkxlzyqd\",\"operator\":\"In\",\"values\":[\"gcealzxwh\"]},\"tags\":{\"name\":\"nsymoyqhlwigd\",\"operator\":\"In\",\"values\":[\"kbxgom\",\"ajuwas\",\"vdaeyyguxakjsq\"]}}],\"dimensions\":{\"name\":\"zbezkgimsidxasic\",\"operator\":\"In\",\"values\":[\"vvjskgfmocwahp\",\"gat\",\"eaahhvjhhn\"]},\"tags\":{\"name\":\"zybbj\",\"operator\":\"In\",\"values\":[\"jks\"]}}") + "{\"and\":[{\"and\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"f\",\"operator\":\"In\",\"values\":[\"ddpqt\",\"ehnmnaoyankco\"]},\"tags\":{\"name\":\"swankltytmh\",\"operator\":\"In\",\"values\":[\"znnhd\",\"lktgjc\",\"gguxhemlwyw\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ukklelss\",\"operator\":\"In\",\"values\":[\"ycsxzu\",\"ksrl\"]},\"tags\":{\"name\":\"desqplpvmjcdo\",\"operator\":\"In\",\"values\":[\"idyvteow\",\"vgp\"]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"fsxzecp\",\"operator\":\"In\",\"values\":[\"kufykhvu\",\"xepmrut\",\"nabaobnslujd\",\"ltymkmvguihywart\"]},\"tags\":{\"name\":\"phkixkykxdssjpe\",\"operator\":\"In\",\"values\":[\"cfxhikkflrmy\"]}}],\"dimensions\":{\"name\":\"incqlhriswsl\",\"operator\":\"In\",\"values\":[\"iov\",\"qcgxuug\",\"kctotiowlxteq\"]},\"tags\":{\"name\":\"tjgwdtguk\",\"operator\":\"In\",\"values\":[\"b\",\"wphqlkccuzgygqw\",\"hoi\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"rglvaw\",\"operator\":\"In\",\"values\":[\"d\"]},\"tags\":{\"name\":\"ypivlsbb\",\"operator\":\"In\",\"values\":[\"cubkmi\"]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"bvphavpm\",\"operator\":\"In\",\"values\":[\"bqgvgovpbbtte\",\"joknssqyzqedik\"]},\"tags\":{\"name\":\"rdbiqmrjge\",\"operator\":\"In\",\"values\":[\"qlggwfi\",\"zcxmjpbyep\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"rc\",\"operator\":\"In\",\"values\":[\"qipgx\"]},\"tags\":{\"name\":\"pomyqwcabvnuile\",\"operator\":\"In\",\"values\":[\"swlpaugmrmfj\",\"rxwtoaukhfkvc\"]}}],\"dimensions\":{\"name\":\"izmoaeds\",\"operator\":\"In\",\"values\":[\"uivedwcgyeewxeiq\",\"psmgo\"]},\"tags\":{\"name\":\"u\",\"operator\":\"In\",\"values\":[\"jdlrgmsplzgaufc\",\"hhvnewgnxkymp\",\"anxrj\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"oypnyg\",\"operator\":\"In\",\"values\":[\"xcy\",\"hkgmnsg\",\"pxycphdr\"]},\"tags\":{\"name\":\"jkhvyomacluzvxnq\",\"operator\":\"In\",\"values\":[\"pqpdfwmkoisqc\",\"sffxui\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"obkdqzrdzsyl\",\"operator\":\"In\",\"values\":[\"gtrczzydmxzjijpv\",\"aurkihcirlde\"]},\"tags\":{\"name\":\"rdcoxnbkkj\",\"operator\":\"In\",\"values\":[\"rnnqb\",\"q\",\"pizxqltgrdogyp\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"wuh\",\"operator\":\"In\",\"values\":[\"a\",\"s\",\"bxrblmliowxihspn\",\"wqagnepzwa\"]},\"tags\":{\"name\":\"sbs\",\"operator\":\"In\",\"values\":[\"qagwwrxaomz\",\"sgl\"]}}],\"dimensions\":{\"name\":\"czezkhhlt\",\"operator\":\"In\",\"values\":[\"dhqoawj\",\"oyueayfbpcmsp\"]},\"tags\":{\"name\":\"yrrueqth\",\"operator\":\"In\",\"values\":[\"nmbscbbx\",\"gdhxi\",\"d\",\"opedbwdpyqyybxub\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"wremjel\",\"operator\":\"In\",\"values\":[\"cigeleohdbvqvw\",\"kjopwbeon\"]},\"tags\":{\"name\":\"kwzdqybxcea\",\"operator\":\"In\",\"values\":[\"ptsoqfyiase\",\"chkrttzr\",\"zisgykiuemvanb\"]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"rx\",\"operator\":\"In\",\"values\":[\"ojklin\",\"mdptys\",\"rqsgnzx\",\"jp\"]},\"tags\":{\"name\":\"svjgpliufiqwoyxq\",\"operator\":\"In\",\"values\":[\"cohhoucqpqo\",\"xcxzrzdcgdzben\",\"ibcawetzqddtjw\",\"ljhznamtuatmzwcj\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"izvg\",\"operator\":\"In\",\"values\":[\"tzuuvb\",\"ngrebwg\"]},\"tags\":{\"name\":\"httzlswvajqfutlx\",\"operator\":\"In\",\"values\":[\"zasunwqrjzfrgq\",\"aohcmbuocn\",\"r\",\"hmbpyryxamebly\"]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"m\",\"operator\":\"In\",\"values\":[\"xne\",\"v\"]},\"tags\":{\"name\":\"tod\",\"operator\":\"In\",\"values\":[\"yapucygvoa\",\"yunssx\",\"ghiee\"]}}],\"dimensions\":{\"name\":\"lgvvpaseksgbu\",\"operator\":\"In\",\"values\":[\"tu\",\"gdhg\",\"qipir\",\"iwrqofulopmjnl\"]},\"tags\":{\"name\":\"whc\",\"operator\":\"In\",\"values\":[\"ibkeph\",\"uuerctatoyi\",\"tqpbrlcy\"]}}],\"or\":[{\"and\":[{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"y\",\"operator\":\"In\",\"values\":[\"uc\",\"crrpcjttbstvje\",\"qnrmvvfko\",\"mlghktuidvrmazlp\"]},\"tags\":{\"name\":\"wex\",\"operator\":\"In\",\"values\":[\"vlazipbhpwvqsgny\",\"uuzivensrpmeyyvp\",\"patlbijp\",\"gsksrfhf\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"bnxwc\",\"operator\":\"In\",\"values\":[\"mp\",\"fqawzfgbrttui\"]},\"tags\":{\"name\":\"lkiexhajlfnthiq\",\"operator\":\"In\",\"values\":[\"t\",\"diygbpvnwswmtxky\",\"twwgzwx\"]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"ygzyvneezaifght\",\"operator\":\"In\",\"values\":[\"qtlffhzbk\",\"kjj\",\"avfqnvhnqoewdogi\",\"etesypvidbztjhqt\"]},\"tags\":{\"name\":\"ovnynkbwetnju\",\"operator\":\"In\",\"values\":[\"prkzya\",\"piaccxnafb\",\"qroohtu\"]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"urjtumghi\",\"operator\":\"In\",\"values\":[\"ecmslclbl\"]},\"tags\":{\"name\":\"xltbsjuscvsf\",\"operator\":\"In\",\"values\":[\"ctmgxuupbezqccy\",\"rtceukdqkkyihzt\",\"eq\",\"gqzgwldoychill\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"uwaoaguhicqlli\",\"operator\":\"In\",\"values\":[\"ac\"]},\"tags\":{\"name\":\"vhrweftkwqejpmv\",\"operator\":\"In\",\"values\":[\"haep\",\"a\",\"cxtczhupeukn\"]}},{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"es\",\"operator\":\"In\",\"values\":[\"jfbocyvh\",\"ulrtywikdmh\"]},\"tags\":{\"name\":\"kuflgbh\",\"operator\":\"In\",\"values\":[\"acdixmx\",\"f\",\"sryjqgdkfno\"]}}],\"dimensions\":{\"name\":\"eoqbvjhvefgwbmqj\",\"operator\":\"In\",\"values\":[\"tasfaymxbulpzeal\",\"mqkyojwyvfkmbts\",\"ahxsgxjcmm\"]},\"tags\":{\"name\":\"rsc\",\"operator\":\"In\",\"values\":[\"wsdrnpxqwodif\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"uabwibvjogjo\",\"operator\":\"In\",\"values\":[\"yefoyzbamwineo\",\"vfkakpold\",\"vevboclzh\",\"jknyu\"]},\"tags\":{\"name\":\"vt\",\"operator\":\"In\",\"values\":[\"nrup\",\"a\",\"mrdixtreki\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"uffgllukkutvlx\",\"operator\":\"In\",\"values\":[\"qhvmblcouqe\",\"bhbcdszir\",\"randoypmb\",\"t\"]},\"tags\":{\"name\":\"rmkfqlwxldykals\",\"operator\":\"In\",\"values\":[\"olnjpnnbmjksibj\",\"sjjx\",\"ahmrnadzyqegxyi\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"hwbjijkgqxnhmbk\",\"operator\":\"In\",\"values\":[\"jauj\",\"aan\",\"ggiycwkdtaawxwf\"]},\"tags\":{\"name\":\"aumrrqmbzmqkrat\",\"operator\":\"In\",\"values\":[\"wbjsidbirkf\",\"kso\"]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"wijymr\",\"operator\":\"In\",\"values\":[\"u\",\"ozkyewnfnzh\",\"hqosmf\"]},\"tags\":{\"name\":\"kutycyarnroohgua\",\"operator\":\"In\",\"values\":[\"ghktdpy\",\"z\",\"coe\"]}}],\"dimensions\":{\"name\":\"nhzqrottjzcfy\",\"operator\":\"In\",\"values\":[\"twrlohapqin\"]},\"tags\":{\"name\":\"zpyglqdhmrj\",\"operator\":\"In\",\"values\":[\"l\",\"xpjb\",\"ypsjoq\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"qzvs\",\"operator\":\"In\",\"values\":[\"xj\",\"l\"]},\"tags\":{\"name\":\"mpzqjhhhq\",\"operator\":\"In\",\"values\":[\"yvca\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"izus\",\"operator\":\"In\",\"values\":[\"lbscmnlz\",\"jiu\",\"ehgmvflnwyv\"]},\"tags\":{\"name\":\"xrerlniylylyf\",\"operator\":\"In\",\"values\":[\"utgqztwh\",\"hmupgxyjtcdxabbu\",\"ftabenbbklqp\",\"zucafeddww\"]}}],\"dimensions\":{\"name\":\"z\",\"operator\":\"In\",\"values\":[\"xud\",\"nhgookrtalvnbw\"]},\"tags\":{\"name\":\"bemeluclvd\",\"operator\":\"In\",\"values\":[\"kyrdnqodx\",\"hhxhq\",\"aqnvzoqgyipemchg\",\"v\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"xptlghwzho\",\"operator\":\"In\",\"values\":[\"jjstliuhqawmo\",\"ia\",\"cz\"]},\"tags\":{\"name\":\"odrrslblxyd\",\"operator\":\"In\",\"values\":[\"xvv\",\"xiwkgfbql\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"chocokulehur\",\"operator\":\"In\",\"values\":[\"qffawey\",\"rkphyjdxr\",\"vjuqdbrxmrgchb\"]},\"tags\":{\"name\":\"xk\",\"operator\":\"In\",\"values\":[\"jjk\",\"ajb\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"ioycbl\",\"operator\":\"In\",\"values\":[\"mclujyxkyxlzgs\"]},\"tags\":{\"name\":\"kzzltafhbzf\",\"operator\":\"In\",\"values\":[\"wmbjlzqsczpg\",\"dwnapf\",\"qwowftptnuw\",\"tkschgcgqyhl\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"hvyeldotj\",\"operator\":\"In\",\"values\":[\"wiswskukjtasbvw\",\"spkxkdt\",\"fkndl\",\"vtwknvgmmbugt\"]},\"tags\":{\"name\":\"atmqaqkuea\",\"operator\":\"In\",\"values\":[\"oeshoygzcbyfq\",\"kfaoytehq\",\"uvjmv\"]}}],\"dimensions\":{\"name\":\"tdwckygr\",\"operator\":\"In\",\"values\":[\"n\"]},\"tags\":{\"name\":\"ljdjuskbrreqy\",\"operator\":\"In\",\"values\":[\"eysfaqegplw\",\"ysh\",\"ddkvbxgkqu\"]}}],\"dimensions\":{\"name\":\"bwptdacarvvlf\",\"operator\":\"In\",\"values\":[\"mt\",\"oiwenazerohzrsq\"]},\"tags\":{\"name\":\"sxkdnwqapfgsdpc\",\"operator\":\"In\",\"values\":[\"smzhhkuuipldqqct\",\"kva\",\"blhtjq\"]}}") .toObject(ForecastFilter.class); - Assertions.assertEquals("kx", model.and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("f", model.and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("hvbbxuripltfnh", model.and().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("pyklyhpluodpvru", model.and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("ddpqt", model.and().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("swankltytmh", model.and().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("gzibthostgktstv", model.and().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("tac", model.and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("znnhd", model.and().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("ukklelss", model.and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("jvewzcjznmwcp", model.and().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("uaadraufactkahzo", model.and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("ycsxzu", model.and().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("desqplpvmjcdo", model.and().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("j", model.and().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("scjfnyns", model.and().get(0).dimensions().name()); + Assertions.assertEquals("idyvteow", model.and().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("incqlhriswsl", model.and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).dimensions().operator()); - Assertions.assertEquals("jizdvoqyt", model.and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("yo", model.and().get(0).tags().name()); + Assertions.assertEquals("iov", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("tjgwdtguk", model.and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).tags().operator()); - Assertions.assertEquals("lgy", model.and().get(0).tags().values().get(0)); - Assertions.assertEquals("c", model.or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("b", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("y", model.or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("ccybvp", model.or().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("zp", model.or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("uc", model.or().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("wex", model.or().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("jplmagstcy", model.or().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("flvestmjlxrrilo", model.or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("vlazipbhpwvqsgny", model.or().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("ygzyvneezaifght", model.or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("eewchpxlktw", model.or().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("ztcktyh", model.or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("qtlffhzbk", model.or().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ovnynkbwetnju", model.or().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("edcg", model.or().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("uyav", model.or().get(0).dimensions().name()); + Assertions.assertEquals("prkzya", model.or().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("eoqbvjhvefgwbmqj", model.or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).dimensions().operator()); - Assertions.assertEquals("mncsttijfybvp", model.or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("krsgsgb", model.or().get(0).tags().name()); + Assertions.assertEquals("tasfaymxbulpzeal", model.or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("rsc", model.or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).tags().operator()); - Assertions.assertEquals("zq", model.or().get(0).tags().values().get(0)); - Assertions.assertEquals("zbezkgimsidxasic", model.dimensions().name()); + Assertions.assertEquals("wsdrnpxqwodif", model.or().get(0).tags().values().get(0)); + Assertions.assertEquals("bwptdacarvvlf", model.dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dimensions().operator()); - Assertions.assertEquals("vvjskgfmocwahp", model.dimensions().values().get(0)); - Assertions.assertEquals("zybbj", model.tags().name()); + Assertions.assertEquals("mt", model.dimensions().values().get(0)); + Assertions.assertEquals("sxkdnwqapfgsdpc", model.tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.tags().operator()); - Assertions.assertEquals("jks", model.tags().values().get(0)); + Assertions.assertEquals("smzhhkuuipldqqct", model.tags().values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForecastFilter model = new ForecastFilter() - .withAnd(Arrays.asList( - new ForecastFilter() - .withAnd(Arrays.asList( - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("kx") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("hvbbxuripltfnh", "baxk", "xywr"))) - .withTags(new ForecastComparisonExpression().withName("pyklyhpluodpvru") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("gzibthostgktstv"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("edqbc") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("lhpl"))) - .withTags(new ForecastComparisonExpression().withName("qkdlw") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("bum", "kxtrq"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("btx") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("fwsrtawcoezbrhu", "skh"))) - .withTags(new ForecastComparisonExpression().withName("ygo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("kqfqjbvl", "orfmluiqt", "zf"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("qybaryeua") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("qabqgzslesjcb"))) - .withTags(new ForecastComparisonExpression().withName("rnntiewdjcv") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("wr", "ehwagoh", "uffkmrqemvvh"))))) - .withOr(Arrays.asList( - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("tac") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("jvewzcjznmwcp"))) - .withTags(new ForecastComparisonExpression().withName("uaadraufactkahzo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("j", "iuxxpshneekulfg", "lqubkwdlen"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("jbazpjuohminy") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("orwmduvwpklv", "w", "ygdxpgpqchis", "epn"))) - .withTags(new ForecastComparisonExpression().withName("jcrxgibbdaxcon") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("auorsukokw", "qplhlvnu"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("phwzsoldweyuqdu") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("nnrwrbiork", "alywjhhgdn"))) - .withTags(new ForecastComparisonExpression().withName("msi") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("miloxggdufiqndie"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("chvcyyysfgdo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("biipuip", "oqonma", "jeknizshq", "cimpevfg"))) - .withTags(new ForecastComparisonExpression().withName("lrri") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("wdxsm", "ccwr"))))) - .withDimensions(new ForecastComparisonExpression().withName("scjfnyns") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("jizdvoqyt"))) - .withTags(new ForecastComparisonExpression().withName("yo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("lgy", "vutpthjoxo", "smsks"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("jxkcgxxlxsff") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("izqzdwlvwlyou", "fgfb"))) - .withTags(new ForecastComparisonExpression().withName("ubdyhgk") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("nsgowzfttst"))))) - .withOr(Arrays.asList( - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("actxtgzukxitm") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("gqqqxh"))) - .withTags(new ForecastComparisonExpression().withName("xrxc") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("isavok", "dzf"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("l") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ttbaj", "katnwxyi"))) - .withTags(new ForecastComparisonExpression().withName("id") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("fku", "s", "xkdmligo", "ibrxkp"))))) - .withDimensions(new ForecastComparisonExpression().withName("oaz") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ocbgoorbteoyb"))) - .withTags(new ForecastComparisonExpression().withName("jxakv") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("slordilmyww", "kgkxn", "edabgyvudtjue"))))) - .withOr( - Arrays - .asList( - new ForecastFilter() - .withAnd( - Arrays.asList( + ForecastFilter model + = new ForecastFilter() + .withAnd( + Arrays + .asList( + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("f") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("ddpqt", "ehnmnaoyankco"))) + .withTags(new ForecastComparisonExpression().withName("swankltytmh") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("znnhd", "lktgjc", "gguxhemlwyw"))))) + .withOr( + Arrays + .asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("ukklelss") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("ycsxzu", "ksrl"))) + .withTags(new ForecastComparisonExpression().withName("desqplpvmjcdo") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("idyvteow", "vgp"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("fsxzecp") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("kufykhvu", "xepmrut", "nabaobnslujd", + "ltymkmvguihywart"))) + .withTags(new ForecastComparisonExpression().withName("phkixkykxdssjpe") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("cfxhikkflrmy"))))) + .withDimensions(new ForecastComparisonExpression().withName("incqlhriswsl") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("iov", "qcgxuug", "kctotiowlxteq"))) + .withTags(new ForecastComparisonExpression().withName("tjgwdtguk") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("b", "wphqlkccuzgygqw", "hoi"))), + new ForecastFilter() + .withAnd(Arrays.asList( new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("c") + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("rglvaw") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ccybvp", "yakk"))) - .withTags(new ForecastComparisonExpression().withName("zp") + .withValues(Arrays.asList("d"))) + .withTags(new ForecastComparisonExpression() + .withName("ypivlsbb") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("jplmagstcy", "hpfkyrkdbdgi"))), + .withValues(Arrays.asList("cubkmi"))), + new ForecastFilter() + .withAnd(Arrays + .asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("bvphavpm") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("bqgvgovpbbtte", "joknssqyzqedik"))) + .withTags(new ForecastComparisonExpression().withName("rdbiqmrjge") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("qlggwfi", "zcxmjpbyep"))))) + .withOr(Arrays.asList(new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("rc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("qipgx"))) + .withTags(new ForecastComparisonExpression().withName("pomyqwcabvnuile") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("swlpaugmrmfj", "rxwtoaukhfkvc"))))) + .withDimensions(new ForecastComparisonExpression().withName("izmoaeds") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("uivedwcgyeewxeiq", "psmgo"))) + .withTags(new ForecastComparisonExpression() + .withName("u") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("jdlrgmsplzgaufc", "hhvnewgnxkymp", "anxrj"))), + new ForecastFilter() + .withAnd(Arrays.asList( new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("nwqjnoba") + .withDimensions(new ForecastComparisonExpression().withName("oypnyg") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ddviacegfnmntfpm"))) - .withTags(new ForecastComparisonExpression().withName("emfnczdwvvbal") + .withValues(Arrays.asList("xcy", "hkgmnsg", "pxycphdr"))) + .withTags(new ForecastComparisonExpression() + .withName("jkhvyomacluzvxnq") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("lchpodbzevwrdn"))), + .withValues(Arrays.asList("pqpdfwmkoisqc", "sffxui"))), new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("sjcswsmystuluqyp") + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("obkdqzrdzsyl") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("lerchpq", "mfpjbabw", "dfc", "sspuunnoxyhkx"))) - .withTags(new ForecastComparisonExpression() - .withName("ddrihpf") + .withValues(Arrays.asList("gtrczzydmxzjijpv", "aurkihcirlde"))) + .withTags(new ForecastComparisonExpression().withName("rdcoxnbkkj") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("caaewdao", "djvlpj", "xkzb", "msgeivsiykzk"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withValues(Arrays.asList("rnnqb", "q", "pizxqltgrdogyp"))))) + .withOr( + Arrays + .asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("wuh") + .withOperator(ForecastOperatorType.IN) + .withValues( + Arrays.asList("a", "s", "bxrblmliowxihspn", "wqagnepzwa"))) + .withTags(new ForecastComparisonExpression().withName("sbs") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("qagwwrxaomz", "sgl"))))) + .withDimensions(new ForecastComparisonExpression().withName("czezkhhlt") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("dhqoawj", "oyueayfbpcmsp"))) + .withTags(new ForecastComparisonExpression().withName("yrrueqth") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("nmbscbbx", "gdhxi", "d", "opedbwdpyqyybxub"))), + new ForecastFilter() + .withAnd(Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("onbzoggculapzwy") + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression() + .withName("wremjel") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ogtqxepnylbf", "ajlyjtlvofqzhv", "cib", "fmo"))) - .withTags(new ForecastComparisonExpression().withName("xrkjpvdw") + .withValues(Arrays.asList("cigeleohdbvqvw", "kjopwbeon"))) + .withTags(new ForecastComparisonExpression().withName("kwzdqybxcea") .withOperator(ForecastOperatorType.IN) - .withValues( - Arrays.asList("wiivwzjbhyzsx", "rkambt", "negvmnvuqe", "vldspa"))))) - .withOr(Arrays.asList( - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("flvestmjlxrrilo") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("eewchpxlktw", "uziycsl", "vu"))) - .withTags(new ForecastComparisonExpression() - .withName("ztcktyh") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("edcg", "ulwm", "rqzz"))), - new ForecastFilter() - .withAnd( - Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("lydzgk") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("eevt", "epr"))) - .withTags(new ForecastComparisonExpression().withName("t") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("tpzdmovzvfvaawzq"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("ur") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("aecxndtic", "kpvzmlq", "mldgxobfirc"))) - .withTags(new ForecastComparisonExpression() - .withName("pkc") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("zriykhy", "wf"))), - new ForecastFilter() - .withAnd( - Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("qvkjlmxho") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("nhdwdigumbnra", "uzzptjazysdz", "ezwwv"))) - .withTags(new ForecastComparisonExpression().withName("qyuvvfonkp") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("yik", "y"))))) - .withDimensions(new ForecastComparisonExpression() - .withName("uyav") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("mncsttijfybvp"))) - .withTags(new ForecastComparisonExpression().withName("krsgsgb") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("zq", "njdgkynscliq", "zvhxnk", "mtk"))), - new ForecastFilter() - .withAnd(Arrays.asList( - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("dxzxhi") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("bbc", "vqagtltdhlf"))) - .withTags(new ForecastComparisonExpression().withName("ojpykvgtrdc") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("mzzs", "ymbrnysuxmpraf", "g"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("vdff") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("fqroudas"))) - .withTags(new ForecastComparisonExpression().withName("vehhrvkbunzozu") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("xg", "moy", "cdyuibhmfdnbzyd", "f"))))) - .withOr( - Arrays.asList( + .withValues(Arrays.asList("ptsoqfyiase", "chkrttzr", "zisgykiuemvanb"))), new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("isrvhm") + .withDimensions(new ForecastComparisonExpression().withName("rx") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ffukiscvw"))) - .withTags(new ForecastComparisonExpression() - .withName("hwplefaxvx") + .withValues(Arrays.asList("ojklin", "mdptys", "rqsgnzx", "jp"))) + .withTags(new ForecastComparisonExpression().withName("svjgpliufiqwoyxq") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("btgn", "nzeyqxtjj"))), + .withValues(Arrays.asList("cohhoucqpqo", "xcxzrzdcgdzben", "ibcawetzqddtjw", + "ljhznamtuatmzwcj"))))) + .withOr( + Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("izvg") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("tzuuvb", "ngrebwg"))) + .withTags(new ForecastComparisonExpression().withName("httzlswvajqfutlx") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("zasunwqrjzfrgq", "aohcmbuocn", "r", + "hmbpyryxamebly"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("m") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("xne", "v"))) + .withTags(new ForecastComparisonExpression().withName("tod") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("yapucygvoa", "yunssx", "ghiee"))))) + .withDimensions(new ForecastComparisonExpression().withName("lgvvpaseksgbu") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("tu", "gdhg", "qipir", "iwrqofulopmjnl"))) + .withTags(new ForecastComparisonExpression() + .withName("whc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("ibkeph", "uuerctatoyi", "tqpbrlcy"))))) + .withOr(Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList( + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("y") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("uc", "crrpcjttbstvje", "qnrmvvfko", "mlghktuidvrmazlp"))) + .withTags(new ForecastComparisonExpression() + .withName("wex") + .withOperator(ForecastOperatorType.IN) + .withValues( + Arrays.asList("vlazipbhpwvqsgny", "uuzivensrpmeyyvp", "patlbijp", "gsksrfhf"))), + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("bnxwc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("mp", "fqawzfgbrttui"))) + .withTags(new ForecastComparisonExpression().withName("lkiexhajlfnthiq") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("t", "diygbpvnwswmtxky", "twwgzwx"))))) + .withOr( + Arrays + .asList( new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("ygzyvneezaifght") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("qtlffhzbk", "kjj", "avfqnvhnqoewdogi", + "etesypvidbztjhqt"))) + .withTags(new ForecastComparisonExpression().withName("ovnynkbwetnju") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("prkzya", "piaccxnafb", "qroohtu"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("ycavodggxdbees") + .withDimensions(new ForecastComparisonExpression().withName("urjtumghi") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("knlrariaawiuagy", "wqfbylyrfgiagt"))) + .withValues(Arrays.asList("ecmslclbl"))) .withTags(new ForecastComparisonExpression() - .withName("jocqwogfnzjvusf") + .withName("xltbsjuscvsf") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("mozuxylfsb", "kadpysown"))), + .withValues(Arrays.asList("ctmgxuupbezqccy", "rtceukdqkkyihzt", "eq", + "gqzgwldoychill"))), new ForecastFilter() .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("grjqctojcmi") + .withDimensions(new ForecastComparisonExpression().withName("uwaoaguhicqlli") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ieypef", "jy", "dh", "u"))) - .withTags(new ForecastComparisonExpression() - .withName("cp") + .withValues(Arrays.asList("ac"))) + .withTags(new ForecastComparisonExpression().withName("vhrweftkwqejpmv") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("khihihlhzds", "tzbsrgnowcjhf", "mvec", - "ctxmwoteyowcluq"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withValues(Arrays.asList("haep", "a", "cxtczhupeukn"))), + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) .withDimensions( - new ForecastComparisonExpression().withName("gqouwifzmpj") + new ForecastComparisonExpression().withName("es") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("vqikfxcvhrfsphu", "grttikteusqczk", - "yklxubyjaffmmfbl"))) - .withTags(new ForecastComparisonExpression().withName("cuubgq") + .withValues(Arrays.asList("jfbocyvh", "ulrtywikdmh"))) + .withTags(new ForecastComparisonExpression().withName("kuflgbh") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("talmett", "wgdsl"))))) - .withDimensions(new ForecastComparisonExpression().withName("ihhrmo") + .withValues(Arrays.asList("acdixmx", "f", "sryjqgdkfno"))))) + .withDimensions(new ForecastComparisonExpression().withName("eoqbvjhvefgwbmqj") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("tasfaymxbulpzeal", "mqkyojwyvfkmbts", "ahxsgxjcmm"))) + .withTags(new ForecastComparisonExpression().withName("rsc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("wsdrnpxqwodif"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("uabwibvjogjo") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("qseypxiutcxa"))) - .withTags(new ForecastComparisonExpression().withName("hyrpetogebjoxs") + .withValues(Arrays.asList("yefoyzbamwineo", "vfkakpold", "vevboclzh", "jknyu"))) + .withTags(new ForecastComparisonExpression().withName("vt") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("nhl"))), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("jcjbt") + .withValues(Arrays.asList("nrup", "a", "mrdixtreki"))))) + .withOr(Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("uffgllukkutvlx") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ehvvib", "xjjs", "oqbeitpkxzt", "oobklftidgfcwq"))) - .withTags(new ForecastComparisonExpression().withName("imaq") + .withValues(Arrays.asList("qhvmblcouqe", "bhbcdszir", "randoypmb", "t"))) + .withTags(new ForecastComparisonExpression().withName("rmkfqlwxldykals") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("em", "yhohujswtwkozzwc"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("pfajnjwltlwtjj") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("talhsnvkcdmxzr", "oaimlnw", "aaomylweazu", "cse"))) - .withTags( - new ForecastComparisonExpression().withName("wwnpj") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("zswpchwa"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr( - Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("nfepgf") + .withValues(Arrays.asList("olnjpnnbmjksibj", "sjjx", "ahmrnadzyqegxyi"))), + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("hwbjijkgqxnhmbk") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("jauj", "aan", "ggiycwkdtaawxwf"))) + .withTags(new ForecastComparisonExpression().withName("aumrrqmbzmqkrat") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("wbjsidbirkf", "kso"))), + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("wijymr") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("u", "ozkyewnfnzh", "hqosmf"))) + .withTags(new ForecastComparisonExpression().withName("kutycyarnroohgua") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("ghktdpy", "z", "coe"))))) + .withDimensions(new ForecastComparisonExpression().withName("nhzqrottjzcfy") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("twrlohapqin"))) + .withTags(new ForecastComparisonExpression().withName("zpyglqdhmrj") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("l", "xpjb", "ypsjoq"))), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("qzvs") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("xj", "l"))) + .withTags(new ForecastComparisonExpression().withName("mpzqjhhhq") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("yvca"))))) + .withOr( + Arrays + .asList(new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("izus") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("twly", "gncxykxhdj", "limmbcxf"))) - .withTags(new ForecastComparisonExpression() - .withName("cporxvxcjz") + .withValues(Arrays.asList("lbscmnlz", "jiu", "ehgmvflnwyv"))) + .withTags(new ForecastComparisonExpression().withName("xrerlniylylyf") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("zxfpxtgqsc", "avft"))))) - .withOr(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("mtggu") + .withValues(Arrays.asList("utgqztwh", "hmupgxyjtcdxabbu", "ftabenbbklqp", + "zucafeddww"))))) + .withDimensions(new ForecastComparisonExpression().withName("z") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("xud", "nhgookrtalvnbw"))) + .withTags(new ForecastComparisonExpression() + .withName("bemeluclvd") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("kyrdnqodx", "hhxhq", "aqnvzoqgyipemchg", "v"))), + new ForecastFilter() + .withAnd(Arrays.asList( + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("xptlghwzho") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("jrajcivm"))) + .withValues(Arrays.asList("jjstliuhqawmo", "ia", "cz"))) .withTags(new ForecastComparisonExpression() - .withName("hfcf") + .withName("odrrslblxyd") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("xgkn", "uvyinzqodfvpgs"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr( - Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("bpfgzdj") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("zflbqvg", "qvlgafcqusrdvetn"))) - .withTags( - new ForecastComparisonExpression().withName("dtutnwldu") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("uzhyrmewipmvekdx", "kuqgsjjxundxgket"))), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr( - Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("hfjmhvv") + .withValues(Arrays.asList("xvv", "xiwkgfbql"))), + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("chocokulehur") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("qffawey", "rkphyjdxr", "vjuqdbrxmrgchb"))) + .withTags(new ForecastComparisonExpression().withName("xk") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("jjk", "ajb"))))) + .withOr( + Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("ioycbl") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("gpmuneqsxvmhfbuz", "yihsasbhudypohyu"))) - .withTags(new ForecastComparisonExpression().withName("slynsqyrpfoo") + .withValues(Arrays.asList("mclujyxkyxlzgs"))) + .withTags(new ForecastComparisonExpression().withName("kzzltafhbzf") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ttymsjny", "qdnfwqzdz"))), + .withValues(Arrays.asList("wmbjlzqsczpg", "dwnapf", "qwowftptnuw", + "tkschgcgqyhl"))), new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("hnfhqlyvijouwi") + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("hvyeldotj") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("oyzunbixxr", "ikvcpwp", "clrcivtsox"))) - .withTags(new ForecastComparisonExpression().withName("kenx") + .withValues( + Arrays.asList("wiswskukjtasbvw", "spkxkdt", "fkndl", "vtwknvgmmbugt"))) + .withTags(new ForecastComparisonExpression().withName("atmqaqkuea") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("yefrpmpdnqqska", "ao", "vmm", "npqfrtqlkzmeg"))))) - .withDimensions(new ForecastComparisonExpression().withName("tgvkxlzyqd") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("gcealzxwh"))) - .withTags(new ForecastComparisonExpression().withName("nsymoyqhlwigd") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("kbxgom", "ajuwas", "vdaeyyguxakjsq"))))) - .withDimensions(new ForecastComparisonExpression().withName("zbezkgimsidxasic") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("vvjskgfmocwahp", "gat", "eaahhvjhhn"))) - .withTags(new ForecastComparisonExpression().withName("zybbj") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("jks"))); + .withValues(Arrays.asList("oeshoygzcbyfq", "kfaoytehq", "uvjmv"))))) + .withDimensions(new ForecastComparisonExpression().withName("tdwckygr") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("n"))) + .withTags(new ForecastComparisonExpression().withName("ljdjuskbrreqy") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("eysfaqegplw", "ysh", "ddkvbxgkqu"))))) + .withDimensions(new ForecastComparisonExpression().withName("bwptdacarvvlf") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("mt", "oiwenazerohzrsq"))) + .withTags(new ForecastComparisonExpression().withName("sxkdnwqapfgsdpc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("smzhhkuuipldqqct", "kva", "blhtjq"))); model = BinaryData.fromObject(model).toObject(ForecastFilter.class); - Assertions.assertEquals("kx", model.and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("f", model.and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("hvbbxuripltfnh", model.and().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("pyklyhpluodpvru", model.and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("ddpqt", model.and().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("swankltytmh", model.and().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("gzibthostgktstv", model.and().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("tac", model.and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("znnhd", model.and().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("ukklelss", model.and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("jvewzcjznmwcp", model.and().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("uaadraufactkahzo", model.and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("ycsxzu", model.and().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("desqplpvmjcdo", model.and().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("j", model.and().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("scjfnyns", model.and().get(0).dimensions().name()); + Assertions.assertEquals("idyvteow", model.and().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("incqlhriswsl", model.and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).dimensions().operator()); - Assertions.assertEquals("jizdvoqyt", model.and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("yo", model.and().get(0).tags().name()); + Assertions.assertEquals("iov", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("tjgwdtguk", model.and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.and().get(0).tags().operator()); - Assertions.assertEquals("lgy", model.and().get(0).tags().values().get(0)); - Assertions.assertEquals("c", model.or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("b", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("y", model.or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("ccybvp", model.or().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("zp", model.or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("uc", model.or().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("wex", model.or().get(0).and().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("jplmagstcy", model.or().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("flvestmjlxrrilo", model.or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("vlazipbhpwvqsgny", model.or().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("ygzyvneezaifght", model.or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("eewchpxlktw", model.or().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("ztcktyh", model.or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("qtlffhzbk", model.or().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ovnynkbwetnju", model.or().get(0).or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("edcg", model.or().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("uyav", model.or().get(0).dimensions().name()); + Assertions.assertEquals("prkzya", model.or().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("eoqbvjhvefgwbmqj", model.or().get(0).dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).dimensions().operator()); - Assertions.assertEquals("mncsttijfybvp", model.or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("krsgsgb", model.or().get(0).tags().name()); + Assertions.assertEquals("tasfaymxbulpzeal", model.or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("rsc", model.or().get(0).tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.or().get(0).tags().operator()); - Assertions.assertEquals("zq", model.or().get(0).tags().values().get(0)); - Assertions.assertEquals("zbezkgimsidxasic", model.dimensions().name()); + Assertions.assertEquals("wsdrnpxqwodif", model.or().get(0).tags().values().get(0)); + Assertions.assertEquals("bwptdacarvvlf", model.dimensions().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.dimensions().operator()); - Assertions.assertEquals("vvjskgfmocwahp", model.dimensions().values().get(0)); - Assertions.assertEquals("zybbj", model.tags().name()); + Assertions.assertEquals("mt", model.dimensions().values().get(0)); + Assertions.assertEquals("sxkdnwqapfgsdpc", model.tags().name()); Assertions.assertEquals(ForecastOperatorType.IN, model.tags().operator()); - Assertions.assertEquals("jks", model.tags().values().get(0)); + Assertions.assertEquals("smzhhkuuipldqqct", model.tags().values().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastPropertiesTests.java index 948baec11dc5..2ed1fd88ed3d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastPropertiesTests.java @@ -1,39 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.ForecastProperties; -import com.azure.resourcemanager.costmanagement.models.ForecastColumn; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ForecastPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastProperties model = BinaryData.fromString( - "{\"nextLink\":\"es\",\"columns\":[{\"name\":\"pagzrcxfailcfxwm\",\"type\":\"oxdfgsftu\"},{\"name\":\"obrjlnacgcc\",\"type\":\"nhxk\"},{\"name\":\"v\",\"type\":\"nrzvuljraaer\"},{\"name\":\"okqgukkjq\",\"type\":\"broyla\"}],\"rows\":[[\"datacdisd\",\"datasfjbjsvg\"],[\"datawhryvycytdcl\",\"datagc\",\"dataknfnwmbtmvpdv\"],[\"datahttz\",\"dataefedxihchrphkm\",\"datarjdqnsdfzp\",\"datagtgkylkdghr\"]]}") + "{\"nextLink\":\"gfsetzlexbsfled\",\"columns\":[{\"name\":\"pziuwfbzkkdtnh\",\"type\":\"ycljselpkpbaf\"},{\"name\":\"fhlbylccbev\",\"type\":\"hyzdfwrs\"},{\"name\":\"pl\",\"type\":\"bmairrhvhfnracwn\"}],\"rows\":[[\"\\\"datatuujwouh\\\"\"],[\"\\\"datawsigrbjbxsj\\\"\",\"\\\"databvitvqkjya\\\"\",\"\\\"datanu\\\"\"]]}") .toObject(ForecastProperties.class); - Assertions.assertEquals("es", model.nextLink()); - Assertions.assertEquals("pagzrcxfailcfxwm", model.columns().get(0).name()); - Assertions.assertEquals("oxdfgsftu", model.columns().get(0).type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastProperties model = new ForecastProperties().withNextLink("es") - .withColumns(Arrays.asList(new ForecastColumn().withName("pagzrcxfailcfxwm").withType("oxdfgsftu"), - new ForecastColumn().withName("obrjlnacgcc").withType("nhxk"), - new ForecastColumn().withName("v").withType("nrzvuljraaer"), - new ForecastColumn().withName("okqgukkjq").withType("broyla"))) - .withRows(Arrays.asList(Arrays.asList("datacdisd", "datasfjbjsvg"), - Arrays.asList("datawhryvycytdcl", "datagc", "dataknfnwmbtmvpdv"), - Arrays.asList("datahttz", "dataefedxihchrphkm", "datarjdqnsdfzp", "datagtgkylkdghr"))); - model = BinaryData.fromObject(model).toObject(ForecastProperties.class); - Assertions.assertEquals("es", model.nextLink()); - Assertions.assertEquals("pagzrcxfailcfxwm", model.columns().get(0).name()); - Assertions.assertEquals("oxdfgsftu", model.columns().get(0).type()); + Assertions.assertEquals("gfsetzlexbsfled", model.nextLink()); + Assertions.assertEquals("pziuwfbzkkdtnh", model.columns().get(0).name()); + Assertions.assertEquals("ycljselpkpbaf", model.columns().get(0).type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastResultInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastResultInnerTests.java index f3bf8493e76d..cb57a2f16c46 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastResultInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastResultInnerTests.java @@ -1,54 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.ForecastResultInner; -import com.azure.resourcemanager.costmanagement.models.ForecastColumn; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ForecastResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastResultInner model = BinaryData.fromString( - "{\"properties\":{\"nextLink\":\"klnsrmffey\",\"columns\":[{\"name\":\"tpiymerteea\",\"type\":\"xqiekkkzddrtk\"}],\"rows\":[[\"databmxva\",\"datarefdee\",\"datavecuijpx\"],[\"datas\"]]},\"sku\":\"prtujwsawdd\",\"eTag\":\"babxvitit\",\"location\":\"tzeexav\",\"tags\":{\"pqtgsfjac\":\"fglecdmdqbwp\",\"d\":\"slhhxudbxv\"},\"id\":\"tnsi\",\"name\":\"ud\",\"type\":\"z\"}") + "{\"properties\":{\"nextLink\":\"zzy\",\"columns\":[{\"name\":\"sxivzrrryvei\",\"type\":\"pskdyzatvfuzk\"},{\"name\":\"tjvv\",\"type\":\"xwigsye\"}],\"rows\":[[\"\\\"datasmjtgrqgdg\\\"\",\"\\\"datakileplkcsmknhwtb\\\"\"],[\"\\\"dataedorvvmq\\\"\",\"\\\"dataloyg\\\"\",\"\\\"datadgwumgxdgdhp\\\"\"]]},\"id\":\"gdexjd\",\"name\":\"jsaqwotmmwllcols\",\"type\":\"xaptefhexcgjok\",\"location\":\"jnhvlqjbekpeeks\",\"sku\":\"ksdqhjvy\",\"eTag\":\"xeslkhhustcpoqm\",\"tags\":{\"lejjjkxy\":\"wqjwgok\",\"kjbztensvkzykj\":\"wfd\",\"hcdpkupnqrmgj\":\"jknsxfwu\"}}") .toObject(ForecastResultInner.class); - Assertions.assertEquals("tzeexav", model.location()); - Assertions.assertEquals("fglecdmdqbwp", model.tags().get("pqtgsfjac")); - Assertions.assertEquals("klnsrmffey", model.nextLink()); - Assertions.assertEquals("tpiymerteea", model.columns().get(0).name()); - Assertions.assertEquals("xqiekkkzddrtk", model.columns().get(0).type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastResultInner model = new ForecastResultInner().withLocation("tzeexav") - .withTags(mapOf("pqtgsfjac", "fglecdmdqbwp", "d", "slhhxudbxv")) - .withNextLink("klnsrmffey") - .withColumns(Arrays.asList(new ForecastColumn().withName("tpiymerteea").withType("xqiekkkzddrtk"))) - .withRows(Arrays.asList(Arrays.asList("databmxva", "datarefdee", "datavecuijpx"), Arrays.asList("datas"))); - model = BinaryData.fromObject(model).toObject(ForecastResultInner.class); - Assertions.assertEquals("tzeexav", model.location()); - Assertions.assertEquals("fglecdmdqbwp", model.tags().get("pqtgsfjac")); - Assertions.assertEquals("klnsrmffey", model.nextLink()); - Assertions.assertEquals("tpiymerteea", model.columns().get(0).name()); - Assertions.assertEquals("xqiekkkzddrtk", model.columns().get(0).type()); - } - - // 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; + Assertions.assertEquals("zzy", model.nextLink()); + Assertions.assertEquals("sxivzrrryvei", model.columns().get(0).name()); + Assertions.assertEquals("pskdyzatvfuzk", model.columns().get(0).type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastSpendTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastSpendTests.java new file mode 100644 index 000000000000..eec82de2ea92 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastSpendTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.ForecastSpend; + +public final class ForecastSpendTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ForecastSpend model + = BinaryData.fromString("{\"amount\":38.086056167103635,\"unit\":\"toc\"}").toObject(ForecastSpend.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastTimePeriodTests.java index 6db25d87b3b8..c27e96a5838a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastTimePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastTimePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,18 +13,18 @@ public final class ForecastTimePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForecastTimePeriod model - = BinaryData.fromString("{\"from\":\"2021-10-12T22:21:14Z\",\"to\":\"2021-04-27T12:27:55Z\"}") + = BinaryData.fromString("{\"from\":\"2021-10-15T16:43:48Z\",\"to\":\"2021-01-14T16:17:18Z\"}") .toObject(ForecastTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T22:21:14Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T12:27:55Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T16:43:48Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-14T16:17:18Z"), model.to()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForecastTimePeriod model = new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-10-12T22:21:14Z")) - .withTo(OffsetDateTime.parse("2021-04-27T12:27:55Z")); + ForecastTimePeriod model = new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-10-15T16:43:48Z")) + .withTo(OffsetDateTime.parse("2021-01-14T16:17:18Z")); model = BinaryData.fromObject(model).toObject(ForecastTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T22:21:14Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T12:27:55Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T16:43:48Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-14T16:17:18Z"), model.to()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsExternalCloudProviderUsageWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsExternalCloudProviderUsageWithResponseMockTests.java index 2755ba7e68ae..341f375452e7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsExternalCloudProviderUsageWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsExternalCloudProviderUsageWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.ExternalCloudProviderType; @@ -38,110 +38,112 @@ public final class ForecastsExternalCloudProviderUsageWithResponseMockTests { @Test public void testExternalCloudProviderUsageWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"nextLink\":\"psimsf\",\"columns\":[{\"name\":\"fqpmbhyqgsdrmm\",\"type\":\"jxoph\"},{\"name\":\"rhsmvgohtwzmqilr\",\"type\":\"ysfn\"},{\"name\":\"sqywwwmhkru\",\"type\":\"edrympmlqo\"}],\"rows\":[[\"dataduewihapfj\",\"dataiknj\",\"dataiqfl\",\"dataejhpclbiedfsbwc\"],[\"datavbvzipbwxgo\",\"dataoxzpr\"]]},\"sku\":\"mskxknp\",\"eTag\":\"zigjsugswhgsaodk\",\"location\":\"wnbaf\",\"tags\":{\"uvwsxbgnvk\":\"ohzha\"},\"id\":\"rvqchoadhrsxqvzv\",\"name\":\"pabdsrg\",\"type\":\"ajglzrsubklr\"}"; + = "{\"properties\":{\"nextLink\":\"em\",\"columns\":[{\"name\":\"sqsnxf\",\"type\":\"ufeapdrbzyvb\"}],\"rows\":[[\"\\\"dataulpodkaxpf\\\"\",\"\\\"databkzhmhjd\\\"\",\"\\\"datalt\\\"\",\"\\\"dataeluqr\\\"\"],[\"\\\"dataadhfztlray\\\"\",\"\\\"datarkgzkyhudbkuw\\\"\"],[\"\\\"dataqxlcweakfecjvx\\\"\",\"\\\"dataaqufqizjvppwoo\\\"\"]]},\"id\":\"eyyjmjj\",\"name\":\"zxpxhn\",\"type\":\"slekc\",\"location\":\"gzkj\",\"sku\":\"qpdwad\",\"eTag\":\"hz\",\"tags\":{\"jzucwwm\":\"svczdjiahuqy\",\"xiy\":\"jjqhddwvm\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ForecastResult response = manager.forecasts() - .externalCloudProviderUsageWithResponse(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "ljuxl", - new ForecastDefinition().withType(ForecastType.USAGE) - .withTimeframe(ForecastTimeframe.CUSTOM) - .withTimePeriod(new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-11-14T12:41:58Z")) - .withTo(OffsetDateTime.parse("2021-04-13T08:54:29Z"))) - .withDataset(new ForecastDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ForecastDatasetConfiguration() - .withColumns(Arrays.asList("kdch", "aiubavlzwpvgmfa", "kzaz", "gokedgjqafkm"))) - .withAggregation(mapOf("zrthqet", - new ForecastAggregation().withName(FunctionName.COST).withFunction(FunctionType.SUM), - "rtvaoznqni", - new ForecastAggregation().withName(FunctionName.COST_USD).withFunction(FunctionType.SUM), - "zeagmceituuge", - new ForecastAggregation().withName(FunctionName.COST).withFunction(FunctionType.SUM), "pj", - new ForecastAggregation().withName(FunctionName.COST_USD).withFunction(FunctionType.SUM))) - .withFilter( - new ForecastFilter() - .withAnd(Arrays.asList( + ForecastResult response + = manager.forecasts() + .externalCloudProviderUsageWithResponse(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, "qjsgyzst", + new ForecastDefinition().withType(ForecastType.ACTUAL_COST) + .withTimeframe(ForecastTimeframe.CUSTOM) + .withTimePeriod(new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-03-15T02:22:13Z")) + .withTo(OffsetDateTime.parse("2021-08-28T22:55:19Z"))) + .withDataset( + new ForecastDataset().withGranularity(GranularityType.MONTHLY) + .withConfiguration( + new ForecastDatasetConfiguration().withColumns(Arrays.asList("rlduyehiiittugy"))) + .withAggregation(mapOf("lda", + new ForecastAggregation().withName(FunctionName.COST) + .withFunction(FunctionType.SUM), + "fqa", + new ForecastAggregation().withName(FunctionName.PRE_TAX_COST_USD) + .withFunction(FunctionType.SUM), + "ozjv", + new ForecastAggregation().withName(FunctionName.COST) + .withFunction(FunctionType.SUM))) + .withFilter( new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("jdeolctae") + .withAnd( + Arrays + .asList( + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression() + .withName("vt") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("walzyxwhoeamoeo") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) + .withOr( + Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions( + new ForecastComparisonExpression().withName("pnimtwuuh") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("gnkwm") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withDimensions( + new ForecastComparisonExpression().withName("jyrkwfug") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression() + .withName("rrkuumnqd") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("eoq") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("wlujopwnibit") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("u") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("fmwc") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new ForecastComparisonExpression().withName("tgctxe") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression() - .withName("yrle") + .withValues(Arrays.asList("gwyur"))) + .withTags(new ForecastComparisonExpression().withName("lfnzzryizwbxg") .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("vtqigdxzvsgeafg") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression() - .withName("ehxlzsxezppk") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("yfjlpzeqto") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("lixlajmllpque") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("btmkekxpkzwaq") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("qovchiqbp") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("ztekxbyjgmsfep") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("hpqadagrhrdicxdw") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("yovcxjsgbi") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("kdveksb") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new ForecastComparisonExpression().withName("duchvls") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("pibfdy"))) - .withTags(new ForecastComparisonExpression().withName("usspyszekbh") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("aaggkre", "bfrnuybffljfii", "reoagsqtaadus"))))) - .withIncludeActualCost(true) - .withIncludeFreshPartialCost(false), - "avsqwudohzilfmn", com.azure.core.util.Context.NONE) - .getValue(); + .withValues(Arrays.asList("xlayunomir", "p", "abenqlamwmg", "way"))))) + .withIncludeActualCost(true) + .withIncludeFreshPartialCost(true), + "cpjs", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("wnbaf", response.location()); - Assertions.assertEquals("ohzha", response.tags().get("uvwsxbgnvk")); - Assertions.assertEquals("psimsf", response.nextLink()); - Assertions.assertEquals("fqpmbhyqgsdrmm", response.columns().get(0).name()); - Assertions.assertEquals("jxoph", response.columns().get(0).type()); + Assertions.assertEquals("em", response.nextLink()); + Assertions.assertEquals("sqsnxf", response.columns().get(0).name()); + Assertions.assertEquals("ufeapdrbzyvb", response.columns().get(0).type()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsUsageWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsUsageWithResponseMockTests.java index 7a5d76aec84f..b5a418aaa6ad 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsUsageWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ForecastsUsageWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.ForecastAggregation; @@ -37,123 +37,88 @@ public final class ForecastsUsageWithResponseMockTests { @Test public void testUsageWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"nextLink\":\"pxwgsa\",\"columns\":[{\"name\":\"powzafcz\",\"type\":\"mlj\"}],\"rows\":[[\"datapefyc\",\"dataveitit\"]]},\"sku\":\"s\",\"eTag\":\"ajlnsjhwjuyxx\",\"location\":\"xqvmvuay\",\"tags\":{\"eqbw\":\"dxk\",\"xsl\":\"ntghyksarcdr\",\"x\":\"vlzladl\",\"wzdanojisgglmvo\":\"pbqhvfdqqjwkr\"},\"id\":\"atuztjct\",\"name\":\"bpvbkaehxsmzygd\",\"type\":\"wakwseivmakxhys\"}"; + = "{\"properties\":{\"nextLink\":\"oiwyayyzivrmitc\",\"columns\":[{\"name\":\"chwhrktj\",\"type\":\"ifibfiplhxfns\"},{\"name\":\"cjowlyeyzmu\",\"type\":\"qcmhnxlzbu\"},{\"name\":\"dmac\",\"type\":\"kvnrpbjrmvgoqpl\"},{\"name\":\"mumk\",\"type\":\"llcz\"}],\"rows\":[[\"\\\"datanhkgq\\\"\",\"\\\"datagoxsstci\\\"\"],[\"\\\"dataakfrry\\\"\"],[\"\\\"datacwmhlymgnukxrk\\\"\"],[\"\\\"datajpequlrlzaudgjt\\\"\",\"\\\"databc\\\"\"]]},\"id\":\"kkucddwnh\",\"name\":\"butoucgj\",\"type\":\"rjwayhicqq\",\"location\":\"v\",\"sku\":\"kslvlizedvb\",\"eTag\":\"bvn\",\"tags\":{\"wkhojqttbspvkhg\":\"ekzyqxadyfhb\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ForecastResult response - = manager.forecasts() - .usageWithResponse("rmpwctofld", - new ForecastDefinition().withType(ForecastType.ACTUAL_COST) - .withTimeframe(ForecastTimeframe.CUSTOM) - .withTimePeriod(new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2020-12-26T00:57:10Z")) - .withTo(OffsetDateTime.parse("2021-02-12T16:16:33Z"))) - .withDataset(new ForecastDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new ForecastDatasetConfiguration() - .withColumns(Arrays.asList("rfgdrwj", "yewhfjsrwq", "xet"))) - .withAggregation(mapOf("vrrmdqntycn", - new ForecastAggregation().withName(FunctionName.PRE_TAX_COST_USD) - .withFunction(FunctionType.SUM), - "hvmaxgnuyeamcmhu", - new ForecastAggregation().withName(FunctionName.PRE_TAX_COST_USD) - .withFunction(FunctionType.SUM), - "ecehokw", - new ForecastAggregation().withName(FunctionName.COST).withFunction(FunctionType.SUM), - "twloesqr", new ForecastAggregation().withName(FunctionName.PRE_TAX_COST) - .withFunction(FunctionType.SUM))) - .withFilter( - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression() - .withName("koilaci") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression() - .withName("jleip") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("zr") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags( - new ForecastComparisonExpression().withName("thqkkwhbgxvellv") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("itmujdtvm") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression() - .withName("ymffhmjpddnyx") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("z") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("jqrbrpvnm") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new ForecastFilter() - .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("jpp") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("ohoqkpjtnqjilayw") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), - new ForecastFilter(), new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("yrilmhxdqaolf") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("kkbjpjv") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())), - new ForecastFilter().withAnd(Arrays.asList(new ForecastFilter())) - .withOr(Arrays.asList(new ForecastFilter())) - .withDimensions(new ForecastComparisonExpression().withName("wob") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ForecastComparisonExpression().withName("hlwyjfnqzocrd") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new ForecastComparisonExpression().withName("zeunt") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("ncaqttiekoifu"))) - .withTags(new ForecastComparisonExpression().withName("yttzgixgyrih") - .withOperator(ForecastOperatorType.IN) - .withValues(Arrays.asList("gbehlqtxnr"))))) - .withIncludeActualCost(true) - .withIncludeFreshPartialCost(false), - "rndpgfjodhdaqotw", com.azure.core.util.Context.NONE) - .getValue(); + ForecastResult response = manager.forecasts() + .usageWithResponse("ggrssgwjfkain", new ForecastDefinition().withType(ForecastType.AMORTIZED_COST) + .withTimeframe(ForecastTimeframe.CUSTOM) + .withTimePeriod(new ForecastTimePeriod().withFrom(OffsetDateTime.parse("2021-08-02T01:03:22Z")) + .withTo(OffsetDateTime.parse("2021-10-23T04:40:44Z"))) + .withDataset(new ForecastDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new ForecastDatasetConfiguration() + .withColumns(Arrays.asList("scbgmu", "aictdscnkzzohn", "ddclzeqozr"))) + .withAggregation(mapOf("zqixb", + new ForecastAggregation().withName(FunctionName.PRE_TAX_COST_USD) + .withFunction(FunctionType.SUM), + "qvzyuexozonyn", + new ForecastAggregation().withName(FunctionName.PRE_TAX_COST).withFunction(FunctionType.SUM), + "eudpab", + new ForecastAggregation().withName(FunctionName.COST_USD).withFunction(FunctionType.SUM), + "uwzosgyjxvcvaso", + new ForecastAggregation().withName(FunctionName.PRE_TAX_COST_USD) + .withFunction(FunctionType.SUM))) + .withFilter(new ForecastFilter() + .withAnd(Arrays.asList( + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("b") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("zygba") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("sdqhzr") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("akrlimzfvppkeqsi") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new ForecastFilter() + .withAnd( + Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("nhr") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("bcdtajdo") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())), + new ForecastFilter() + .withAnd(Arrays.asList(new ForecastFilter(), new ForecastFilter(), new ForecastFilter(), + new ForecastFilter())) + .withOr(Arrays.asList(new ForecastFilter())) + .withDimensions(new ForecastComparisonExpression().withName("oqtrotpvclpo") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ForecastComparisonExpression().withName("lmwkptskwxjg") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new ForecastComparisonExpression().withName("ccbmkakm") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("kbputmgvmuyak", "lwk"))) + .withTags(new ForecastComparisonExpression().withName("ow") + .withOperator(ForecastOperatorType.IN) + .withValues(Arrays.asList("oyrdurxf", "zqjim", "jtgzj"))))) + .withIncludeActualCost(true) + .withIncludeFreshPartialCost(false), "jlz", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("xqvmvuay", response.location()); - Assertions.assertEquals("dxk", response.tags().get("eqbw")); - Assertions.assertEquals("pxwgsa", response.nextLink()); - Assertions.assertEquals("powzafcz", response.columns().get(0).name()); - Assertions.assertEquals("mlj", response.columns().get(0).type()); + Assertions.assertEquals("oiwyayyzivrmitc", response.nextLink()); + Assertions.assertEquals("chwhrktj", response.columns().get(0).name()); + Assertions.assertEquals("ifibfiplhxfns", response.columns().get(0).type()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByBillingAccountMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByBillingAccountMockTests.java new file mode 100644 index 000000000000..94ffe539ce54 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByBillingAccountMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateBenefitUtilizationSummariesReportsGenerateByBillingAccountMockTests { + @Test + public void testGenerateByBillingAccount() throws Exception { + String responseStr + = "{\"input\":{\"billingAccountId\":\"csbfdjhyaaknyu\",\"billingProfileId\":\"bxiglhphzwxqtej\",\"benefitOrderId\":\"ilhvtozyagjj\",\"benefitId\":\"k\",\"grain\":\"Daily\",\"startDate\":\"2020-12-29T10:59:10Z\",\"endDate\":\"2021-05-26T00:53:31Z\",\"kind\":\"Reservation\"},\"status\":\"Failed\",\"properties\":{\"reportUrl\":\"UtilizedPercentage\",\"secondaryReportUrl\":\"AvgUtilizationPercentage\",\"validUntil\":\"2021-04-25T14:22:40Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BenefitUtilizationSummariesOperationStatus response = manager.generateBenefitUtilizationSummariesReports() + .generateByBillingAccount("wrdtnagzlgpy", + new BenefitUtilizationSummariesRequest().withBillingAccountId("xihzqjjts") + .withBillingProfileId("ydqfttkacy") + .withBenefitOrderId("ue") + .withBenefitId("gmcdcpkshl") + .withGrain(Grain.MONTHLY) + .withStartDate(OffsetDateTime.parse("2021-11-26T12:57:43Z")) + .withEndDate(OffsetDateTime.parse("2021-01-12T22:43:52Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("csbfdjhyaaknyu", response.input().billingAccountId()); + Assertions.assertEquals("bxiglhphzwxqtej", response.input().billingProfileId()); + Assertions.assertEquals("ilhvtozyagjj", response.input().benefitOrderId()); + Assertions.assertEquals("k", response.input().benefitId()); + Assertions.assertEquals(Grain.DAILY, response.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-29T10:59:10Z"), response.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T00:53:31Z"), response.input().endDate()); + Assertions.assertEquals(BenefitKind.RESERVATION, response.input().kind()); + Assertions.assertEquals(OperationStatusType.FAILED, response.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.UTILIZED_PERCENTAGE, + response.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.AVG_UTILIZATION_PERCENTAGE, + response.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T14:22:40Z"), response.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByBillingProfileMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByBillingProfileMockTests.java new file mode 100644 index 000000000000..044b4e9b3623 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByBillingProfileMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateBenefitUtilizationSummariesReportsGenerateByBillingProfileMockTests { + @Test + public void testGenerateByBillingProfile() throws Exception { + String responseStr + = "{\"input\":{\"billingAccountId\":\"olmugpyvao\",\"billingProfileId\":\"kluwz\",\"benefitOrderId\":\"ygz\",\"benefitId\":\"yevjhubnobguq\",\"grain\":\"Monthly\",\"startDate\":\"2021-07-18T07:53:36Z\",\"endDate\":\"2021-02-16T23:51:34Z\",\"kind\":\"SavingsPlan\"},\"status\":\"Running\",\"properties\":{\"reportUrl\":\"BenefitOrderId\",\"secondaryReportUrl\":\"UsageDate\",\"validUntil\":\"2021-05-05T23:15:25Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BenefitUtilizationSummariesOperationStatus response = manager.generateBenefitUtilizationSummariesReports() + .generateByBillingProfile("rwtrdgscnvqeonsg", "wxlwme", + new BenefitUtilizationSummariesRequest().withBillingAccountId("ohxp") + .withBillingProfileId("ceopvk") + .withBenefitOrderId("wfvesobpbok") + .withBenefitId("mlcdyarnggcjfwbl") + .withGrain(Grain.MONTHLY) + .withStartDate(OffsetDateTime.parse("2021-08-18T23:34:47Z")) + .withEndDate(OffsetDateTime.parse("2021-08-02T13:21:21Z")) + .withKind(BenefitKind.INCLUDED_QUANTITY), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("olmugpyvao", response.input().billingAccountId()); + Assertions.assertEquals("kluwz", response.input().billingProfileId()); + Assertions.assertEquals("ygz", response.input().benefitOrderId()); + Assertions.assertEquals("yevjhubnobguq", response.input().benefitId()); + Assertions.assertEquals(Grain.MONTHLY, response.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T07:53:36Z"), response.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T23:51:34Z"), response.input().endDate()); + Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, response.input().kind()); + Assertions.assertEquals(OperationStatusType.RUNNING, response.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.BENEFIT_ORDER_ID, + response.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.USAGE_DATE, + response.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T23:15:25Z"), response.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByReservationIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByReservationIdMockTests.java new file mode 100644 index 000000000000..bef68bf1499a --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByReservationIdMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateBenefitUtilizationSummariesReportsGenerateByReservationIdMockTests { + @Test + public void testGenerateByReservationId() throws Exception { + String responseStr + = "{\"input\":{\"billingAccountId\":\"xrdsjrholuqwg\",\"billingProfileId\":\"xxhdodpjwybl\",\"benefitOrderId\":\"bdmvsby\",\"benefitId\":\"aelqpvekmkwjf\",\"grain\":\"Monthly\",\"startDate\":\"2021-04-05T08:05:08Z\",\"endDate\":\"2020-12-23T01:12:35Z\",\"kind\":\"SavingsPlan\"},\"status\":\"Failed\",\"properties\":{\"reportUrl\":\"MinUtilizationPercentage\",\"secondaryReportUrl\":\"BenefitType\",\"validUntil\":\"2021-03-22T00:36:26Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BenefitUtilizationSummariesOperationStatus response = manager.generateBenefitUtilizationSummariesReports() + .generateByReservationId("faooeactedcg", "sk", + new BenefitUtilizationSummariesRequest().withBillingAccountId("ddida") + .withBillingProfileId("llrqmtlpbyxro") + .withBenefitOrderId("uyqyp") + .withBenefitId("mnoiicsudy") + .withGrain(Grain.HOURLY) + .withStartDate(OffsetDateTime.parse("2021-08-21T16:20:21Z")) + .withEndDate(OffsetDateTime.parse("2021-09-01T09:39:49Z")) + .withKind(BenefitKind.INCLUDED_QUANTITY), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xrdsjrholuqwg", response.input().billingAccountId()); + Assertions.assertEquals("xxhdodpjwybl", response.input().billingProfileId()); + Assertions.assertEquals("bdmvsby", response.input().benefitOrderId()); + Assertions.assertEquals("aelqpvekmkwjf", response.input().benefitId()); + Assertions.assertEquals(Grain.MONTHLY, response.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T08:05:08Z"), response.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T01:12:35Z"), response.input().endDate()); + Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, response.input().kind()); + Assertions.assertEquals(OperationStatusType.FAILED, response.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.MIN_UTILIZATION_PERCENTAGE, + response.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.BENEFIT_TYPE, + response.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T00:36:26Z"), response.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByReservationOrderIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByReservationOrderIdMockTests.java new file mode 100644 index 000000000000..198b93ec9f06 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateByReservationOrderIdMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateBenefitUtilizationSummariesReportsGenerateByReservationOrderIdMockTests { + @Test + public void testGenerateByReservationOrderId() throws Exception { + String responseStr + = "{\"input\":{\"billingAccountId\":\"sxmrszbknimxlp\",\"billingProfileId\":\"rxrzutylcur\",\"benefitOrderId\":\"q\",\"benefitId\":\"b\",\"grain\":\"Hourly\",\"startDate\":\"2021-01-01T19:34:40Z\",\"endDate\":\"2021-03-29T07:54:30Z\",\"kind\":\"IncludedQuantity\"},\"status\":\"Failed\",\"properties\":{\"reportUrl\":\"Kind\",\"secondaryReportUrl\":\"MaxUtilizationPercentage\",\"validUntil\":\"2021-02-01T22:26:58Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BenefitUtilizationSummariesOperationStatus response = manager.generateBenefitUtilizationSummariesReports() + .generateByReservationOrderId("mlviqcpszpmcvqdv", + new BenefitUtilizationSummariesRequest().withBillingAccountId("mvxyrxdh") + .withBillingProfileId("qojbxao") + .withBenefitOrderId("gbzxmbtplefoioy") + .withBenefitId("oxznvgvd") + .withGrain(Grain.MONTHLY) + .withStartDate(OffsetDateTime.parse("2021-06-25T22:21:04Z")) + .withEndDate(OffsetDateTime.parse("2021-01-11T14:05:40Z")) + .withKind(BenefitKind.INCLUDED_QUANTITY), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("sxmrszbknimxlp", response.input().billingAccountId()); + Assertions.assertEquals("rxrzutylcur", response.input().billingProfileId()); + Assertions.assertEquals("q", response.input().benefitOrderId()); + Assertions.assertEquals("b", response.input().benefitId()); + Assertions.assertEquals(Grain.HOURLY, response.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T19:34:40Z"), response.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-29T07:54:30Z"), response.input().endDate()); + Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, response.input().kind()); + Assertions.assertEquals(OperationStatusType.FAILED, response.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.KIND, response.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.MAX_UTILIZATION_PERCENTAGE, + response.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T22:26:58Z"), response.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanIdMockTests.java new file mode 100644 index 000000000000..8529586ad9e1 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanIdMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanIdMockTests { + @Test + public void testGenerateBySavingsPlanId() throws Exception { + String responseStr + = "{\"input\":{\"billingAccountId\":\"kkwayqshwyqxri\",\"billingProfileId\":\"tb\",\"benefitOrderId\":\"q\",\"benefitId\":\"kgxqwqueuuylztpz\",\"grain\":\"Monthly\",\"startDate\":\"2021-08-10T11:27:26Z\",\"endDate\":\"2021-01-04T05:09:41Z\",\"kind\":\"IncludedQuantity\"},\"status\":\"Failed\",\"properties\":{\"reportUrl\":\"Kind\",\"secondaryReportUrl\":\"BenefitType\",\"validUntil\":\"2021-07-29T17:38:50Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BenefitUtilizationSummariesOperationStatus response = manager.generateBenefitUtilizationSummariesReports() + .generateBySavingsPlanId("jekrknfd", "ugjqyckgtxkrdt", + new BenefitUtilizationSummariesRequest().withBillingAccountId("crcjdklotcsubmz") + .withBillingProfileId("nsvob") + .withBenefitOrderId("kxfpwh") + .withBenefitId("sl") + .withGrain(Grain.DAILY) + .withStartDate(OffsetDateTime.parse("2021-05-28T05:38:54Z")) + .withEndDate(OffsetDateTime.parse("2021-06-23T20:59:57Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("kkwayqshwyqxri", response.input().billingAccountId()); + Assertions.assertEquals("tb", response.input().billingProfileId()); + Assertions.assertEquals("q", response.input().benefitOrderId()); + Assertions.assertEquals("kgxqwqueuuylztpz", response.input().benefitId()); + Assertions.assertEquals(Grain.MONTHLY, response.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T11:27:26Z"), response.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T05:09:41Z"), response.input().endDate()); + Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, response.input().kind()); + Assertions.assertEquals(OperationStatusType.FAILED, response.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.KIND, response.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.BENEFIT_TYPE, + response.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T17:38:50Z"), response.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanOrderIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanOrderIdMockTests.java new file mode 100644 index 000000000000..763df7522579 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanOrderIdMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.BenefitKind; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesOperationStatus; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummariesRequest; +import com.azure.resourcemanager.costmanagement.models.BenefitUtilizationSummaryReportSchema; +import com.azure.resourcemanager.costmanagement.models.Grain; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateBenefitUtilizationSummariesReportsGenerateBySavingsPlanOrderIdMockTests { + @Test + public void testGenerateBySavingsPlanOrderId() throws Exception { + String responseStr + = "{\"input\":{\"billingAccountId\":\"fedyuep\",\"billingProfileId\":\"pl\",\"benefitOrderId\":\"dajjvywe\",\"benefitId\":\"fkumcfjxoky\",\"grain\":\"Monthly\",\"startDate\":\"2021-06-18T18:32:43Z\",\"endDate\":\"2021-05-06T20:20:38Z\",\"kind\":\"IncludedQuantity\"},\"status\":\"Completed\",\"properties\":{\"reportUrl\":\"MaxUtilizationPercentage\",\"secondaryReportUrl\":\"BenefitType\",\"validUntil\":\"2021-09-13T22:57:48Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BenefitUtilizationSummariesOperationStatus response = manager.generateBenefitUtilizationSummariesReports() + .generateBySavingsPlanOrderId("ivuxcjkcoqwczs", + new BenefitUtilizationSummariesRequest().withBillingAccountId("qrizfwihvaan") + .withBillingProfileId("tnhjrfdmfd") + .withBenefitOrderId("b") + .withBenefitId("xxjfwtgdfkkauig") + .withGrain(Grain.HOURLY) + .withStartDate(OffsetDateTime.parse("2021-03-08T11:52:52Z")) + .withEndDate(OffsetDateTime.parse("2021-12-02T20:09:08Z")) + .withKind(BenefitKind.RESERVATION), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fedyuep", response.input().billingAccountId()); + Assertions.assertEquals("pl", response.input().billingProfileId()); + Assertions.assertEquals("dajjvywe", response.input().benefitOrderId()); + Assertions.assertEquals("fkumcfjxoky", response.input().benefitId()); + Assertions.assertEquals(Grain.MONTHLY, response.input().grain()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T18:32:43Z"), response.input().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T20:20:38Z"), response.input().endDate()); + Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, response.input().kind()); + Assertions.assertEquals(OperationStatusType.COMPLETED, response.status()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.MAX_UTILIZATION_PERCENTAGE, + response.properties().reportUrl()); + Assertions.assertEquals(BenefitUtilizationSummaryReportSchema.BENEFIT_TYPE, + response.properties().secondaryReportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T22:57:48Z"), response.properties().validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportRequestDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportRequestDefinitionTests.java index 4c10dedb2d54..c4b33847bff7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportRequestDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateCostDetailsReportRequestDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -14,27 +14,27 @@ public final class GenerateCostDetailsReportRequestDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GenerateCostDetailsReportRequestDefinition model = BinaryData.fromString( - "{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"hwuhvctaf\",\"end\":\"rbxrblmliowxihsp\"},\"billingPeriod\":\"wqagnepzwa\",\"invoiceId\":\"sbs\"}") + "{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"uqn\",\"end\":\"ophzfylsgcrp\"},\"billingPeriod\":\"cunezzcezelfw\",\"invoiceId\":\"wl\"}") .toObject(GenerateCostDetailsReportRequestDefinition.class); Assertions.assertEquals(CostDetailsMetricType.ACTUAL_COST, model.metric()); - Assertions.assertEquals("hwuhvctaf", model.timePeriod().start()); - Assertions.assertEquals("rbxrblmliowxihsp", model.timePeriod().end()); - Assertions.assertEquals("wqagnepzwa", model.billingPeriod()); - Assertions.assertEquals("sbs", model.invoiceId()); + Assertions.assertEquals("uqn", model.timePeriod().start()); + Assertions.assertEquals("ophzfylsgcrp", model.timePeriod().end()); + Assertions.assertEquals("cunezzcezelfw", model.billingPeriod()); + Assertions.assertEquals("wl", model.invoiceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GenerateCostDetailsReportRequestDefinition model = new GenerateCostDetailsReportRequestDefinition().withMetric(CostDetailsMetricType.ACTUAL_COST) - .withTimePeriod(new CostDetailsTimePeriod().withStart("hwuhvctaf").withEnd("rbxrblmliowxihsp")) - .withBillingPeriod("wqagnepzwa") - .withInvoiceId("sbs"); + .withTimePeriod(new CostDetailsTimePeriod().withStart("uqn").withEnd("ophzfylsgcrp")) + .withBillingPeriod("cunezzcezelfw") + .withInvoiceId("wl"); model = BinaryData.fromObject(model).toObject(GenerateCostDetailsReportRequestDefinition.class); Assertions.assertEquals(CostDetailsMetricType.ACTUAL_COST, model.metric()); - Assertions.assertEquals("hwuhvctaf", model.timePeriod().start()); - Assertions.assertEquals("rbxrblmliowxihsp", model.timePeriod().end()); - Assertions.assertEquals("wqagnepzwa", model.billingPeriod()); - Assertions.assertEquals("sbs", model.invoiceId()); + Assertions.assertEquals("uqn", model.timePeriod().start()); + Assertions.assertEquals("ophzfylsgcrp", model.timePeriod().end()); + Assertions.assertEquals("cunezzcezelfw", model.billingPeriod()); + Assertions.assertEquals("wl", model.invoiceId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportDefinitionTests.java index c7d206831322..26829fc0990d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -14,31 +14,30 @@ public final class GenerateDetailedCostReportDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GenerateDetailedCostReportDefinition model = BinaryData.fromString( - "{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"fpyapucygvoavyu\",\"end\":\"ssxlghieegjlg\"},\"billingPeriod\":\"paseksgb\",\"invoiceId\":\"antuygdhgaqipirp\",\"customerId\":\"rqofulopmjnlexwh\"}") + "{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"m\",\"end\":\"itgueiookjbs\"},\"billingPeriod\":\"rtdtpdelq\",\"invoiceId\":\"slmot\",\"customerId\":\"bnfxofvc\"}") .toObject(GenerateDetailedCostReportDefinition.class); Assertions.assertEquals(GenerateDetailedCostReportMetricType.ACTUAL_COST, model.metric()); - Assertions.assertEquals("fpyapucygvoavyu", model.timePeriod().start()); - Assertions.assertEquals("ssxlghieegjlg", model.timePeriod().end()); - Assertions.assertEquals("paseksgb", model.billingPeriod()); - Assertions.assertEquals("antuygdhgaqipirp", model.invoiceId()); - Assertions.assertEquals("rqofulopmjnlexwh", model.customerId()); + Assertions.assertEquals("m", model.timePeriod().start()); + Assertions.assertEquals("itgueiookjbs", model.timePeriod().end()); + Assertions.assertEquals("rtdtpdelq", model.billingPeriod()); + Assertions.assertEquals("slmot", model.invoiceId()); + Assertions.assertEquals("bnfxofvc", model.customerId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GenerateDetailedCostReportDefinition model = new GenerateDetailedCostReportDefinition().withMetric(GenerateDetailedCostReportMetricType.ACTUAL_COST) - .withTimePeriod( - new GenerateDetailedCostReportTimePeriod().withStart("fpyapucygvoavyu").withEnd("ssxlghieegjlg")) - .withBillingPeriod("paseksgb") - .withInvoiceId("antuygdhgaqipirp") - .withCustomerId("rqofulopmjnlexwh"); + .withTimePeriod(new GenerateDetailedCostReportTimePeriod().withStart("m").withEnd("itgueiookjbs")) + .withBillingPeriod("rtdtpdelq") + .withInvoiceId("slmot") + .withCustomerId("bnfxofvc"); model = BinaryData.fromObject(model).toObject(GenerateDetailedCostReportDefinition.class); Assertions.assertEquals(GenerateDetailedCostReportMetricType.ACTUAL_COST, model.metric()); - Assertions.assertEquals("fpyapucygvoavyu", model.timePeriod().start()); - Assertions.assertEquals("ssxlghieegjlg", model.timePeriod().end()); - Assertions.assertEquals("paseksgb", model.billingPeriod()); - Assertions.assertEquals("antuygdhgaqipirp", model.invoiceId()); - Assertions.assertEquals("rqofulopmjnlexwh", model.customerId()); + Assertions.assertEquals("m", model.timePeriod().start()); + Assertions.assertEquals("itgueiookjbs", model.timePeriod().end()); + Assertions.assertEquals("rtdtpdelq", model.billingPeriod()); + Assertions.assertEquals("slmot", model.invoiceId()); + Assertions.assertEquals("bnfxofvc", model.customerId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultInnerTests.java index 040346a4c803..19a2fb355edc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportOperationResultInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,28 +13,9 @@ public final class GenerateDetailedCostReportOperationResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GenerateDetailedCostReportOperationResultInner model = BinaryData.fromString( - "{\"id\":\"hu\",\"name\":\"erctatoyin\",\"type\":\"pbrlcyrduczkgofx\",\"properties\":{\"expiryTime\":\"2021-09-24T20:07:26Z\",\"validTill\":\"2020-12-21T07:33:22Z\",\"downloadUrl\":\"crrpcjttbstvje\"}}") + "{\"properties\":{\"expiryTime\":\"2021-03-03T09:58:01Z\",\"validTill\":\"2021-09-27T17:09:21Z\",\"downloadUrl\":\"wiyighxpkdw\"},\"id\":\"aiuebbaumnyqu\",\"name\":\"edeojnabc\",\"type\":\"hsmtxpsiebtfhvp\"}") .toObject(GenerateDetailedCostReportOperationResultInner.class); - Assertions.assertEquals("hu", model.id()); - Assertions.assertEquals("erctatoyin", model.name()); - Assertions.assertEquals("pbrlcyrduczkgofx", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T07:33:22Z"), model.validTill()); - Assertions.assertEquals("crrpcjttbstvje", model.downloadUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GenerateDetailedCostReportOperationResultInner model - = new GenerateDetailedCostReportOperationResultInner().withId("hu") - .withName("erctatoyin") - .withType("pbrlcyrduczkgofx") - .withValidTill(OffsetDateTime.parse("2020-12-21T07:33:22Z")) - .withDownloadUrl("crrpcjttbstvje"); - model = BinaryData.fromObject(model).toObject(GenerateDetailedCostReportOperationResultInner.class); - Assertions.assertEquals("hu", model.id()); - Assertions.assertEquals("erctatoyin", model.name()); - Assertions.assertEquals("pbrlcyrduczkgofx", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T07:33:22Z"), model.validTill()); - Assertions.assertEquals("crrpcjttbstvje", model.downloadUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T17:09:21Z"), model.validTill()); + Assertions.assertEquals("wiyighxpkdw", model.downloadUrl()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportTimePeriodTests.java index 7a1886fbed16..93461930a3de 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportTimePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportTimePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,18 +11,18 @@ public final class GenerateDetailedCostReportTimePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GenerateDetailedCostReportTimePeriod model = BinaryData.fromString("{\"start\":\"bjpi\",\"end\":\"k\"}") + GenerateDetailedCostReportTimePeriod model = BinaryData.fromString("{\"start\":\"k\",\"end\":\"dirazf\"}") .toObject(GenerateDetailedCostReportTimePeriod.class); - Assertions.assertEquals("bjpi", model.start()); - Assertions.assertEquals("k", model.end()); + Assertions.assertEquals("k", model.start()); + Assertions.assertEquals("dirazf", model.end()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GenerateDetailedCostReportTimePeriod model - = new GenerateDetailedCostReportTimePeriod().withStart("bjpi").withEnd("k"); + = new GenerateDetailedCostReportTimePeriod().withStart("k").withEnd("dirazf"); model = BinaryData.fromObject(model).toObject(GenerateDetailedCostReportTimePeriod.class); - Assertions.assertEquals("bjpi", model.start()); - Assertions.assertEquals("k", model.end()); + Assertions.assertEquals("k", model.start()); + Assertions.assertEquals("dirazf", model.end()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportsCreateOperationMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportsCreateOperationMockTests.java index 966f24018a23..808acffba386 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportsCreateOperationMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateDetailedCostReportsCreateOperationMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.GenerateDetailedCostReportDefinition; @@ -24,29 +24,25 @@ public final class GenerateDetailedCostReportsCreateOperationMockTests { @Test public void testCreateOperation() throws Exception { String responseStr - = "{\"id\":\"aexbkhxjxjo\",\"name\":\"lqxr\",\"type\":\"knkob\",\"properties\":{\"expiryTime\":\"2021-06-21T23:26:37Z\",\"validTill\":\"2021-09-20T16:35:27Z\",\"downloadUrl\":\"omtzamicb\"}}"; + = "{\"properties\":{\"expiryTime\":\"2021-10-17T15:45:49Z\",\"validTill\":\"2021-05-13T01:20:50Z\",\"downloadUrl\":\"qncfvdscnhe\"},\"id\":\"wfn\",\"name\":\"qwypvndrwb\",\"type\":\"od\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); GenerateDetailedCostReportOperationResult response = manager.generateDetailedCostReports() - .createOperation("vskiczd", + .createOperation("k", new GenerateDetailedCostReportDefinition().withMetric(GenerateDetailedCostReportMetricType.ACTUAL_COST) - .withTimePeriod( - new GenerateDetailedCostReportTimePeriod().withStart("izikgqaboohxbm").withEnd("gycqsxrmd")) - .withBillingPeriod("wuyqaeo") - .withInvoiceId("jh") - .withCustomerId("jkbvhhdaurgho"), + .withTimePeriod(new GenerateDetailedCostReportTimePeriod().withStart("wqlepjj").withEnd("kca")) + .withBillingPeriod("wz") + .withInvoiceId("togffjwajnrtwz") + .withCustomerId("qkifmxawostfz"), com.azure.core.util.Context.NONE); - Assertions.assertEquals("aexbkhxjxjo", response.id()); - Assertions.assertEquals("lqxr", response.name()); - Assertions.assertEquals("knkob", response.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T16:35:27Z"), response.validTill()); - Assertions.assertEquals("omtzamicb", response.downloadUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T01:20:50Z"), response.validTill()); + Assertions.assertEquals("qncfvdscnhe", response.downloadUrl()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingAccountIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingAccountIdMockTests.java index b89ca9a410d2..f65b07482fa2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingAccountIdMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingAccountIdMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.OperationStatus; @@ -23,20 +23,20 @@ public final class GenerateReservationDetailsReportsByBillingAccountIdMockTests @Test public void testByBillingAccountId() throws Exception { String responseStr - = "{\"status\":\"Running\",\"properties\":{\"reportUrl\":\"SkuName\",\"validUntil\":\"2021-09-20T07:13:33Z\"}}"; + = "{\"status\":\"Completed\",\"properties\":{\"reportUrl\":\"ReservedHours\",\"validUntil\":\"2020-12-30T22:27:40Z\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); OperationStatus response = manager.generateReservationDetailsReports() - .byBillingAccountId("yhwqw", "mvxqab", "km", com.azure.core.util.Context.NONE); + .byBillingAccountId("kktpmbmxbmbr", "gzzxljbkhxsd", "laumydmhweqjf", com.azure.core.util.Context.NONE); - Assertions.assertEquals(OperationStatusType.RUNNING, response.status()); - Assertions.assertEquals(ReservationReportSchema.SKU_NAME, response.reportUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T07:13:33Z"), response.validUntil()); + Assertions.assertEquals(OperationStatusType.COMPLETED, response.status()); + Assertions.assertEquals(ReservationReportSchema.RESERVED_HOURS, response.reportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-30T22:27:40Z"), response.validUntil()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingProfileIdMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingProfileIdMockTests.java index 21dbde969622..d88f454ff677 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingProfileIdMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/GenerateReservationDetailsReportsByBillingProfileIdMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.OperationStatus; @@ -23,20 +23,20 @@ public final class GenerateReservationDetailsReportsByBillingProfileIdMockTests @Test public void testByBillingProfileId() throws Exception { String responseStr - = "{\"status\":\"Failed\",\"properties\":{\"reportUrl\":\"TotalReservedQuantity\",\"validUntil\":\"2021-06-11T21:13:03Z\"}}"; + = "{\"status\":\"Completed\",\"properties\":{\"reportUrl\":\"InstanceFlexibilityRatio\",\"validUntil\":\"2021-09-13T16:50:07Z\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); OperationStatus response = manager.generateReservationDetailsReports() - .byBillingProfileId("re", "h", "whlpuzjpceezn", "angp", com.azure.core.util.Context.NONE); + .byBillingProfileId("vq", "vwglgwzpv", "akglhpsesrfga", "qiy", com.azure.core.util.Context.NONE); - Assertions.assertEquals(OperationStatusType.FAILED, response.status()); - Assertions.assertEquals(ReservationReportSchema.TOTAL_RESERVED_QUANTITY, response.reportUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T21:13:03Z"), response.validUntil()); + Assertions.assertEquals(OperationStatusType.COMPLETED, response.status()); + Assertions.assertEquals(ReservationReportSchema.INSTANCE_FLEXIBILITY_RATIO, response.reportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T16:50:07Z"), response.validUntil()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryPropertiesTests.java index 7a27de2d9406..76d6ac940b5c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,8 @@ public final class IncludedQuantityUtilizationSummaryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncludedQuantityUtilizationSummaryProperties model = BinaryData.fromString( - "{\"armSkuName\":\"ygzc\",\"benefitId\":\"fqxkfaoyteh\",\"benefitOrderId\":\"uvjmv\",\"benefitType\":\"SavingsPlan\",\"usageDate\":\"2021-10-01T21:12:05Z\"}") + "{\"utilizationPercentage\":6120738681672998179,\"armSkuName\":\"fgf\",\"benefitId\":\"snnfhyetefyp\",\"benefitOrderId\":\"octfjgtixrjvzuyt\",\"benefitType\":\"Reservation\",\"usageDate\":\"2021-04-19T09:03:23Z\"}") .toObject(IncludedQuantityUtilizationSummaryProperties.class); - Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncludedQuantityUtilizationSummaryProperties model - = new IncludedQuantityUtilizationSummaryProperties().withBenefitType(BenefitKind.SAVINGS_PLAN); - model = BinaryData.fromObject(model).toObject(IncludedQuantityUtilizationSummaryProperties.class); - Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); + Assertions.assertEquals(BenefitKind.RESERVATION, model.benefitType()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryTests.java index 564466100749..0cb0b8493662 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/IncludedQuantityUtilizationSummaryTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,8 @@ public final class IncludedQuantityUtilizationSummaryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncludedQuantityUtilizationSummary model = BinaryData.fromString( - "{\"kind\":\"IncludedQuantity\",\"properties\":{\"armSkuName\":\"hvyeldotj\",\"benefitId\":\"kwiswskukjtas\",\"benefitOrderId\":\"wispkxk\",\"benefitType\":\"SavingsPlan\",\"usageDate\":\"2021-08-20T02:17:13Z\"},\"id\":\"ndlqvtwknvgmmbu\",\"name\":\"tywatmqaq\",\"type\":\"ueatgroe\"}") + "{\"kind\":\"IncludedQuantity\",\"properties\":{\"utilizationPercentage\":5928896004596070285,\"armSkuName\":\"fgkmtdhern\",\"benefitId\":\"tcjuahokqto\",\"benefitOrderId\":\"auxofshfph\",\"benefitType\":\"SavingsPlan\",\"usageDate\":\"2021-07-09T19:35:04Z\"},\"id\":\"iywzejy\",\"name\":\"hs\",\"type\":\"wkojpllndnpd\"}") .toObject(IncludedQuantityUtilizationSummary.class); Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncludedQuantityUtilizationSummary model - = new IncludedQuantityUtilizationSummary().withBenefitType(BenefitKind.SAVINGS_PLAN); - model = BinaryData.fromObject(model).toObject(IncludedQuantityUtilizationSummary.class); - Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/KpiPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/KpiPropertiesTests.java index e81e7adf5468..303bc15736b7 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/KpiPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/KpiPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,19 +12,19 @@ public final class KpiPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - KpiProperties model = BinaryData.fromString("{\"type\":\"Forecast\",\"id\":\"rhyrnxxmueed\",\"enabled\":true}") + KpiProperties model = BinaryData.fromString("{\"type\":\"Forecast\",\"id\":\"dhcrati\",\"enabled\":true}") .toObject(KpiProperties.class); Assertions.assertEquals(KpiType.FORECAST, model.type()); - Assertions.assertEquals("rhyrnxxmueed", model.id()); - Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("dhcrati", model.id()); + Assertions.assertTrue(model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - KpiProperties model = new KpiProperties().withType(KpiType.FORECAST).withId("rhyrnxxmueed").withEnabled(true); + KpiProperties model = new KpiProperties().withType(KpiType.FORECAST).withId("dhcrati").withEnabled(true); model = BinaryData.fromObject(model).toObject(KpiProperties.class); Assertions.assertEquals(KpiType.FORECAST, model.type()); - Assertions.assertEquals("rhyrnxxmueed", model.id()); - Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("dhcrati", model.id()); + Assertions.assertTrue(model.enabled()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MCAPriceSheetPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MCAPriceSheetPropertiesTests.java new file mode 100644 index 000000000000..39c162e717ce --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MCAPriceSheetPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.MCAPriceSheetProperties; + +public final class MCAPriceSheetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MCAPriceSheetProperties model = BinaryData.fromString( + "{\"billingAccountID\":\"ahxm\",\"billingAccountName\":\"ryarvsxzqb\",\"billingProfileId\":\"cjkay\",\"billingProfileName\":\"thzodubtlmjtgbl\",\"productOrderName\":\"skkfmk\",\"serviceFamily\":96.96344035364034,\"product\":\"yxgbkkqvjcteoedl\",\"productId\":\"lskkzpxvj\",\"skuId\":\"dpvocojhpcn\",\"unitOfMeasure\":\"xzfsnggytexvzilm\",\"meterId\":\"vzkwwwncknr\",\"meterName\":\"ajlskzptj\",\"meterType\":\"lwe\",\"meterCategory\":\"yrth\",\"meterSubCategory\":\"lehmcgcjeinueho\",\"meterRegion\":\"mvfejvqnttmbqd\",\"tierMinimumUnits\":\"zfivfokpysthhzag\",\"effectiveStartDate\":\"2021-04-01T14:24:33Z\",\"effectiveEndDate\":\"2021-07-08T01:03:14Z\",\"unitPrice\":\"lhgenuzejgvkv\",\"basePrice\":\"aqszllrzl\",\"marketPrice\":\"mdqgmihzpimcqr\",\"currency\":\"xtminklogxsvtzar\",\"billingCurrency\":\"vqnsqk\",\"term\":\"mbjwzzoslpkyb\",\"priceType\":\"lwkzpgajsqjcem\"}") + .toObject(MCAPriceSheetProperties.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRuleInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRuleInnerTests.java new file mode 100644 index 000000000000..e04e0593ac86 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRuleInnerTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.models.CustomerMetadata; +import com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MarkupRuleInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarkupRuleInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"b\",\"percentage\":11.274922580897739,\"startDate\":\"2021-05-21T01:41:15Z\",\"endDate\":\"2021-10-09T21:33:57Z\",\"customerDetails\":{\"billingAccountId\":\"f\",\"billingProfileId\":\"lkvn\"}},\"id\":\"lrigjkskyri\",\"name\":\"ovzidsx\",\"type\":\"aabzmif\"}") + .toObject(MarkupRuleInner.class); + Assertions.assertEquals("b", model.properties().description()); + Assertions.assertEquals(11.274922580897739, model.properties().percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T01:41:15Z"), model.properties().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T21:33:57Z"), model.properties().endDate()); + Assertions.assertEquals("f", model.properties().customerDetails().billingAccountId()); + Assertions.assertEquals("lkvn", model.properties().customerDetails().billingProfileId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarkupRuleInner model = new MarkupRuleInner().withProperties(new MarkupRuleProperties().withDescription("b") + .withPercentage(11.274922580897739) + .withStartDate(OffsetDateTime.parse("2021-05-21T01:41:15Z")) + .withEndDate(OffsetDateTime.parse("2021-10-09T21:33:57Z")) + .withCustomerDetails(new CustomerMetadata().withBillingAccountId("f").withBillingProfileId("lkvn"))); + model = BinaryData.fromObject(model).toObject(MarkupRuleInner.class); + Assertions.assertEquals("b", model.properties().description()); + Assertions.assertEquals(11.274922580897739, model.properties().percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T01:41:15Z"), model.properties().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T21:33:57Z"), model.properties().endDate()); + Assertions.assertEquals("f", model.properties().customerDetails().billingAccountId()); + Assertions.assertEquals("lkvn", model.properties().customerDetails().billingProfileId()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulePagedResponseTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulePagedResponseTests.java new file mode 100644 index 000000000000..87f71c4a9c10 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulePagedResponseTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.implementation.models.MarkupRulePagedResponse; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MarkupRulePagedResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarkupRulePagedResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"raglk\",\"percentage\":96.13140936542442,\"startDate\":\"2021-03-31T19:58:29Z\",\"endDate\":\"2021-07-17T12:34:33Z\",\"customerDetails\":{\"billingAccountId\":\"juj\",\"billingProfileId\":\"ickpz\"}},\"id\":\"p\",\"name\":\"pmxelnwcltyje\",\"type\":\"ex\"}],\"nextLink\":\"lfmk\"}") + .toObject(MarkupRulePagedResponse.class); + Assertions.assertEquals("raglk", model.value().get(0).properties().description()); + Assertions.assertEquals(96.13140936542442, model.value().get(0).properties().percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T19:58:29Z"), + model.value().get(0).properties().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T12:34:33Z"), + model.value().get(0).properties().endDate()); + Assertions.assertEquals("juj", model.value().get(0).properties().customerDetails().billingAccountId()); + Assertions.assertEquals("ickpz", model.value().get(0).properties().customerDetails().billingProfileId()); + Assertions.assertEquals("lfmk", model.nextLink()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulePropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulePropertiesTests.java new file mode 100644 index 000000000000..123e6efc2b72 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulePropertiesTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CustomerMetadata; +import com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MarkupRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarkupRuleProperties model = BinaryData.fromString( + "{\"description\":\"gznmmaxrizkzob\",\"percentage\":96.4877876400453,\"startDate\":\"2021-06-22T09:26:41Z\",\"endDate\":\"2021-08-13T20:23:25Z\",\"customerDetails\":{\"billingAccountId\":\"slnelx\",\"billingProfileId\":\"eixynllxecwcroj\"}}") + .toObject(MarkupRuleProperties.class); + Assertions.assertEquals("gznmmaxrizkzob", model.description()); + Assertions.assertEquals(96.4877876400453, model.percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T09:26:41Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T20:23:25Z"), model.endDate()); + Assertions.assertEquals("slnelx", model.customerDetails().billingAccountId()); + Assertions.assertEquals("eixynllxecwcroj", model.customerDetails().billingProfileId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarkupRuleProperties model = new MarkupRuleProperties().withDescription("gznmmaxrizkzob") + .withPercentage(96.4877876400453) + .withStartDate(OffsetDateTime.parse("2021-06-22T09:26:41Z")) + .withEndDate(OffsetDateTime.parse("2021-08-13T20:23:25Z")) + .withCustomerDetails( + new CustomerMetadata().withBillingAccountId("slnelx").withBillingProfileId("eixynllxecwcroj")); + model = BinaryData.fromObject(model).toObject(MarkupRuleProperties.class); + Assertions.assertEquals("gznmmaxrizkzob", model.description()); + Assertions.assertEquals(96.4877876400453, model.percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T09:26:41Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T20:23:25Z"), model.endDate()); + Assertions.assertEquals("slnelx", model.customerDetails().billingAccountId()); + Assertions.assertEquals("eixynllxecwcroj", model.customerDetails().billingProfileId()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesCreateOrUpdateWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..74e51981732b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.fluent.models.MarkupRuleInner; +import com.azure.resourcemanager.costmanagement.models.CustomerMetadata; +import com.azure.resourcemanager.costmanagement.models.MarkupRule; +import com.azure.resourcemanager.costmanagement.models.MarkupRuleProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MarkupRulesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"dxonckbn\",\"percentage\":75.91914228125366,\"startDate\":\"2020-12-23T09:40:29Z\",\"endDate\":\"2021-07-07T07:40:45Z\",\"customerDetails\":{\"billingAccountId\":\"upibaqzizxzpzwe\",\"billingProfileId\":\"hlwwbogv\"}},\"id\":\"klqiyndveqel\",\"name\":\"b\",\"type\":\"vd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MarkupRule response = manager.markupRules() + .createOrUpdateWithResponse("ucaonz", "ajbvbn", "rdemdidack", + new MarkupRuleInner().withProperties(new MarkupRuleProperties().withDescription("gzwdydamis") + .withPercentage(45.79867069203934) + .withStartDate(OffsetDateTime.parse("2021-08-21T05:52:41Z")) + .withEndDate(OffsetDateTime.parse("2021-04-29T22:09:59Z")) + .withCustomerDetails(new CustomerMetadata().withBillingAccountId("vykpxkqe") + .withBillingProfileId("tpjfojiunrlshxuk"))), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("dxonckbn", response.properties().description()); + Assertions.assertEquals(75.91914228125366, response.properties().percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T09:40:29Z"), response.properties().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-07T07:40:45Z"), response.properties().endDate()); + Assertions.assertEquals("upibaqzizxzpzwe", response.properties().customerDetails().billingAccountId()); + Assertions.assertEquals("hlwwbogv", response.properties().customerDetails().billingProfileId()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesDeleteWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..eb235cddd3e2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MarkupRulesDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.markupRules() + .deleteWithResponse("trkzxsgtznsvlrds", "o", "pimyndnoxax", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesGetWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesGetWithResponseMockTests.java new file mode 100644 index 000000000000..ce5bae4d5ff3 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesGetWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.MarkupRule; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MarkupRulesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"erkeluxzsh\",\"percentage\":32.71527329852223,\"startDate\":\"2021-07-12T00:58:32Z\",\"endDate\":\"2021-05-02T08:49:09Z\",\"customerDetails\":{\"billingAccountId\":\"uzudlevzskejcg\",\"billingProfileId\":\"fsgqkstyecupyuij\"}},\"id\":\"rdavsjcfmazpzdq\",\"name\":\"uzvcmcok\",\"type\":\"izekuvfrj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MarkupRule response = manager.markupRules() + .getWithResponse("phbeaeqjz", "hkdcl", "croczf", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("erkeluxzsh", response.properties().description()); + Assertions.assertEquals(32.71527329852223, response.properties().percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T00:58:32Z"), response.properties().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T08:49:09Z"), response.properties().endDate()); + Assertions.assertEquals("uzudlevzskejcg", response.properties().customerDetails().billingAccountId()); + Assertions.assertEquals("fsgqkstyecupyuij", response.properties().customerDetails().billingProfileId()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesListMockTests.java new file mode 100644 index 000000000000..c2fef0cc22dc --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/MarkupRulesListMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.MarkupRule; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MarkupRulesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"tqm\",\"percentage\":11.90157426950693,\"startDate\":\"2021-07-24T05:28:03Z\",\"endDate\":\"2021-03-30T15:42:17Z\",\"customerDetails\":{\"billingAccountId\":\"pizfulgyc\",\"billingProfileId\":\"sd\"}},\"id\":\"qgkujds\",\"name\":\"oxrqw\",\"type\":\"eurbtigapdyarik\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.markupRules().list("rqaqotn", "dxolousdv", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("tqm", response.iterator().next().properties().description()); + Assertions.assertEquals(11.90157426950693, response.iterator().next().properties().percentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T05:28:03Z"), + response.iterator().next().properties().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-30T15:42:17Z"), + response.iterator().next().properties().endDate()); + Assertions.assertEquals("pizfulgyc", + response.iterator().next().properties().customerDetails().billingAccountId()); + Assertions.assertEquals("sd", response.iterator().next().properties().customerDetails().billingProfileId()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationPropertiesTests.java index 5dcf4155219a..030dcbfd2626 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,27 +13,28 @@ public final class NotificationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotificationProperties model = BinaryData.fromString( - "{\"to\":[\"njaujvaan\"],\"language\":\"giycwkdtaawxwfek\",\"message\":\"mrrqmbzmqkratb\",\"regionalFormat\":\"wbjsidbirkf\",\"subject\":\"kso\"}") + "{\"to\":[\"szabbelawu\",\"ua\",\"lzkwrrwoy\",\"qucwyhahnom\"],\"language\":\"kywuhpsvfuu\",\"message\":\"tlwexxwlalniexz\",\"regionalFormat\":\"zpgepqty\",\"subject\":\"bwwpgdakchzy\"}") .toObject(NotificationProperties.class); - Assertions.assertEquals("njaujvaan", model.to().get(0)); - Assertions.assertEquals("giycwkdtaawxwfek", model.language()); - Assertions.assertEquals("mrrqmbzmqkratb", model.message()); - Assertions.assertEquals("wbjsidbirkf", model.regionalFormat()); - Assertions.assertEquals("kso", model.subject()); + Assertions.assertEquals("szabbelawu", model.to().get(0)); + Assertions.assertEquals("kywuhpsvfuu", model.language()); + Assertions.assertEquals("tlwexxwlalniexz", model.message()); + Assertions.assertEquals("zpgepqty", model.regionalFormat()); + Assertions.assertEquals("bwwpgdakchzy", model.subject()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NotificationProperties model = new NotificationProperties().withTo(Arrays.asList("njaujvaan")) - .withLanguage("giycwkdtaawxwfek") - .withMessage("mrrqmbzmqkratb") - .withRegionalFormat("wbjsidbirkf") - .withSubject("kso"); + NotificationProperties model + = new NotificationProperties().withTo(Arrays.asList("szabbelawu", "ua", "lzkwrrwoy", "qucwyhahnom")) + .withLanguage("kywuhpsvfuu") + .withMessage("tlwexxwlalniexz") + .withRegionalFormat("zpgepqty") + .withSubject("bwwpgdakchzy"); model = BinaryData.fromObject(model).toObject(NotificationProperties.class); - Assertions.assertEquals("njaujvaan", model.to().get(0)); - Assertions.assertEquals("giycwkdtaawxwfek", model.language()); - Assertions.assertEquals("mrrqmbzmqkratb", model.message()); - Assertions.assertEquals("wbjsidbirkf", model.regionalFormat()); - Assertions.assertEquals("kso", model.subject()); + Assertions.assertEquals("szabbelawu", model.to().get(0)); + Assertions.assertEquals("kywuhpsvfuu", model.language()); + Assertions.assertEquals("tlwexxwlalniexz", model.message()); + Assertions.assertEquals("zpgepqty", model.regionalFormat()); + Assertions.assertEquals("bwwpgdakchzy", model.subject()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationTests.java new file mode 100644 index 000000000000..8aa22b80d3f5 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/NotificationTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.BudgetNotificationOperatorType; +import com.azure.resourcemanager.costmanagement.models.CultureCode; +import com.azure.resourcemanager.costmanagement.models.Frequency; +import com.azure.resourcemanager.costmanagement.models.Notification; +import com.azure.resourcemanager.costmanagement.models.ThresholdType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class NotificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Notification model = BinaryData.fromString( + "{\"enabled\":true,\"operator\":\"EqualTo\",\"threshold\":29.644155348415012,\"frequency\":\"Daily\",\"contactEmails\":[\"bnbdxkqpxokajion\",\"imexgstxgcpodgma\",\"jrmvdjwzrlo\",\"mcl\"],\"contactRoles\":[\"j\",\"oejctbzaqsqsy\",\"bkbfkgukdkex\"],\"contactGroups\":[\"ofmx\"],\"thresholdType\":\"Actual\",\"locale\":\"da-dk\"}") + .toObject(Notification.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.EQUAL_TO, model.operator()); + Assertions.assertEquals(29.644155348415012, model.threshold()); + Assertions.assertEquals(Frequency.DAILY, model.frequency()); + Assertions.assertEquals("bnbdxkqpxokajion", model.contactEmails().get(0)); + Assertions.assertEquals("j", model.contactRoles().get(0)); + Assertions.assertEquals("ofmx", model.contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.ACTUAL, model.thresholdType()); + Assertions.assertEquals(CultureCode.DA_DK, model.locale()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Notification model = new Notification().withEnabled(true) + .withOperator(BudgetNotificationOperatorType.EQUAL_TO) + .withThreshold(29.644155348415012) + .withFrequency(Frequency.DAILY) + .withContactEmails(Arrays.asList("bnbdxkqpxokajion", "imexgstxgcpodgma", "jrmvdjwzrlo", "mcl")) + .withContactRoles(Arrays.asList("j", "oejctbzaqsqsy", "bkbfkgukdkex")) + .withContactGroups(Arrays.asList("ofmx")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.DA_DK); + model = BinaryData.fromObject(model).toObject(Notification.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(BudgetNotificationOperatorType.EQUAL_TO, model.operator()); + Assertions.assertEquals(29.644155348415012, model.threshold()); + Assertions.assertEquals(Frequency.DAILY, model.frequency()); + Assertions.assertEquals("bnbdxkqpxokajion", model.contactEmails().get(0)); + Assertions.assertEquals("j", model.contactRoles().get(0)); + Assertions.assertEquals("ofmx", model.contactGroups().get(0)); + Assertions.assertEquals(ThresholdType.ACTUAL, model.thresholdType()); + Assertions.assertEquals(CultureCode.DA_DK, model.locale()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationDisplayTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationDisplayTests.java index bd3fd5fd42fe..f672697ac21a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationDisplayTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -10,14 +10,9 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"qhabifpikxwcz\",\"resource\":\"scnpqxuhivy\",\"operation\":\"iwbybrkxvdumjg\",\"description\":\"fwvuk\"}") + OperationDisplay model = BinaryData + .fromString( + "{\"provider\":\"th\",\"resource\":\"hab\",\"operation\":\"pikxwczbyscnpqxu\",\"description\":\"vyq\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationListResultTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationListResultTests.java index df49a2bbb99e..b005b72326db 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationListResultTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationListResultTests.java @@ -1,23 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.costmanagement.models.OperationListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.OperationListResult; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"quvgjxpybczme\",\"name\":\"tzopbsphrupidgsy\",\"isDataAction\":false,\"display\":{\"provider\":\"ph\",\"resource\":\"cmsxaobhdxbm\",\"operation\":\"ioq\",\"description\":\"ehtbm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"id\":\"oizh\",\"name\":\"rxybqsoq\",\"isDataAction\":false,\"display\":{\"provider\":\"mbpazlobcufpdzn\",\"resource\":\"t\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"id\":\"rifkwm\",\"name\":\"ktsizntocipaou\",\"isDataAction\":true,\"display\":{\"provider\":\"ucmpoyfd\",\"resource\":\"ogknygjofjdd\",\"operation\":\"s\",\"description\":\"eupewnwreitjz\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"rh\"}") + "{\"value\":[{\"id\":\"hwlrx\",\"name\":\"qsoqijgkd\",\"isDataAction\":true,\"display\":{\"provider\":\"lobcufpdznrbtcq\",\"resource\":\"nq\",\"operation\":\"hqgnufooojywif\",\"description\":\"esaagdfm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"id\":\"xrifkwmrvkts\",\"name\":\"nt\",\"isDataAction\":false,\"display\":{\"provider\":\"ouajpsqucmpoyf\",\"resource\":\"fogknygjofjdde\",\"operation\":\"rd\",\"description\":\"pewnw\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"yflusarhmofc\"}") .toObject(OperationListResult.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationStatusInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationStatusInnerTests.java index a1584a9dd806..bc0607c7be52 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationStatusInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationStatusInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -15,21 +15,10 @@ public final class OperationStatusInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationStatusInner model = BinaryData.fromString( - "{\"status\":\"Running\",\"properties\":{\"reportUrl\":\"UsedHours\",\"validUntil\":\"2021-08-16T16:07:55Z\"}}") + "{\"status\":\"Running\",\"properties\":{\"reportUrl\":\"ReservationOrderId\",\"validUntil\":\"2021-10-05T06:11:19Z\"}}") .toObject(OperationStatusInner.class); Assertions.assertEquals(OperationStatusType.RUNNING, model.status()); - Assertions.assertEquals(ReservationReportSchema.USED_HOURS, model.reportUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T16:07:55Z"), model.validUntil()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationStatusInner model = new OperationStatusInner().withStatus(OperationStatusType.RUNNING) - .withReportUrl(ReservationReportSchema.USED_HOURS) - .withValidUntil(OffsetDateTime.parse("2021-08-16T16:07:55Z")); - model = BinaryData.fromObject(model).toObject(OperationStatusInner.class); - Assertions.assertEquals(OperationStatusType.RUNNING, model.status()); - Assertions.assertEquals(ReservationReportSchema.USED_HOURS, model.reportUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T16:07:55Z"), model.validUntil()); + Assertions.assertEquals(ReservationReportSchema.RESERVATION_ORDER_ID, model.reportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T06:11:19Z"), model.validUntil()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationTests.java index 27b8b84a3177..abfa1db20087 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.models.Operation; -import com.azure.resourcemanager.costmanagement.models.OperationDisplay; public final class OperationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Operation model = BinaryData.fromString( - "{\"name\":\"nryrtihf\",\"isDataAction\":true,\"display\":{\"provider\":\"pzvgnwzsymglzufc\",\"resource\":\"kohdbiha\",\"operation\":\"fhfcb\",\"description\":\"s\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") + "{\"name\":\"hfpmrqobmtukknr\",\"isDataAction\":false,\"display\":{\"provider\":\"fxti\",\"resource\":\"pzvgnwzsymglzufc\",\"operation\":\"kohdbiha\",\"description\":\"fhfcb\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(Operation.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Operation model = new Operation().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(Operation.class); - } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationsListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationsListMockTests.java index dbc5a0bb2756..feb4cb49b601 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationsListMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.CostManagementOperation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"id\":\"apfgsdpcvessm\",\"name\":\"h\",\"isDataAction\":false,\"display\":{\"provider\":\"ldqqctekv\",\"resource\":\"blhtjq\",\"operation\":\"yvwehtaemxh\",\"description\":\"ysev\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"id\":\"zxpdcldpkawnsnl\",\"name\":\"mouxwksqmudmfco\",\"isDataAction\":true,\"display\":{\"provider\":\"iuswswj\",\"resource\":\"b\",\"operation\":\"jhbtqq\",\"description\":\"fs\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PivotPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PivotPropertiesTests.java index 5a23b421cb3a..7d81acfb0063 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PivotPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PivotPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,17 +12,17 @@ public final class PivotPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PivotProperties model = BinaryData.fromString("{\"type\":\"Dimension\",\"name\":\"tkwqqtchealm\"}") - .toObject(PivotProperties.class); + PivotProperties model + = BinaryData.fromString("{\"type\":\"Dimension\",\"name\":\"sxiftozq\"}").toObject(PivotProperties.class); Assertions.assertEquals(PivotType.DIMENSION, model.type()); - Assertions.assertEquals("tkwqqtchealm", model.name()); + Assertions.assertEquals("sxiftozq", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PivotProperties model = new PivotProperties().withType(PivotType.DIMENSION).withName("tkwqqtchealm"); + PivotProperties model = new PivotProperties().withType(PivotType.DIMENSION).withName("sxiftozq"); model = BinaryData.fromObject(model).toObject(PivotProperties.class); Assertions.assertEquals(PivotType.DIMENSION, model.type()); - Assertions.assertEquals("tkwqqtchealm", model.name()); + Assertions.assertEquals("sxiftozq", model.name()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingAccountMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingAccountMockTests.java new file mode 100644 index 000000000000..b78e025cd1a2 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingAccountMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.OperationStatus; +import com.azure.resourcemanager.costmanagement.models.OperationStatusType; +import com.azure.resourcemanager.costmanagement.models.ReservationReportSchema; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PriceSheetsDownloadByBillingAccountMockTests { + @Test + public void testDownloadByBillingAccount() throws Exception { + String responseStr + = "{\"status\":\"Running\",\"properties\":{\"reportUrl\":\"InstanceFlexibilityGroup\",\"validUntil\":\"2021-12-07T06:49:58Z\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OperationStatus response + = manager.priceSheets().downloadByBillingAccount("frbhseuerbg", "xebjl", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(OperationStatusType.RUNNING, response.status()); + Assertions.assertEquals(ReservationReportSchema.INSTANCE_FLEXIBILITY_GROUP, response.reportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T06:49:58Z"), response.validUntil()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingProfileMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingProfileMockTests.java index fade5172ec1d..aca1d9f5fb70 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingProfileMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByBillingProfileMockTests.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; -import com.azure.resourcemanager.costmanagement.models.DownloadUrl; +import com.azure.resourcemanager.costmanagement.models.PricesheetDownloadProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -21,19 +21,18 @@ public final class PriceSheetsDownloadByBillingProfileMockTests { @Test public void testDownloadByBillingProfile() throws Exception { String responseStr - = "{\"expiryTime\":\"2021-05-12T10:10:58Z\",\"validTill\":\"2021-02-08T12:12:40Z\",\"downloadUrl\":\"jsvlpg\"}"; + = "{\"expiryTime\":\"2021-10-19T08:20:18Z\",\"downloadUrl\":\"wjlofzekfsrm\",\"downloadFileProperties\":{\"billingAccountID\":\"la\",\"billingAccountName\":\"cfocz\",\"billingProfileId\":\"pejovt\",\"billingProfileName\":\"xnhwh\",\"productOrderName\":\"oyrzaaoe\",\"serviceFamily\":26.431057813815872,\"product\":\"envjeateaxxc\",\"productId\":\"oxdjxldnaryy\",\"skuId\":\"zkdolrndwdbvxvza\",\"unitOfMeasure\":\"doyqx\",\"meterId\":\"nkfthmcxqqxmyz\",\"meterName\":\"a\",\"meterType\":\"n\",\"meterCategory\":\"hrvmzrqrazadi\",\"meterSubCategory\":\"nllaslkskh\",\"meterRegion\":\"jpv\",\"tierMinimumUnits\":\"ihxjtgzgtai\",\"effectiveStartDate\":\"2021-03-01T12:10:06Z\",\"effectiveEndDate\":\"2021-10-07T20:49:54Z\",\"unitPrice\":\"oig\",\"basePrice\":\"fsgsa\",\"marketPrice\":\"w\",\"currency\":\"fmhl\",\"billingCurrency\":\"lxspmrjct\",\"term\":\"ldsxebuhsxrz\",\"priceType\":\"gsdaluyckh\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - DownloadUrl response = manager.priceSheets() - .downloadByBillingProfile("mxcjzlquzexokjx", "bjvbzinzab", com.azure.core.util.Context.NONE); + PricesheetDownloadProperties response + = manager.priceSheets().downloadByBillingProfile("v", "yjz", com.azure.core.util.Context.NONE); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T12:12:40Z"), response.validTill()); - Assertions.assertEquals("jsvlpg", response.downloadUrl()); + Assertions.assertEquals("wjlofzekfsrm", response.downloadUrl()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByInvoiceMockTests.java similarity index 62% rename from sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadMockTests.java rename to sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByInvoiceMockTests.java index d0c25598a5fe..4c96617e5d96 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PriceSheetsDownloadByInvoiceMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.DownloadUrl; @@ -17,23 +17,23 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class PriceSheetsDownloadMockTests { +public final class PriceSheetsDownloadByInvoiceMockTests { @Test - public void testDownload() throws Exception { + public void testDownloadByInvoice() throws Exception { String responseStr - = "{\"expiryTime\":\"2021-04-11T05:30:07Z\",\"validTill\":\"2021-05-26T23:09:40Z\",\"downloadUrl\":\"tcyilbvz\"}"; + = "{\"expiryTime\":\"2021-01-01T05:44:01Z\",\"validTill\":\"2021-01-14T13:44:05Z\",\"downloadUrl\":\"hneao\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DownloadUrl response = manager.priceSheets() - .download("quxweyslandkd", "djhunhghcgawnr", "nquoxsotireimse", com.azure.core.util.Context.NONE); + .downloadByInvoice("hgoqgsoyqyxyj", "cbqp", "ispgl", com.azure.core.util.Context.NONE); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T23:09:40Z"), response.validTill()); - Assertions.assertEquals("tcyilbvz", response.downloadUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-14T13:44:05Z"), response.validTill()); + Assertions.assertEquals("hneao", response.downloadUrl()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PricesheetDownloadPropertiesInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PricesheetDownloadPropertiesInnerTests.java new file mode 100644 index 000000000000..cbe5577e73e0 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/PricesheetDownloadPropertiesInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.PricesheetDownloadPropertiesInner; +import org.junit.jupiter.api.Assertions; + +public final class PricesheetDownloadPropertiesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PricesheetDownloadPropertiesInner model = BinaryData.fromString( + "{\"expiryTime\":\"2021-09-29T09:06:30Z\",\"downloadUrl\":\"pc\",\"downloadFileProperties\":{\"billingAccountID\":\"nuqndaizupf\",\"billingAccountName\":\"uytuszxhmtvtv\",\"billingProfileId\":\"w\",\"billingProfileName\":\"ukvzwydwttha\",\"productOrderName\":\"gkskjivbss\",\"serviceFamily\":13.916308923689924,\"product\":\"u\",\"productId\":\"eexpgeumi\",\"skuId\":\"wuit\",\"unitOfMeasure\":\"exyionofninbd\",\"meterId\":\"s\",\"meterName\":\"wqqrsmpcbbprtuga\",\"meterType\":\"zbcyksiv\",\"meterCategory\":\"ogd\",\"meterSubCategory\":\"bfcmkrfts\",\"meterRegion\":\"wjjxsgm\",\"tierMinimumUnits\":\"wvif\",\"effectiveStartDate\":\"2021-02-28T16:49:55Z\",\"effectiveEndDate\":\"2021-04-13T01:28:10Z\",\"unitPrice\":\"fho\",\"basePrice\":\"xwklooz\",\"marketPrice\":\"txvcm\",\"currency\":\"unlcpxxv\",\"billingCurrency\":\"yeyng\",\"term\":\"vrquv\",\"priceType\":\"gglpmcrdcuelj\"}}") + .toObject(PricesheetDownloadPropertiesInner.class); + Assertions.assertEquals("pc", model.downloadUrl()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageByExternalCloudProviderTypeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageByExternalCloudProviderTypeWithResponseMockTests.java index d5908f7baa1f..2ab7d1c93ede 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageByExternalCloudProviderTypeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageByExternalCloudProviderTypeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.ExportType; @@ -39,80 +39,97 @@ public final class QueriesUsageByExternalCloudProviderTypeWithResponseMockTests @Test public void testUsageByExternalCloudProviderTypeWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"nextLink\":\"oellnkkiiwvmt\",\"columns\":[{\"name\":\"ymdjfua\",\"type\":\"oqvqpilr\"},{\"name\":\"ncanlduwzor\",\"type\":\"bm\"},{\"name\":\"qk\",\"type\":\"ymxkqvfqepdx\"}],\"rows\":[[\"dataubwyv\",\"datajbowcpj\",\"datadu\"],[\"dataixexkydfbwljavhu\",\"datarkjd\",\"datavrg\",\"dataiegftc\"],[\"dataiiftksd\",\"datagdnk\",\"datafgmwd\",\"datac\"]]},\"sku\":\"uvczldbgl\",\"eTag\":\"utbaaqgze\",\"location\":\"ajclyzgsnorbjg\",\"tags\":{\"bvvjbhvhdiq\":\"jotvmrxkhl\",\"vhyibdrqrsw\":\"yfluiyuosnuudte\",\"oxztfwfqch\":\"buubpyrowt\"},\"id\":\"czevjnn\",\"name\":\"tagfyvrtpqp\",\"type\":\"mhzcgkrepdqh\"}"; + = "{\"properties\":{\"nextLink\":\"tvcshtkutzcttb\",\"columns\":[{\"name\":\"rdammtzj\",\"type\":\"fjfxtbw\"},{\"name\":\"irmu\",\"type\":\"gftt\"},{\"name\":\"ofgeoagf\",\"type\":\"ftnxodwxmdajwiy\"}],\"rows\":[[\"\\\"dataevmdm\\\"\",\"\\\"dataenlrstgf\\\"\",\"\\\"datazljdnci\\\"\",\"\\\"datatjva\\\"\"],[\"\\\"datayznm\\\"\",\"\\\"datagcdogcvucgy\\\"\",\"\\\"dataoxuwhttnzqsaqm\\\"\",\"\\\"databgszplusdek\\\"\"]]},\"id\":\"zzmssgpgv\",\"name\":\"yejidbdqzsqun\",\"type\":\"wztlvvwsnmrkky\",\"location\":\"repwpwfkcaux\",\"sku\":\"avcpfpdofuckclbt\",\"eTag\":\"ue\",\"tags\":{\"qebuuxjxhfxfjwp\":\"lzwilfngojf\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); QueryResult response = manager.queries() - .usageByExternalCloudProviderTypeWithResponse(ExternalCloudProviderType.EXTERNAL_BILLING_ACCOUNTS, - "fntumeezbxvqx", - new QueryDefinition().withType(ExportType.ACTUAL_COST) - .withTimeframe(TimeframeType.THE_LAST_BILLING_MONTH) - .withTimePeriod(new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-04-13T01:01:15Z")) - .withTo(OffsetDateTime.parse("2021-03-19T07:46:42Z"))) + .usageByExternalCloudProviderTypeWithResponse(ExternalCloudProviderType.EXTERNAL_SUBSCRIPTIONS, "pxmib", + new QueryDefinition().withType(ExportType.RESERVATION_RECOMMENDATIONS) + .withTimeframe(TimeframeType.WEEK_TO_DATE) + .withTimePeriod(new QueryTimePeriod().withFrom(OffsetDateTime.parse("2020-12-28T14:21:32Z")) + .withTo(OffsetDateTime.parse("2021-06-04T07:30:31Z"))) .withDataset(new QueryDataset().withGranularity(GranularityType.DAILY) .withConfiguration(new QueryDatasetConfiguration() - .withColumns(Arrays.asList("mtmjzw", "uqgovsxpwwztjfm", "khtgfredmlscgrll", "cnaovjo"))) - .withAggregation(mapOf("comlyotgkwsx", - new QueryAggregation().withName("hpa").withFunction(FunctionType.SUM), "etqujxcxxq", - new QueryAggregation().withName("srqorcgenmvceb").withFunction(FunctionType.SUM))) - .withGrouping(Arrays.asList( - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("jkedwqurcgojmrv"), - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("wjongzs"), - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("qqrsil"))) + .withColumns(Arrays.asList("qmwovyztx", "nomfpbjceegvyiez", "kutnjillukkrehy"))) + .withAggregation(mapOf("gdezvjqwahoy", + new QueryAggregation().withName("joduifvulxfaryrv").withFunction(FunctionType.SUM), + "vovbooqbmdqrx", + new QueryAggregation().withName("yaxqvjweiwtczkd").withFunction(FunctionType.SUM))) + .withGrouping( + Arrays.asList(new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("et"), + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("flwtjdt"), + new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("iefooyyc"), + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("dtzcqi"))) .withFilter(new QueryFilter() - .withAnd(Arrays - .asList(new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + .withAnd(Arrays.asList(new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("zomehxlantolam") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("juxkqll") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("nsbvr") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("ckzdqiqdlra") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("gv") + .withTags(new QueryComparisonExpression().withName("wxoauwxsuy") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( + .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("tejrthc") + .withDimensions(new QueryComparisonExpression().withName("slglh") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("hxlyubqjrostvrje") + .withTags(new QueryComparisonExpression().withName("jfzihuioaeocp") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("qrztrxal") + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("kbdgddkrh") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("habsrwrsnrh") + .withTags(new QueryComparisonExpression().withName("xbeuuqu") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("wgu") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("ijcxfno") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new QueryComparisonExpression().withName("tiwkkvyan") + .withDimensions(new QueryComparisonExpression().withName("gjdydhqkk") .withOperator(QueryOperatorType.IN) - .withValues( - Arrays.asList("vcsemsvuvdj", "qxetqmmlivrjjx", "wxdchpojxlehzlx", "gfquwz"))) - .withTags( - new QueryComparisonExpression().withName("iibelwcerw") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("pjxljtxb", "sqtbxxniu", "sdzhgbdgzpagsec", - "adbuwqrgxfllmqiy"))))), + .withValues(Arrays.asList("uckcatuqbhpow"))) + .withTags(new QueryComparisonExpression().withName("xtpzdlyse") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("oa", "atprytgrhzbq", "d", "fa"))))), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ajclyzgsnorbjg", response.location()); - Assertions.assertEquals("jotvmrxkhl", response.tags().get("bvvjbhvhdiq")); - Assertions.assertEquals("oellnkkiiwvmt", response.nextLink()); - Assertions.assertEquals("ymdjfua", response.columns().get(0).name()); - Assertions.assertEquals("oqvqpilr", response.columns().get(0).type()); + Assertions.assertEquals("tvcshtkutzcttb", response.nextLink()); + Assertions.assertEquals("rdammtzj", response.columns().get(0).name()); + Assertions.assertEquals("fjfxtbw", response.columns().get(0).type()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageWithResponseMockTests.java index db14214bc733..8158f6993af1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueriesUsageWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.ExportType; @@ -38,118 +38,80 @@ public final class QueriesUsageWithResponseMockTests { @Test public void testUsageWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"nextLink\":\"pavidnievwffc\",\"columns\":[{\"name\":\"zslp\",\"type\":\"gcbdsvalpnptw\"},{\"name\":\"kx\",\"type\":\"azwu\"}],\"rows\":[[\"datavnjobfelhldiuhzz\"],[\"datalmfaewzgiudjp\",\"datapqht\"],[\"datahnmhkrezsdsux\",\"dataeqdgcruxsp\"]]},\"sku\":\"ymmqgwokmikp\",\"eTag\":\"fbmjxuvji\",\"location\":\"fdvhaxdvwzae\",\"tags\":{\"oixwgiksb\":\"hthdklmvetatlakf\"},\"id\":\"vtooxrpo\",\"name\":\"wp\",\"type\":\"chgjtnhtukfacih\"}"; + = "{\"properties\":{\"nextLink\":\"dvatlzmgschn\",\"columns\":[{\"name\":\"kkzovlzdm\",\"type\":\"mfwsxafofu\"}],\"rows\":[[\"\\\"datammovzwd\\\"\",\"\\\"datahkkmvhzfovan\\\"\"]]},\"id\":\"vaprtgelgw\",\"name\":\"ikfyaqandm\",\"type\":\"n\",\"location\":\"qjumovs\",\"sku\":\"pbvzopaxmfmvsmcw\",\"eTag\":\"faxdtnqifbsa\",\"tags\":{\"boel\":\"iauesugmocpcjy\",\"or\":\"gttwfldsi\",\"riwmmtmqrxrzqv\":\"nikcedpk\",\"xiqahr\":\"yczyayubtgm\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); QueryResult response = manager.queries() - .usageWithResponse("etw", - new QueryDefinition().withType(ExportType.AMORTIZED_COST) + .usageWithResponse("ykdnonaaxwmg", + new QueryDefinition().withType(ExportType.USAGE) .withTimeframe(TimeframeType.BILLING_MONTH_TO_DATE) - .withTimePeriod(new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-06-15T09:41:25Z")) - .withTo(OffsetDateTime.parse("2021-10-24T15:19:07Z"))) + .withTimePeriod(new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-04-28T05:23:11Z")) + .withTo(OffsetDateTime.parse("2021-11-08T15:45:43Z"))) .withDataset( new QueryDataset().withGranularity(GranularityType.DAILY) .withConfiguration(new QueryDatasetConfiguration() - .withColumns(Arrays.asList("ukykcyqh", "qqzzdc", "keys"))) - .withAggregation( - mapOf("dazgbsqgpe", - new QueryAggregation().withName("fop").withFunction(FunctionType.SUM), - "utmdpvozg", - new QueryAggregation().withName("q").withFunction(FunctionType.SUM), - "lctzeyowmndcovd", - new QueryAggregation().withName("qjbknl").withFunction(FunctionType.SUM))) - .withGrouping(Arrays - .asList(new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("uxza"), - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("mk"))) + .withColumns(Arrays.asList("lleiq", "cbgvsbt", "ertoxadhxuvj", "xmnrqstjcmet"))) + .withAggregation(mapOf("naqyqipslzmvcds", + new QueryAggregation().withName("gicvnpvvdh").withFunction(FunctionType.SUM))) + .withGrouping( + Arrays.asList( + new QueryGrouping().withType(QueryColumnType.TAG_KEY) + .withName("itekdtfobvfiyb"), + new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("ich"), + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("bfzdqekiv"))) .withFilter( new QueryFilter() .withAnd(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression() - .withName("bcpftxudqyemebun") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression() - .withName("mcirtneemm") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("efnoh") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags( - new QueryComparisonExpression().withName("ranizerw") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ubvf") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("fcocefhpr") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("aud") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("lcdculregpq") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ztnvgy") + .withDimensions(new QueryComparisonExpression().withName("ulrqtbht") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("rdgrtwmewjzlp") + .withTags(new QueryComparisonExpression().withName("pzl") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("wjcayerzrr") + .withDimensions(new QueryComparisonExpression().withName("dutzfkg") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("ybylpol") + .withTags(new QueryComparisonExpression().withName("oudccgndjg") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new QueryComparisonExpression().withName("ghsrleinkfscjfn") + .withOr(Arrays.asList(new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("eqfcbuulpy") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("qjfshtujcyo") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new QueryComparisonExpression().withName("imwdcsklkqnqvki") .withOperator(QueryOperatorType.IN) - .withValues( - Arrays.asList("vuagfqwtl", "ngvmreuptrklzmij", "jwolxfsvaghmpynw"))) - .withTags(new QueryComparisonExpression().withName("lr") + .withValues(Arrays.asList("bzmecu", "rzwimbzayspz"))) + .withTags(new QueryComparisonExpression().withName("i") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("tzjcvbxqla", "snsso"))))), + .withValues(Arrays.asList("fphmdzxplg"))))), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fdvhaxdvwzae", response.location()); - Assertions.assertEquals("hthdklmvetatlakf", response.tags().get("oixwgiksb")); - Assertions.assertEquals("pavidnievwffc", response.nextLink()); - Assertions.assertEquals("zslp", response.columns().get(0).name()); - Assertions.assertEquals("gcbdsvalpnptw", response.columns().get(0).type()); + Assertions.assertEquals("dvatlzmgschn", response.nextLink()); + Assertions.assertEquals("kkzovlzdm", response.columns().get(0).name()); + Assertions.assertEquals("mfwsxafofu", response.columns().get(0).type()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryAggregationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryAggregationTests.java index 20b81f025802..da07bc64004d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryAggregationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryAggregationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,17 +12,17 @@ public final class QueryAggregationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - QueryAggregation model = BinaryData.fromString("{\"name\":\"xpaglqivbgkc\",\"function\":\"Sum\"}") - .toObject(QueryAggregation.class); - Assertions.assertEquals("xpaglqivbgkc", model.name()); + QueryAggregation model + = BinaryData.fromString("{\"name\":\"owa\",\"function\":\"Sum\"}").toObject(QueryAggregation.class); + Assertions.assertEquals("owa", model.name()); Assertions.assertEquals(FunctionType.SUM, model.function()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QueryAggregation model = new QueryAggregation().withName("xpaglqivbgkc").withFunction(FunctionType.SUM); + QueryAggregation model = new QueryAggregation().withName("owa").withFunction(FunctionType.SUM); model = BinaryData.fromObject(model).toObject(QueryAggregation.class); - Assertions.assertEquals("xpaglqivbgkc", model.name()); + Assertions.assertEquals("owa", model.name()); Assertions.assertEquals(FunctionType.SUM, model.function()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryColumnTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryColumnTests.java index e62362dbe7c1..fe012dcaabab 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryColumnTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryColumnTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -11,17 +11,9 @@ public final class QueryColumnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - QueryColumn model - = BinaryData.fromString("{\"name\":\"swankltytmh\",\"type\":\"oznnhdrlktgj\"}").toObject(QueryColumn.class); - Assertions.assertEquals("swankltytmh", model.name()); - Assertions.assertEquals("oznnhdrlktgj", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryColumn model = new QueryColumn().withName("swankltytmh").withType("oznnhdrlktgj"); - model = BinaryData.fromObject(model).toObject(QueryColumn.class); - Assertions.assertEquals("swankltytmh", model.name()); - Assertions.assertEquals("oznnhdrlktgj", model.type()); + QueryColumn model = BinaryData.fromString("{\"name\":\"phrgfnzhctm\",\"type\":\"sghpbcbcpzarpze\"}") + .toObject(QueryColumn.class); + Assertions.assertEquals("phrgfnzhctm", model.name()); + Assertions.assertEquals("sghpbcbcpzarpze", model.type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryComparisonExpressionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryComparisonExpressionTests.java index a8b1cdfa3d97..9b0de1b55c72 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryComparisonExpressionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryComparisonExpressionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,22 +13,22 @@ public final class QueryComparisonExpressionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - QueryComparisonExpression model = BinaryData.fromString( - "{\"name\":\"iwdcxsmlzzhzd\",\"operator\":\"In\",\"values\":[\"tlgy\",\"lhqvlnnpxybafi\",\"geaar\",\"gjekglklby\"]}") - .toObject(QueryComparisonExpression.class); - Assertions.assertEquals("iwdcxsmlzzhzd", model.name()); + QueryComparisonExpression model + = BinaryData.fromString("{\"name\":\"ns\",\"operator\":\"In\",\"values\":[\"gl\",\"exa\"]}") + .toObject(QueryComparisonExpression.class); + Assertions.assertEquals("ns", model.name()); Assertions.assertEquals(QueryOperatorType.IN, model.operator()); - Assertions.assertEquals("tlgy", model.values().get(0)); + Assertions.assertEquals("gl", model.values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QueryComparisonExpression model = new QueryComparisonExpression().withName("iwdcxsmlzzhzd") + QueryComparisonExpression model = new QueryComparisonExpression().withName("ns") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("tlgy", "lhqvlnnpxybafi", "geaar", "gjekglklby")); + .withValues(Arrays.asList("gl", "exa")); model = BinaryData.fromObject(model).toObject(QueryComparisonExpression.class); - Assertions.assertEquals("iwdcxsmlzzhzd", model.name()); + Assertions.assertEquals("ns", model.name()); Assertions.assertEquals(QueryOperatorType.IN, model.operator()); - Assertions.assertEquals("tlgy", model.values().get(0)); + Assertions.assertEquals("gl", model.values().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetConfigurationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetConfigurationTests.java index c5ae6485299a..75e04162caef 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetConfigurationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,14 +13,14 @@ public final class QueryDatasetConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryDatasetConfiguration model - = BinaryData.fromString("{\"columns\":[\"munjdxvglnkvx\"]}").toObject(QueryDatasetConfiguration.class); - Assertions.assertEquals("munjdxvglnkvx", model.columns().get(0)); + = BinaryData.fromString("{\"columns\":[\"bagn\",\"hjhgem\"]}").toObject(QueryDatasetConfiguration.class); + Assertions.assertEquals("bagn", model.columns().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QueryDatasetConfiguration model = new QueryDatasetConfiguration().withColumns(Arrays.asList("munjdxvglnkvx")); + QueryDatasetConfiguration model = new QueryDatasetConfiguration().withColumns(Arrays.asList("bagn", "hjhgem")); model = BinaryData.fromObject(model).toObject(QueryDatasetConfiguration.class); - Assertions.assertEquals("munjdxvglnkvx", model.columns().get(0)); + Assertions.assertEquals("bagn", model.columns().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetTests.java index de707163b765..e4dee767e75a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDatasetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -24,420 +24,288 @@ public final class QueryDatasetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryDataset model = BinaryData.fromString( - "{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"ubwefqs\"]},\"aggregation\":{\"ex\":{\"name\":\"aqtferr\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"xap\"},{\"type\":\"Dimension\",\"name\":\"og\"},{\"type\":\"TagKey\",\"name\":\"nobpudcdabtqwpw\"},{\"type\":\"TagKey\",\"name\":\"wbzasqbuclj\"}],\"filter\":{\"and\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"i\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"sdaultxij\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"z\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"nm\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"qxtbjwgnyf\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"zsvtuikzhajqgl\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"xynqnz\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"sovwxznptgoeiyb\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"f\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"vntjlrigjk\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"vzidsxwaab\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"frygznmmax\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"kzobgopxlhsln\",\"operator\":\"In\",\"values\":[\"ieixynllxe\",\"wcrojphslhcaw\",\"u\"]},\"tags\":{\"name\":\"fdwfmvigorqj\",\"operator\":\"In\",\"values\":[\"zhraglkafh\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ckpzvcpopmxeln\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"tyjedex\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"scazuawxtzxpu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"abzxrvxcushsp\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"asflvg\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wywa\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"mjblmljhlny\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"tqyryuzcbmqqv\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"xo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"peujlzqn\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"nzoibgsxgnx\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"onmpqoxwdof\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"iiqbi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"mwwinhehfqpofv\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"blembnkbwvqvxkd\",\"operator\":\"In\",\"values\":[\"ihebwtsw\",\"zuwfmdur\"]},\"tags\":{\"name\":\"egizv\",\"operator\":\"In\",\"values\":[\"elisdjub\",\"gbqi\",\"kxkbsazgakgacyr\"]}}],\"or\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"pv\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ylnio\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"edm\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"vnlvxbcuiiznktwf\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ibmikostbzb\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"buqny\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"sgcrpfbcunezzce\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fwyfwlwxjwet\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"zvaylptrsqqw\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"mwqkchcxwaxf\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"xfdeqvhpsyl\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"hkbffmbm\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"rgywwp\",\"operator\":\"In\",\"values\":[\"snptfujgicgaao\"]},\"tags\":{\"name\":\"ttaqutdew\",\"operator\":\"In\",\"values\":[\"swvr\",\"unzzjgehk\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"okffqyinljqepqwh\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"onsts\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"clduc\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"rds\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"egstmninwjizci\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"hgshe\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"uluxl\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"vnersbycucrw\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"brqbsmswzi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"uhok\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"swhvhczznvfbycj\",\"operator\":\"In\",\"values\":[\"wwixzvumw\"]},\"tags\":{\"name\":\"qhndvnoam\",\"operator\":\"In\",\"values\":[\"ehaohdjhh\",\"lzok\",\"coxpelnjeta\",\"ltsxoatf\"]}},{\"and\":[{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"wvefloccsrmoz\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ipgawtxx\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"jxgrytfmp\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ilrmcaykggnox\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"ndfcpfn\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"hjtwkjaosrx\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"tcqiosmg\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"hgxqdlyrt\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"tz\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bhjmznnb\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"eq\",\"operator\":\"In\",\"values\":[\"rvlagunbtgfebwln\",\"mhyreeudz\",\"av\"]},\"tags\":{\"name\":\"dqmjxly\",\"operator\":\"In\",\"values\":[\"lgouwtlmjj\",\"uojqt\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"tu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"fjkwrusnkq\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"njqhdenxa\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"pakdkifmjnnawt\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"kpggqoweyi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"lisn\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"pizruwnpqxpxiw\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"gjsaasiixtm\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"hgfgrwsd\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"atzv\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"ictc\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"xkjzwrgxffm\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"gozxw\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bydpizqaclnapxb\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"nugj\",\"operator\":\"In\",\"values\":[\"smfcttuxuuyilfl\",\"oiquvrehmrnjhvs\",\"jztczytqj\",\"w\"]},\"tags\":{\"name\":\"uunfprnjletlxsm\",\"operator\":\"In\",\"values\":[\"do\",\"ifamowazi\"]}}],\"dimensions\":{\"name\":\"knlqwzdvpiwhxqsz\",\"operator\":\"In\",\"values\":[\"aajquhuxylrj\",\"m\",\"ygjbmzyospspsh\"]},\"tags\":{\"name\":\"fkyjpmspbpssdfpp\",\"operator\":\"In\",\"values\":[\"tieyujtvczkcny\"]}}}") + "{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"nucaephblkwqpat\",\"bqsdtcjbctvi\",\"uzqymtuowog\",\"gitsqh\"]},\"aggregation\":{\"ds\":{\"name\":\"rzcdbanf\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"eatkdbmwnrdj\"},{\"type\":\"Dimension\",\"name\":\"bqbnaomhjrmkuh\"},{\"type\":\"TagKey\",\"name\":\"xljalfihc\"},{\"type\":\"TagKey\",\"name\":\"obcancdexxqcw\"}],\"filter\":{\"and\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"zwjjzr\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"xldzyyfytpqsix\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"vyqlkjuvsmbmslzo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wzdbpqvybefgv\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"t\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"seskvcuar\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ykycndzfqi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"euy\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"gltbxoeeo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"nfwmyymvqdbpb\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"zcrcssbzhddubbnq\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"h\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"vawu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"j\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"gqgdminictteajoh\",\"operator\":\"In\",\"values\":[\"spnbonhpcz\",\"kmktpvwxqcseh\",\"hkhufm\",\"qumq\"]},\"tags\":{\"name\":\"gy\",\"operator\":\"In\",\"values\":[\"lod\",\"aeuzanh\",\"fnhsenwphp\",\"fngq\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"jwjj\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"beqrkuorh\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"mdvhazcvjy\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"swbqerzwxi\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"kvlbpktgdstyoua\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wreswmowegm\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"uqi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ii\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"desygrijwa\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"anra\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"rojsydg\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"dkygywezski\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"f\",\"operator\":\"In\",\"values\":[\"m\",\"ieqvds\",\"a\",\"lixqcah\"]},\"tags\":{\"name\":\"xalybxawoijpo\",\"operator\":\"In\",\"values\":[\"lxp\",\"kwjdjodqhy\",\"incnr\",\"mehllizhceu\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ppyi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"qladywrxwhydtlu\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"snuyemlowuowhl\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wyrmouv\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"kltrfow\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"rfmvlihcvjdrqcrj\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"vhdxlwyo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"qzdkfn\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"tqxmbj\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"mzznvalqjrhuzgfx\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"llywpvtiotzbp\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"llgryfqiuasigr\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"quygdjboqgrmtq\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"evadrmmwiu\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"c\",\"operator\":\"In\",\"values\":[\"kxiidisczskoswo\"]},\"tags\":{\"name\":\"qazu\",\"operator\":\"In\",\"values\":[\"xzkrrcoi\",\"sbamnppcc\"]}}],\"or\":[{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"axyfukzxuizhyhn\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"peti\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"xdukecpxd\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"dhctmmko\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"trpc\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"iofkbtfmh\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"vcb\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"zyqu\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"rp\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"uyu\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"vlm\",\"operator\":\"In\",\"values\":[\"colbmxlb\",\"w\"]},\"tags\":{\"name\":\"cpahprzrvxhm\",\"operator\":\"In\",\"values\":[\"ocnxz\"]}}],\"dimensions\":{\"name\":\"jhngxnoq\",\"operator\":\"In\",\"values\":[\"disnj\",\"vhdl\",\"ydidwhepfwwtjf\",\"o\"]},\"tags\":{\"name\":\"xxhmwcdbc\",\"operator\":\"In\",\"values\":[\"ikxkxhneg\",\"njzrbhtmeplvu\",\"aobrlbp\"]}}}") .toObject(QueryDataset.class); Assertions.assertEquals(GranularityType.DAILY, model.granularity()); - Assertions.assertEquals("ubwefqs", model.configuration().columns().get(0)); - Assertions.assertEquals("aqtferr", model.aggregation().get("ex").name()); - Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("ex").function()); - Assertions.assertEquals(QueryColumnType.DIMENSION, model.grouping().get(0).type()); - Assertions.assertEquals("xap", model.grouping().get(0).name()); - Assertions.assertEquals("i", model.filter().and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("nucaephblkwqpat", model.configuration().columns().get(0)); + Assertions.assertEquals("rzcdbanf", model.aggregation().get("ds").name()); + Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("ds").function()); + Assertions.assertEquals(QueryColumnType.TAG_KEY, model.grouping().get(0).type()); + Assertions.assertEquals("eatkdbmwnrdj", model.grouping().get(0).name()); + Assertions.assertEquals("zwjjzr", model.filter().and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("sdaultxij", model.filter().and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("xldzyyfytpqsix", model.filter().and().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("xynqnz", model.filter().and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("ykycndzfqi", model.filter().and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("sovwxznptgoeiyb", model.filter().and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("euy", model.filter().and().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("kzobgopxlhsln", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals("gqgdminictteajoh", model.filter().and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("ieixynllxe", model.filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("fdwfmvigorqj", model.filter().and().get(0).tags().name()); + Assertions.assertEquals("spnbonhpcz", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("gy", model.filter().and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).tags().operator()); - Assertions.assertEquals("zhraglkafh", model.filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("pv", model.filter().or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("lod", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("axyfukzxuizhyhn", model.filter().or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("ylnio", model.filter().or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("peti", model.filter().or().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("zvaylptrsqqw", model.filter().or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("trpc", model.filter().or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("mwqkchcxwaxf", model.filter().or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("iofkbtfmh", model.filter().or().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("rgywwp", model.filter().or().get(0).dimensions().name()); + Assertions.assertEquals("vlm", model.filter().or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("snptfujgicgaao", model.filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("ttaqutdew", model.filter().or().get(0).tags().name()); + Assertions.assertEquals("colbmxlb", model.filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("cpahprzrvxhm", model.filter().or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).tags().operator()); - Assertions.assertEquals("swvr", model.filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("knlqwzdvpiwhxqsz", model.filter().dimensions().name()); + Assertions.assertEquals("ocnxz", model.filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("jhngxnoq", model.filter().dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().dimensions().operator()); - Assertions.assertEquals("aajquhuxylrj", model.filter().dimensions().values().get(0)); - Assertions.assertEquals("fkyjpmspbpssdfpp", model.filter().tags().name()); + Assertions.assertEquals("disnj", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("xxhmwcdbc", model.filter().tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().tags().operator()); - Assertions.assertEquals("tieyujtvczkcny", model.filter().tags().values().get(0)); + Assertions.assertEquals("ikxkxhneg", model.filter().tags().values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { QueryDataset model = new QueryDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new QueryDatasetConfiguration().withColumns(Arrays.asList("ubwefqs"))) - .withAggregation(mapOf("ex", new QueryAggregation().withName("aqtferr").withFunction(FunctionType.SUM))) + .withConfiguration(new QueryDatasetConfiguration() + .withColumns(Arrays.asList("nucaephblkwqpat", "bqsdtcjbctvi", "uzqymtuowog", "gitsqh"))) + .withAggregation( + mapOf("ds", new QueryAggregation().withName("rzcdbanf").withFunction(FunctionType.SUM))) .withGrouping( - Arrays - .asList(new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("xap"), - new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("og"), - new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("nobpudcdabtqwpw"), - new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("wbzasqbuclj"))) + Arrays.asList(new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("eatkdbmwnrdj"), + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("bqbnaomhjrmkuh"), + new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("xljalfihc"), + new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("obcancdexxqcw"))) .withFilter( new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("i") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("sdaultxij") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("z") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags( - new QueryComparisonExpression().withName("nm") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), + .withAnd( + Arrays + .asList( new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("qxtbjwgnyf") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("zsvtuikzhajqgl") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr( - Arrays - .asList( + .withAnd(Arrays.asList( new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("xynqnz") + .withDimensions(new QueryComparisonExpression().withName("zwjjzr") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("sovwxznptgoeiyb") + .withTags(new QueryComparisonExpression() + .withName("xldzyyfytpqsix") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("f") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("vntjlrigjk") + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays + .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions( + new QueryComparisonExpression().withName("vyqlkjuvsmbmslzo") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression() + .withName("wzdbpqvybefgv") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("vzidsxwaab") + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays + .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("t") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("frygznmmax") + .withTags(new QueryComparisonExpression() + .withName("seskvcuar") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new QueryComparisonExpression().withName("kzobgopxlhsln") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ieixynllxe", "wcrojphslhcaw", "u"))) - .withTags(new QueryComparisonExpression().withName("fdwfmvigorqj") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("zhraglkafh"))), - new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ckpzvcpopmxeln") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("tyjedex") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("scazuawxtzxpu") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("abzxrvxcushsp") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("asflvg") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("wywa") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("mjblmljhlny") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("tqyryuzcbmqqv") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("xo") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression() - .withName("peujlzqn") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("nzoibgsxgnx") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("onmpqoxwdof") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("iiqbi") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("mwwinhehfqpofv") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new QueryComparisonExpression().withName("blembnkbwvqvxkd") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ihebwtsw", "zuwfmdur"))) - .withTags(new QueryComparisonExpression().withName("egizv") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("elisdjub", "gbqi", "kxkbsazgakgacyr"))))) - .withOr( - Arrays - .asList( - new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList( + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) .withDimensions(new QueryComparisonExpression() - .withName("pv") + .withName("ykycndzfqi") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) .withTags(new QueryComparisonExpression() - .withName("ylnio") + .withName("euy") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays - .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("edm") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("vnlvxbcuiiznktwf") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ibmikostbzb") + .withDimensions(new QueryComparisonExpression().withName("gltbxoeeo") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) .withTags(new QueryComparisonExpression() - .withName("buqny") + .withName("nfwmyymvqdbpb") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) .withDimensions( - new QueryComparisonExpression().withName("sgcrpfbcunezzce") + new QueryComparisonExpression().withName("zcrcssbzhddubbnq") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("fwyfwlwxjwet") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression() - .withName("zvaylptrsqqw") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) .withTags(new QueryComparisonExpression() - .withName("mwqkchcxwaxf") + .withName("h") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays - .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("xfdeqvhpsyl") + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("vawu") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("hkbffmbm") + .withTags(new QueryComparisonExpression().withName("j") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())))) .withDimensions(new QueryComparisonExpression() - .withName("rgywwp") + .withName("gqgdminictteajoh") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("snptfujgicgaao"))) + .withValues(Arrays.asList("spnbonhpcz", "kmktpvwxqcseh", "hkhufm", "qumq"))) .withTags(new QueryComparisonExpression() - .withName("ttaqutdew") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("swvr", "unzzjgehk"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("okffqyinljqepqwh") + .withName("gy") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags( - new QueryComparisonExpression().withName("onsts") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( + .withValues(Arrays.asList("lod", "aeuzanh", "fnhsenwphp", "fngq"))), + new QueryFilter() + .withAnd(Arrays.asList( new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("clduc") + .withDimensions(new QueryComparisonExpression() + .withName("jwjj") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) .withTags(new QueryComparisonExpression() - .withName("rds") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions( - new QueryComparisonExpression().withName("egstmninwjizci") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression() - .withName("hgshe") + .withName("beqrkuorh") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) .withOr(Arrays .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("uluxl") + .withDimensions(new QueryComparisonExpression().withName("mdvhazcvjy") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("vnersbycucrw") + .withTags(new QueryComparisonExpression() + .withName("swbqerzwxi") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("brqbsmswzi") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("uhok") + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays + .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions( + new QueryComparisonExpression().withName("kvlbpktgdstyoua") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("wreswmowegm") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new QueryComparisonExpression().withName("swhvhczznvfbycj") + .withOr( + Arrays.asList( + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("uqi") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("ii") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions( + new QueryComparisonExpression().withName("desygrijwa") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("anra") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("rojsydg") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags( + new QueryComparisonExpression().withName("dkygywezski") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new QueryComparisonExpression().withName("f") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("wwixzvumw"))) - .withTags(new QueryComparisonExpression() - .withName("qhndvnoam") + .withValues(Arrays.asList("m", "ieqvds", "a", "lixqcah"))) + .withTags(new QueryComparisonExpression().withName("xalybxawoijpo") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ehaohdjhh", "lzok", "coxpelnjeta", "ltsxoatf"))), + .withValues(Arrays.asList("lxp", "kwjdjodqhy", "incnr", "mehllizhceu"))), new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("wvefloccsrmoz") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("ipgawtxx") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("jxgrytfmp") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("ilrmcaykggnox") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( + .withAnd(Arrays.asList( new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ndfcpfn") + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("ppyi") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("hjtwkjaosrx") + .withTags(new QueryComparisonExpression() + .withName("qladywrxwhydtlu") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("tcqiosmg") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) + .withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions( + new QueryComparisonExpression().withName("snuyemlowuowhl") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) .withTags(new QueryComparisonExpression() - .withName("hgxqdlyrt") + .withName("wyrmouv") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("tz") + .withOr(Arrays + .asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("kltrfow") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("bhjmznnb") + .withTags(new QueryComparisonExpression().withName("rfmvlihcvjdrqcrj") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new QueryComparisonExpression() - .withName("eq") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("rvlagunbtgfebwln", "mhyreeudz", "av"))) - .withTags(new QueryComparisonExpression().withName("dqmjxly") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("lgouwtlmjj", "uojqt"))), - new QueryFilter() - .withAnd(Arrays.asList( + .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("tu") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("vhdxlwyo") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("fjkwrusnkq") + .withTags(new QueryComparisonExpression() + .withName("qzdkfn") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("njqhdenxa") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withDimensions(new QueryComparisonExpression() + .withName("tqxmbj") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) .withTags(new QueryComparisonExpression() - .withName("pakdkifmjnnawt") + .withName("mzznvalqjrhuzgfx") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())), new QueryFilter() @@ -445,112 +313,138 @@ public void testSerialize() throws Exception { new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("kpggqoweyi") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression() - .withName("lisn") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) .withDimensions( - new QueryComparisonExpression().withName("pizruwnpqxpxiw") + new QueryComparisonExpression().withName("llywpvtiotzbp") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("gjsaasiixtm") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("hgfgrwsd") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("atzv") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ictc") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression() - .withName("xkjzwrgxffm") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())), + .withTags( + new QueryComparisonExpression().withName("llgryfqiuasigr") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("gozxw") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new QueryComparisonExpression().withName("bydpizqaclnapxb") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions( + new QueryComparisonExpression().withName("quygdjboqgrmtq") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("evadrmmwiu") .withOperator(QueryOperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions( - new QueryComparisonExpression().withName("nugj") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("smfcttuxuuyilfl", "oiquvrehmrnjhvs", - "jztczytqj", "w"))) - .withTags(new QueryComparisonExpression().withName("uunfprnjletlxsm") + .withDimensions(new QueryComparisonExpression() + .withName("c") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("kxiidisczskoswo"))) + .withTags(new QueryComparisonExpression() + .withName("qazu") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("do", "ifamowazi"))))) - .withDimensions(new QueryComparisonExpression().withName("knlqwzdvpiwhxqsz") + .withValues(Arrays.asList("xzkrrcoi", "sbamnppcc"))))) + .withOr(Arrays.asList(new QueryFilter() + .withAnd(Arrays.asList( + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("axyfukzxuizhyhn") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("peti") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("xdukecpxd") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("dhctmmko") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("trpc") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("iofkbtfmh") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("vcb") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("zyqu") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("rp") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new QueryComparisonExpression().withName("uyu") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new QueryComparisonExpression().withName("vlm") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("colbmxlb", "w"))) + .withTags(new QueryComparisonExpression().withName("cpahprzrvxhm") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("ocnxz"))))) + .withDimensions(new QueryComparisonExpression().withName("jhngxnoq") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("aajquhuxylrj", "m", "ygjbmzyospspsh"))) - .withTags(new QueryComparisonExpression().withName("fkyjpmspbpssdfpp") + .withValues(Arrays.asList("disnj", "vhdl", "ydidwhepfwwtjf", "o"))) + .withTags(new QueryComparisonExpression().withName("xxhmwcdbc") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("tieyujtvczkcny")))); + .withValues(Arrays.asList("ikxkxhneg", "njzrbhtmeplvu", "aobrlbp")))); model = BinaryData.fromObject(model).toObject(QueryDataset.class); Assertions.assertEquals(GranularityType.DAILY, model.granularity()); - Assertions.assertEquals("ubwefqs", model.configuration().columns().get(0)); - Assertions.assertEquals("aqtferr", model.aggregation().get("ex").name()); - Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("ex").function()); - Assertions.assertEquals(QueryColumnType.DIMENSION, model.grouping().get(0).type()); - Assertions.assertEquals("xap", model.grouping().get(0).name()); - Assertions.assertEquals("i", model.filter().and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("nucaephblkwqpat", model.configuration().columns().get(0)); + Assertions.assertEquals("rzcdbanf", model.aggregation().get("ds").name()); + Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("ds").function()); + Assertions.assertEquals(QueryColumnType.TAG_KEY, model.grouping().get(0).type()); + Assertions.assertEquals("eatkdbmwnrdj", model.grouping().get(0).name()); + Assertions.assertEquals("zwjjzr", model.filter().and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("sdaultxij", model.filter().and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("xldzyyfytpqsix", model.filter().and().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("xynqnz", model.filter().and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("ykycndzfqi", model.filter().and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("sovwxznptgoeiyb", model.filter().and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("euy", model.filter().and().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("kzobgopxlhsln", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals("gqgdminictteajoh", model.filter().and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("ieixynllxe", model.filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("fdwfmvigorqj", model.filter().and().get(0).tags().name()); + Assertions.assertEquals("spnbonhpcz", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("gy", model.filter().and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().and().get(0).tags().operator()); - Assertions.assertEquals("zhraglkafh", model.filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("pv", model.filter().or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("lod", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("axyfukzxuizhyhn", model.filter().or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("ylnio", model.filter().or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("peti", model.filter().or().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("zvaylptrsqqw", model.filter().or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("trpc", model.filter().or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("mwqkchcxwaxf", model.filter().or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("iofkbtfmh", model.filter().or().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("rgywwp", model.filter().or().get(0).dimensions().name()); + Assertions.assertEquals("vlm", model.filter().or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("snptfujgicgaao", model.filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("ttaqutdew", model.filter().or().get(0).tags().name()); + Assertions.assertEquals("colbmxlb", model.filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("cpahprzrvxhm", model.filter().or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().or().get(0).tags().operator()); - Assertions.assertEquals("swvr", model.filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("knlqwzdvpiwhxqsz", model.filter().dimensions().name()); + Assertions.assertEquals("ocnxz", model.filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("jhngxnoq", model.filter().dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().dimensions().operator()); - Assertions.assertEquals("aajquhuxylrj", model.filter().dimensions().values().get(0)); - Assertions.assertEquals("fkyjpmspbpssdfpp", model.filter().tags().name()); + Assertions.assertEquals("disnj", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("xxhmwcdbc", model.filter().tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.filter().tags().operator()); - Assertions.assertEquals("tieyujtvczkcny", model.filter().tags().values().get(0)); + Assertions.assertEquals("ikxkxhneg", model.filter().tags().values().get(0)); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDefinitionTests.java index c221b380bf6c..973981f82db3 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -29,124 +29,159 @@ public final class QueryDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryDefinition model = BinaryData.fromString( - "{\"type\":\"ActualCost\",\"timeframe\":\"TheLastMonth\",\"timePeriod\":{\"from\":\"2021-05-25T04:49:26Z\",\"to\":\"2021-07-27T14:18:56Z\"},\"dataset\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"gzfc\",\"bgomfgbegl\"]},\"aggregation\":{\"uankrrfxeeeb\":{\"name\":\"eohibet\",\"function\":\"Sum\"},\"cvbmqzb\":{\"name\":\"ij\",\"function\":\"Sum\"},\"aj\":{\"name\":\"q\",\"function\":\"Sum\"},\"cevehjkuyxoafg\":{\"name\":\"nw\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"tfaeyl\"},{\"type\":\"TagKey\",\"name\":\"mfgvxirpghriypo\"}],\"filter\":{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"prlpy\",\"operator\":\"In\",\"values\":[\"ciqdsme\",\"iitdfuxt\"]},\"tags\":{\"name\":\"siibmiybnnustgn\",\"operator\":\"In\",\"values\":[\"nmgixh\",\"mavmq\",\"oudorhcgyyp\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"undmbx\",\"operator\":\"In\",\"values\":[\"cmjkavlgorbmftpm\",\"tzfjltf\"]},\"tags\":{\"name\":\"zcyjtot\",\"operator\":\"In\",\"values\":[\"pvpbdbzqgqqiheds\"]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ky\",\"operator\":\"In\",\"values\":[\"ysi\",\"sgqcwdho\"]},\"tags\":{\"name\":\"dtmcd\",\"operator\":\"In\",\"values\":[\"fcohdxbzlmcmu\",\"pcvhdbevwqqxeys\",\"onqzinkfkbgbzbow\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ygvkzqkjj\",\"operator\":\"In\",\"values\":[\"bzefezr\",\"cczurtlei\",\"q\",\"bkwvzg\"]},\"tags\":{\"name\":\"v\",\"operator\":\"In\",\"values\":[\"zdix\",\"mqpnoda\"]}}],\"dimensions\":{\"name\":\"pqhe\",\"operator\":\"In\",\"values\":[\"tmcg\",\"bostzel\",\"dlat\",\"tmzlbiojlv\"]},\"tags\":{\"name\":\"rbbpneqvcwwyy\",\"operator\":\"In\",\"values\":[\"ochpprpr\",\"nmokayzejnhlbk\",\"bzpcpiljhahzvec\",\"ndbnwieh\"]}}}}") + "{\"type\":\"AmortizedCost\",\"timeframe\":\"TheLastBillingMonth\",\"timePeriod\":{\"from\":\"2021-04-15T20:38:42Z\",\"to\":\"2021-08-30T09:26:59Z\"},\"dataset\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"lialwcjgckbbcccg\",\"praoxn\",\"uffatsgftipwc\"]},\"aggregation\":{\"nuhzafccnuh\":{\"name\":\"ubhiqdxyur\",\"function\":\"Sum\"},\"yl\":{\"name\":\"i\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"vxva\"},{\"type\":\"TagKey\",\"name\":\"crkdlbn\"},{\"type\":\"Dimension\",\"name\":\"xvhcs\"}],\"filter\":{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"ov\",\"operator\":\"In\",\"values\":[\"xdndsbdweaderzm\",\"ntopa\"]},\"tags\":{\"name\":\"tmvmmagoaqylkjz\",\"operator\":\"In\",\"values\":[\"uazjcgmxitpfinz\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"rlgjm\",\"operator\":\"In\",\"values\":[\"rvcqguefzhomphe\",\"durelyujl\",\"youmpc\"]},\"tags\":{\"name\":\"eclcdigptajbrzm\",\"operator\":\"In\",\"values\":[\"cycijoclxiut\",\"jc\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"nrqjbtxjea\",\"operator\":\"In\",\"values\":[\"qbzg\",\"hfw\",\"v\",\"atbwbqam\"]},\"tags\":{\"name\":\"uliyslpkcv\",\"operator\":\"In\",\"values\":[\"auxxepmyw\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ciijqpkzfbojxj\",\"operator\":\"In\",\"values\":[\"myqwixvcpwnkwywz\",\"ofalickduoiqtam\",\"yvsk\",\"xrwzawnvsbcf\"]},\"tags\":{\"name\":\"agxnvhycvdimw\",\"operator\":\"In\",\"values\":[\"e\",\"zgyufutrwp\",\"eryekzkdhmeottaw\",\"yos\"]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"jtfvpndpmiljpn\",\"operator\":\"In\",\"values\":[\"udqll\",\"sauzpjlx\"]},\"tags\":{\"name\":\"huxiqhzlraymez\",\"operator\":\"In\",\"values\":[\"kihmxrfdsajredn\",\"yyshtuwgmevua\",\"pwzyi\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"txeqi\",\"operator\":\"In\",\"values\":[\"zdyi\",\"sfayorpravkjoges\",\"abnsmj\",\"wynqxaekqsykvwj\"]},\"tags\":{\"name\":\"pkevmylt\",\"operator\":\"In\",\"values\":[\"spxklu\",\"cclfgxannn\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"sewxigpxvkqm\",\"operator\":\"In\",\"values\":[\"xvpif\",\"f\",\"ify\"]},\"tags\":{\"name\":\"zeyuubeidszl\",\"operator\":\"In\",\"values\":[\"oithg\"]}}],\"dimensions\":{\"name\":\"vfltgvdi\",\"operator\":\"In\",\"values\":[\"nkrxwetwkdrcy\",\"ucpcunnuzdqumoen\",\"dnaienhqhskndnel\"]},\"tags\":{\"name\":\"aadl\",\"operator\":\"In\",\"values\":[\"foanniyopetx\"]}}}}") .toObject(QueryDefinition.class); - Assertions.assertEquals(ExportType.ACTUAL_COST, model.type()); - Assertions.assertEquals(TimeframeType.THE_LAST_MONTH, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-25T04:49:26Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T14:18:56Z"), model.timePeriod().to()); + Assertions.assertEquals(ExportType.AMORTIZED_COST, model.type()); + Assertions.assertEquals(TimeframeType.THE_LAST_BILLING_MONTH, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T20:38:42Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T09:26:59Z"), model.timePeriod().to()); Assertions.assertEquals(GranularityType.DAILY, model.dataset().granularity()); - Assertions.assertEquals("gzfc", model.dataset().configuration().columns().get(0)); - Assertions.assertEquals("eohibet", model.dataset().aggregation().get("uankrrfxeeeb").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("uankrrfxeeeb").function()); + Assertions.assertEquals("lialwcjgckbbcccg", model.dataset().configuration().columns().get(0)); + Assertions.assertEquals("ubhiqdxyur", model.dataset().aggregation().get("nuhzafccnuh").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("nuhzafccnuh").function()); Assertions.assertEquals(QueryColumnType.TAG_KEY, model.dataset().grouping().get(0).type()); - Assertions.assertEquals("tfaeyl", model.dataset().grouping().get(0).name()); - Assertions.assertEquals("prlpy", model.dataset().filter().and().get(0).dimensions().name()); + Assertions.assertEquals("vxva", model.dataset().grouping().get(0).name()); + Assertions.assertEquals("ov", model.dataset().filter().and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("ciqdsme", model.dataset().filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("siibmiybnnustgn", model.dataset().filter().and().get(0).tags().name()); + Assertions.assertEquals("xdndsbdweaderzm", model.dataset().filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("tmvmmagoaqylkjz", model.dataset().filter().and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().and().get(0).tags().operator()); - Assertions.assertEquals("nmgixh", model.dataset().filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("ygvkzqkjj", model.dataset().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("uazjcgmxitpfinz", model.dataset().filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("ciijqpkzfbojxj", model.dataset().filter().or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("bzefezr", model.dataset().filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("v", model.dataset().filter().or().get(0).tags().name()); + Assertions.assertEquals("myqwixvcpwnkwywz", model.dataset().filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("agxnvhycvdimw", model.dataset().filter().or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().or().get(0).tags().operator()); - Assertions.assertEquals("zdix", model.dataset().filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("pqhe", model.dataset().filter().dimensions().name()); + Assertions.assertEquals("e", model.dataset().filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("vfltgvdi", model.dataset().filter().dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().dimensions().operator()); - Assertions.assertEquals("tmcg", model.dataset().filter().dimensions().values().get(0)); - Assertions.assertEquals("rbbpneqvcwwyy", model.dataset().filter().tags().name()); + Assertions.assertEquals("nkrxwetwkdrcy", model.dataset().filter().dimensions().values().get(0)); + Assertions.assertEquals("aadl", model.dataset().filter().tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().tags().operator()); - Assertions.assertEquals("ochpprpr", model.dataset().filter().tags().values().get(0)); + Assertions.assertEquals("foanniyopetx", model.dataset().filter().tags().values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QueryDefinition model = new QueryDefinition().withType(ExportType.ACTUAL_COST) - .withTimeframe(TimeframeType.THE_LAST_MONTH) - .withTimePeriod(new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-05-25T04:49:26Z")) - .withTo(OffsetDateTime.parse("2021-07-27T14:18:56Z"))) - .withDataset(new QueryDataset().withGranularity(GranularityType.DAILY) - .withConfiguration(new QueryDatasetConfiguration().withColumns(Arrays.asList("gzfc", "bgomfgbegl"))) - .withAggregation( - mapOf("uankrrfxeeeb", new QueryAggregation().withName("eohibet").withFunction(FunctionType.SUM), - "cvbmqzb", new QueryAggregation().withName("ij").withFunction(FunctionType.SUM), "aj", - new QueryAggregation().withName("q").withFunction(FunctionType.SUM), "cevehjkuyxoafg", - new QueryAggregation().withName("nw").withFunction(FunctionType.SUM))) - .withGrouping(Arrays.asList(new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("tfaeyl"), - new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("mfgvxirpghriypo"))) - .withFilter(new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("prlpy") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ciqdsme", "iitdfuxt"))) - .withTags(new QueryComparisonExpression().withName("siibmiybnnustgn") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("nmgixh", "mavmq", "oudorhcgyyp"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("undmbx") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("cmjkavlgorbmftpm", "tzfjltf"))) - .withTags(new QueryComparisonExpression().withName("zcyjtot") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("pvpbdbzqgqqiheds"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ky") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ysi", "sgqcwdho"))) - .withTags(new QueryComparisonExpression().withName("dtmcd") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("fcohdxbzlmcmu", "pcvhdbevwqqxeys", "onqzinkfkbgbzbow"))))) - .withOr(Arrays.asList(new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ygvkzqkjj") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("bzefezr", "cczurtlei", "q", "bkwvzg"))) - .withTags(new QueryComparisonExpression().withName("v") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("zdix", "mqpnoda"))))) - .withDimensions(new QueryComparisonExpression().withName("pqhe") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("tmcg", "bostzel", "dlat", "tmzlbiojlv"))) - .withTags(new QueryComparisonExpression().withName("rbbpneqvcwwyy") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ochpprpr", "nmokayzejnhlbk", "bzpcpiljhahzvec", "ndbnwieh"))))); + QueryDefinition model + = new QueryDefinition().withType(ExportType.AMORTIZED_COST) + .withTimeframe(TimeframeType.THE_LAST_BILLING_MONTH) + .withTimePeriod(new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-04-15T20:38:42Z")) + .withTo(OffsetDateTime.parse("2021-08-30T09:26:59Z"))) + .withDataset( + new QueryDataset().withGranularity(GranularityType.DAILY) + .withConfiguration(new QueryDatasetConfiguration() + .withColumns(Arrays.asList("lialwcjgckbbcccg", "praoxn", "uffatsgftipwc"))) + .withAggregation(mapOf( + "nuhzafccnuh", new QueryAggregation().withName("ubhiqdxyur").withFunction(FunctionType.SUM), + "yl", new QueryAggregation().withName("i").withFunction(FunctionType.SUM))) + .withGrouping( + Arrays.asList(new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("vxva"), + new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("crkdlbn"), + new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("xvhcs"))) + .withFilter( + new QueryFilter() + .withAnd(Arrays.asList( + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("ov") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("xdndsbdweaderzm", "ntopa"))) + .withTags(new QueryComparisonExpression().withName("tmvmmagoaqylkjz") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("uazjcgmxitpfinz"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("rlgjm") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("rvcqguefzhomphe", "durelyujl", "youmpc"))) + .withTags(new QueryComparisonExpression().withName("eclcdigptajbrzm") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("cycijoclxiut", "jc"))), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("nrqjbtxjea") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("qbzg", "hfw", "v", "atbwbqam"))) + .withTags(new QueryComparisonExpression().withName("uliyslpkcv") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("auxxepmyw"))))) + .withOr(Arrays.asList( + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("ciijqpkzfbojxj") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("myqwixvcpwnkwywz", "ofalickduoiqtam", "yvsk", + "xrwzawnvsbcf"))) + .withTags(new QueryComparisonExpression() + .withName("agxnvhycvdimw") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("e", "zgyufutrwp", "eryekzkdhmeottaw", "yos"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("jtfvpndpmiljpn") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("udqll", "sauzpjlx"))) + .withTags(new QueryComparisonExpression().withName("huxiqhzlraymez") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("kihmxrfdsajredn", "yyshtuwgmevua", "pwzyi"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withDimensions( + new QueryComparisonExpression().withName("txeqi") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("zdyi", "sfayorpravkjoges", "abnsmj", + "wynqxaekqsykvwj"))) + .withTags(new QueryComparisonExpression().withName("pkevmylt") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("spxklu", "cclfgxannn"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("sewxigpxvkqm") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("xvpif", "f", "ify"))) + .withTags(new QueryComparisonExpression().withName("zeyuubeidszl") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("oithg"))))) + .withDimensions(new QueryComparisonExpression().withName("vfltgvdi") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("nkrxwetwkdrcy", "ucpcunnuzdqumoen", "dnaienhqhskndnel"))) + .withTags(new QueryComparisonExpression().withName("aadl") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("foanniyopetx"))))); model = BinaryData.fromObject(model).toObject(QueryDefinition.class); - Assertions.assertEquals(ExportType.ACTUAL_COST, model.type()); - Assertions.assertEquals(TimeframeType.THE_LAST_MONTH, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-25T04:49:26Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T14:18:56Z"), model.timePeriod().to()); + Assertions.assertEquals(ExportType.AMORTIZED_COST, model.type()); + Assertions.assertEquals(TimeframeType.THE_LAST_BILLING_MONTH, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T20:38:42Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T09:26:59Z"), model.timePeriod().to()); Assertions.assertEquals(GranularityType.DAILY, model.dataset().granularity()); - Assertions.assertEquals("gzfc", model.dataset().configuration().columns().get(0)); - Assertions.assertEquals("eohibet", model.dataset().aggregation().get("uankrrfxeeeb").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("uankrrfxeeeb").function()); + Assertions.assertEquals("lialwcjgckbbcccg", model.dataset().configuration().columns().get(0)); + Assertions.assertEquals("ubhiqdxyur", model.dataset().aggregation().get("nuhzafccnuh").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataset().aggregation().get("nuhzafccnuh").function()); Assertions.assertEquals(QueryColumnType.TAG_KEY, model.dataset().grouping().get(0).type()); - Assertions.assertEquals("tfaeyl", model.dataset().grouping().get(0).name()); - Assertions.assertEquals("prlpy", model.dataset().filter().and().get(0).dimensions().name()); + Assertions.assertEquals("vxva", model.dataset().grouping().get(0).name()); + Assertions.assertEquals("ov", model.dataset().filter().and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("ciqdsme", model.dataset().filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("siibmiybnnustgn", model.dataset().filter().and().get(0).tags().name()); + Assertions.assertEquals("xdndsbdweaderzm", model.dataset().filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("tmvmmagoaqylkjz", model.dataset().filter().and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().and().get(0).tags().operator()); - Assertions.assertEquals("nmgixh", model.dataset().filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("ygvkzqkjj", model.dataset().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("uazjcgmxitpfinz", model.dataset().filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("ciijqpkzfbojxj", model.dataset().filter().or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("bzefezr", model.dataset().filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("v", model.dataset().filter().or().get(0).tags().name()); + Assertions.assertEquals("myqwixvcpwnkwywz", model.dataset().filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("agxnvhycvdimw", model.dataset().filter().or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().or().get(0).tags().operator()); - Assertions.assertEquals("zdix", model.dataset().filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("pqhe", model.dataset().filter().dimensions().name()); + Assertions.assertEquals("e", model.dataset().filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("vfltgvdi", model.dataset().filter().dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().dimensions().operator()); - Assertions.assertEquals("tmcg", model.dataset().filter().dimensions().values().get(0)); - Assertions.assertEquals("rbbpneqvcwwyy", model.dataset().filter().tags().name()); + Assertions.assertEquals("nkrxwetwkdrcy", model.dataset().filter().dimensions().values().get(0)); + Assertions.assertEquals("aadl", model.dataset().filter().tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dataset().filter().tags().operator()); - Assertions.assertEquals("ochpprpr", model.dataset().filter().tags().values().get(0)); + Assertions.assertEquals("foanniyopetx", model.dataset().filter().tags().values().get(0)); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryFilterTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryFilterTests.java index 10dc18842b9c..654614ac6477 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryFilterTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryFilterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -15,50 +15,50 @@ public final class QueryFilterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryFilter model = BinaryData.fromString( - "{\"and\":[{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"zgp\",\"operator\":\"In\",\"values\":[\"vhjknidi\",\"gqjxgpnrhgovfgp\",\"kqmhhaowjr\"]},\"tags\":{\"name\":\"vuporqzdfuydzv\",\"operator\":\"In\",\"values\":[\"xcnqmxqpswokmvkh\",\"ggdhbemzqkzszuw\",\"wtglxx\"]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"picrmnzhrgmqgjsx\",\"operator\":\"In\",\"values\":[\"cbfrm\",\"odth\",\"qqgvriibakcla\"]},\"tags\":{\"name\":\"fr\",\"operator\":\"In\",\"values\":[\"usx\",\"uzlwvsgmw\",\"hqf\",\"izvu\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"vthn\",\"operator\":\"In\",\"values\":[\"tekovmri\"]},\"tags\":{\"name\":\"attgplu\",\"operator\":\"In\",\"values\":[\"tangcfhnykzcu\",\"swvxwlmzqwmv\",\"xnjmxm\",\"uqudtcvclxyn\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"uiyjib\",\"operator\":\"In\",\"values\":[\"hdugneiknpg\"]},\"tags\":{\"name\":\"gjiuqhibto\",\"operator\":\"In\",\"values\":[\"qw\",\"edmurrxxge\"]}}],\"dimensions\":{\"name\":\"ktvqylkmqpzoy\",\"operator\":\"In\",\"values\":[\"bcg\",\"gcl\",\"xoe\",\"qinjipnwjf\"]},\"tags\":{\"name\":\"qlafcbahhpzpofoi\",\"operator\":\"In\",\"values\":[\"p\"]}}],\"or\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"vdndviauo\",\"operator\":\"In\",\"values\":[\"uartvti\",\"kyefchnmnahmnxhk\"]},\"tags\":{\"name\":\"qirwrweoox\",\"operator\":\"In\",\"values\":[\"fhxwrsne\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"bubqmamhsycxh\",\"operator\":\"In\",\"values\":[\"azttaboidvmfq\",\"ppu\"]},\"tags\":{\"name\":\"w\",\"operator\":\"In\",\"values\":[\"dfgkmtdh\",\"rngbtcjuahokqtob\",\"auxofshfph\",\"pnulaiywzej\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"jpllndnpdwrpq\",\"operator\":\"In\",\"values\":[\"fugsnnfhyetefy\",\"oc\",\"ctfjgtixr\"]},\"tags\":{\"name\":\"zuyt\",\"operator\":\"In\",\"values\":[\"lmuowo\",\"bauiropi\"]}}],\"dimensions\":{\"name\":\"szonwpngajinn\",\"operator\":\"In\",\"values\":[\"awrtmjfjmyccxlz\",\"coxovn\",\"khenlus\"]},\"tags\":{\"name\":\"rd\",\"operator\":\"In\",\"values\":[\"txrdcqtjvi\",\"ttgepuslvyjtcv\",\"wkasiziesf\",\"ughtuqfecjxeygtu\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"wmrswnjlxuzrh\",\"operator\":\"In\",\"values\":[\"sxjb\",\"qehgpd\",\"hzjqatucoige\"]},\"tags\":{\"name\":\"ncnwfepbnwgf\",\"operator\":\"In\",\"values\":[\"gcgbjb\",\"dlfgtdysnaq\",\"flq\",\"ctqhamzjrwdk\"]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"leziunjxdfzant\",\"operator\":\"In\",\"values\":[\"eg\",\"amlbnseqacjjvpil\",\"uooqjagmdit\",\"ueio\"]},\"tags\":{\"name\":\"jbsahrtdtpde\",\"operator\":\"In\",\"values\":[\"cslmotoebnfxo\"]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"dirazf\",\"operator\":\"In\",\"values\":[\"jwabmd\",\"jtmvc\",\"pexcmjurbuhh\",\"kyqltqsrogt\"]},\"tags\":{\"name\":\"kffdjktsys\",\"operator\":\"In\",\"values\":[\"vclglxnfuij\"]}}],\"or\":[{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"sfikayiansharuj\",\"operator\":\"In\",\"values\":[\"qxfzyjqttvwk\"]},\"tags\":{\"name\":\"hjpenuygbq\",\"operator\":\"In\",\"values\":[\"ekewvnqvcdlguauc\",\"f\",\"jwnlax\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"kczvvita\",\"operator\":\"In\",\"values\":[\"mfcsserx\",\"tvsoxhlwntsj\",\"qrsxyp\"]},\"tags\":{\"name\":\"uuybnchrsz\",\"operator\":\"In\",\"values\":[\"yuel\",\"etndnbfqyggagf\",\"nlgmtrwahzjmu\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"plrohkpigq\",\"operator\":\"In\",\"values\":[\"u\",\"kzmkwklsnoxaxmqe\"]},\"tags\":{\"name\":\"lhhjnh\",\"operator\":\"In\",\"values\":[\"dyynfsvkhgb\",\"qtanarfdlpuk\",\"py\"]}}],\"dimensions\":{\"name\":\"eizjcpeogkhnmg\",\"operator\":\"In\",\"values\":[\"uxddbhfh\",\"fpazjzoywjxhpd\",\"lontacnpq\",\"tehtuevrhrljyoog\"]},\"tags\":{\"name\":\"hnsduugwbsreur\",\"operator\":\"In\",\"values\":[\"fuarenlvhht\",\"lnvnafvvkyfedev\",\"bo\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"kkhminqcymczngn\",\"operator\":\"In\",\"values\":[\"x\",\"wuninv\"]},\"tags\":{\"name\":\"bchaqd\",\"operator\":\"In\",\"values\":[\"ec\",\"qct\",\"xxdtddmflh\"]}},{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"tznapxbannovv\",\"operator\":\"In\",\"values\":[\"zytprwnwvroevy\",\"lyokrrrou\"]},\"tags\":{\"name\":\"vnsasbcrymodi\",\"operator\":\"In\",\"values\":[\"klobdxnazpmk\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"f\",\"operator\":\"In\",\"values\":[\"pj\"]},\"tags\":{\"name\":\"zxlioh\",\"operator\":\"In\",\"values\":[\"dtfgxqbawpcbb\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"napqo\",\"operator\":\"In\",\"values\":[\"icdhz\",\"dyb\",\"wgbdvibidmhmwffp\",\"fmuvapckccr\"]},\"tags\":{\"name\":\"weyoxoy\",\"operator\":\"In\",\"values\":[\"phaimmoi\"]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"ragapyyrmfsvbp\",\"operator\":\"In\",\"values\":[\"opfppdbwnupgah\",\"kuma\",\"jcaacfdmmcpugm\"]},\"tags\":{\"name\":\"qepvufhbzeh\",\"operator\":\"In\",\"values\":[\"oqhnlb\",\"nbldxeaclgschori\"]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"moucsofldpuviyfc\",\"operator\":\"In\",\"values\":[\"eolhbhlvbmx\",\"qi\"]},\"tags\":{\"name\":\"xtkcudfbsfar\",\"operator\":\"In\",\"values\":[\"owlkjxnqpv\"]}}],\"dimensions\":{\"name\":\"fstmhqykizmdksao\",\"operator\":\"In\",\"values\":[\"luqvoxmycjimryv\",\"gc\"]},\"tags\":{\"name\":\"pbmz\",\"operator\":\"In\",\"values\":[\"sydsxwefohe\",\"bvopwndyqle\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"hlowkx\",\"operator\":\"In\",\"values\":[\"br\",\"fjmzsyzfho\",\"lhikcyychunsj\",\"pjrtws\"]},\"tags\":{\"name\":\"vv\",\"operator\":\"In\",\"values\":[\"phvtrrmhwrb\"]}},{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"ubhvj\",\"operator\":\"In\",\"values\":[\"ocu\"]},\"tags\":{\"name\":\"lw\",\"operator\":\"In\",\"values\":[\"emhooclutnpq\",\"emc\",\"jk\",\"mykyujxsglhs\"]}},{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"ylmbkzudni\",\"operator\":\"In\",\"values\":[\"ihotjewlpxuzzjg\",\"refqy\"]},\"tags\":{\"name\":\"otoihiqa\",\"operator\":\"In\",\"values\":[\"iwfbrkwpzdqtvhcs\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"ipietgbe\",\"operator\":\"In\",\"values\":[\"ulbmoichdlp\",\"fpubntnbatz\",\"iqsowsaaelc\"]},\"tags\":{\"name\":\"tc\",\"operator\":\"In\",\"values\":[\"plrvkmjcwmjvlg\",\"ggcvk\",\"y\",\"izrzb\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"fuzt\",\"operator\":\"In\",\"values\":[\"mvagbwidqlvhuko\",\"eofiz\"]},\"tags\":{\"name\":\"jfnmjmvlwyz\",\"operator\":\"In\",\"values\":[\"lkujrllfojui\",\"jpu\",\"yjucejikzoeo\",\"vtzejetjklnti\"]}}],\"dimensions\":{\"name\":\"juzkdbqz\",\"operator\":\"In\",\"values\":[\"rzvh\",\"jwtrhtgvgzp\",\"rrkolawjmjs\",\"wro\"]},\"tags\":{\"name\":\"dxfzzzwyjaf\",\"operator\":\"In\",\"values\":[\"hguynuchlgmltxdw\",\"mozusgzvlnsnnjz\"]}}],\"dimensions\":{\"name\":\"afolpymwamxqzrag\",\"operator\":\"In\",\"values\":[\"phtvdu\",\"a\"]},\"tags\":{\"name\":\"lejchcsr\",\"operator\":\"In\",\"values\":[\"nmzlanru\",\"dwv\",\"phcnzqtpj\",\"mqrhvthl\"]}}") + "{\"and\":[{\"and\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"agdrcls\",\"operator\":\"In\",\"values\":[\"jomevtfycnlb\",\"gjco\"]},\"tags\":{\"name\":\"kgjiiytssikizbc\",\"operator\":\"In\",\"values\":[\"bvntnrgmqsorhce\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"xcpwzvmdok\",\"operator\":\"In\",\"values\":[\"tiwlwxlboncqb\"]},\"tags\":{\"name\":\"qicqchygt\",\"operator\":\"In\",\"values\":[\"yjanepubdp\",\"xyqvg\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"tvo\",\"operator\":\"In\",\"values\":[\"dxuwsaifm\",\"wnosbzlehgcvkbck\",\"jolgjyyxpvels\"]},\"tags\":{\"name\":\"rqz\",\"operator\":\"In\",\"values\":[\"o\",\"eintxwaljglzobl\",\"waafrqulh\"]}}],\"dimensions\":{\"name\":\"yqbhd\",\"operator\":\"In\",\"values\":[\"jrqpjiyrqjcrga\",\"wmzwdfkbnrzorpdl\",\"bqc\"]},\"tags\":{\"name\":\"jfgxxsaetg\",\"operator\":\"In\",\"values\":[\"vpyigdaqq\",\"lzdcduwjoedxng\",\"caifpaurww\",\"ilfjqqacdmk\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"cyziakeci\",\"operator\":\"In\",\"values\":[\"xrtuicds\"]},\"tags\":{\"name\":\"dfmmpzhzzwvy\",\"operator\":\"In\",\"values\":[\"yngydgrpxncaki\",\"aondjrkclamgg\",\"vlmfej\",\"oqeykglt\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"gqkayejsxtl\",\"operator\":\"In\",\"values\":[\"wf\",\"ziiucij\"]},\"tags\":{\"name\":\"eatlijjjrtvamcas\",\"operator\":\"In\",\"values\":[\"xk\",\"ccxetyvkun\",\"ignohi\",\"kgqogjw\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"bbxbhmed\",\"operator\":\"In\",\"values\":[\"bjywfcfxzi\",\"zzihvwy\",\"usuv\",\"slczwciidjsllf\"]},\"tags\":{\"name\":\"vdmvxadqa\",\"operator\":\"In\",\"values\":[\"gna\",\"bab\",\"fbktyjmfczlf\"]}}],\"dimensions\":{\"name\":\"qkfrbzgowoxqmj\",\"operator\":\"In\",\"values\":[\"cxn\"]},\"tags\":{\"name\":\"gxhlusr\",\"operator\":\"In\",\"values\":[\"simjceagbjqvlsu\"]}}],\"or\":[{\"and\":[{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"noy\",\"operator\":\"In\",\"values\":[\"ipubyznclkfk\",\"ebgvo\"]},\"tags\":{\"name\":\"m\",\"operator\":\"In\",\"values\":[\"qujlyegqa\",\"nigflqqbtnyj\",\"ylxd\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"vmsxbaevwjcnkot\",\"operator\":\"In\",\"values\":[\"uhvajmailfemjjza\",\"zwjiqullq\"]},\"tags\":{\"name\":\"dmvr\",\"operator\":\"In\",\"values\":[\"qern\",\"brnyeofltfnnx\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ynnfmuiii\",\"operator\":\"In\",\"values\":[\"fohyk\"]},\"tags\":{\"name\":\"xbbcbrw\",\"operator\":\"In\",\"values\":[\"tgnjizbeewoiymrv\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"srziuct\",\"operator\":\"In\",\"values\":[\"bdsuifr\",\"vka\",\"pezkis\"]},\"tags\":{\"name\":\"jm\",\"operator\":\"In\",\"values\":[\"syparybjufp\",\"bjczjnciuiyqvlda\",\"wvppi\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"dhzxrrfcfsrh\",\"operator\":\"In\",\"values\":[\"s\",\"xuwwkp\"]},\"tags\":{\"name\":\"efsbzxlbz\",\"operator\":\"In\",\"values\":[\"eikjclwza\",\"nmwpf\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"zyqbxyxoyfpuq\",\"operator\":\"In\",\"values\":[\"ezxlhdjzqdca\",\"wvpsoz\"]},\"tags\":{\"name\":\"ih\",\"operator\":\"In\",\"values\":[\"ybmrzoepnxwd\",\"wnjkgvfn\",\"xaurs\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"yibuyvpirfqjpnqn\",\"operator\":\"In\",\"values\":[\"sbede\"]},\"tags\":{\"name\":\"exkxbhx\",\"operator\":\"In\",\"values\":[\"nul\",\"mnhjevdyzn\",\"ajsvk\",\"kmq\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"yhjrliizji\",\"operator\":\"In\",\"values\":[\"fhefk\",\"absol\",\"onqqlmgn\"]},\"tags\":{\"name\":\"xsjxtelexhvuqboz\",\"operator\":\"In\",\"values\":[\"zqocarku\",\"lbcnndt\"]}}],\"dimensions\":{\"name\":\"xawqy\",\"operator\":\"In\",\"values\":[\"hd\",\"z\",\"yckzex\"]},\"tags\":{\"name\":\"akckywym\",\"operator\":\"In\",\"values\":[\"abjkdtfohfao\",\"zvkiwrsiwdy\",\"quryk\",\"rra\"]}}],\"dimensions\":{\"name\":\"ekcsueh\",\"operator\":\"In\",\"values\":[\"dac\",\"cbgydlqi\",\"ywmhmptyrilkfbnr\",\"qxvztpbnfnqtxjt\"]},\"tags\":{\"name\":\"alswbnfd\",\"operator\":\"In\",\"values\":[\"ldwq\"]}}") .toObject(QueryFilter.class); - Assertions.assertEquals("zgp", model.and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("agdrcls", model.and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("vhjknidi", model.and().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("vuporqzdfuydzv", model.and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("jomevtfycnlb", model.and().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("kgjiiytssikizbc", model.and().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("xcnqmxqpswokmvkh", model.and().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("uiyjib", model.and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("bvntnrgmqsorhce", model.and().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("xcpwzvmdok", model.and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("hdugneiknpg", model.and().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("gjiuqhibto", model.and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("tiwlwxlboncqb", model.and().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("qicqchygt", model.and().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("qw", model.and().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("ktvqylkmqpzoy", model.and().get(0).dimensions().name()); + Assertions.assertEquals("yjanepubdp", model.and().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("yqbhd", model.and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).dimensions().operator()); - Assertions.assertEquals("bcg", model.and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("qlafcbahhpzpofoi", model.and().get(0).tags().name()); + Assertions.assertEquals("jrqpjiyrqjcrga", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("jfgxxsaetg", model.and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).tags().operator()); - Assertions.assertEquals("p", model.and().get(0).tags().values().get(0)); - Assertions.assertEquals("vdndviauo", model.or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("vpyigdaqq", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("noy", model.or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("uartvti", model.or().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("qirwrweoox", model.or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("ipubyznclkfk", model.or().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("m", model.or().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("fhxwrsne", model.or().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("jpllndnpdwrpq", model.or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("qujlyegqa", model.or().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("dhzxrrfcfsrh", model.or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("fugsnnfhyetefy", model.or().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("zuyt", model.or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("s", model.or().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("efsbzxlbz", model.or().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("lmuowo", model.or().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("szonwpngajinn", model.or().get(0).dimensions().name()); + Assertions.assertEquals("eikjclwza", model.or().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("xawqy", model.or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).dimensions().operator()); - Assertions.assertEquals("awrtmjfjmyccxlz", model.or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("rd", model.or().get(0).tags().name()); + Assertions.assertEquals("hd", model.or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("akckywym", model.or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).tags().operator()); - Assertions.assertEquals("txrdcqtjvi", model.or().get(0).tags().values().get(0)); - Assertions.assertEquals("afolpymwamxqzrag", model.dimensions().name()); + Assertions.assertEquals("abjkdtfohfao", model.or().get(0).tags().values().get(0)); + Assertions.assertEquals("ekcsueh", model.dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dimensions().operator()); - Assertions.assertEquals("phtvdu", model.dimensions().values().get(0)); - Assertions.assertEquals("lejchcsr", model.tags().name()); + Assertions.assertEquals("dac", model.dimensions().values().get(0)); + Assertions.assertEquals("alswbnfd", model.tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.tags().operator()); - Assertions.assertEquals("nmzlanru", model.tags().values().get(0)); + Assertions.assertEquals("ldwq", model.tags().values().get(0)); } @org.junit.jupiter.api.Test @@ -66,169 +66,90 @@ public void testSerialize() throws Exception { QueryFilter model = new QueryFilter() .withAnd( - Arrays.asList(new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("zgp") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("vhjknidi", "gqjxgpnrhgovfgp", "kqmhhaowjr"))) - .withTags(new QueryComparisonExpression() - .withName("vuporqzdfuydzv") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("xcnqmxqpswokmvkh", "ggdhbemzqkzszuw", "wtglxx"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("picrmnzhrgmqgjsx") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("cbfrm", "odth", "qqgvriibakcla"))) - .withTags(new QueryComparisonExpression() - .withName("fr") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("usx", "uzlwvsgmw", "hqf", "izvu"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("vthn") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("tekovmri"))) - .withTags(new QueryComparisonExpression() - .withName("attgplu") - .withOperator(QueryOperatorType.IN) - .withValues( - Arrays.asList("tangcfhnykzcu", "swvxwlmzqwmv", "xnjmxm", "uqudtcvclxyn"))))) - .withOr(Arrays.asList(new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("uiyjib") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("hdugneiknpg"))) - .withTags(new QueryComparisonExpression().withName("gjiuqhibto") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("qw", "edmurrxxge"))))) - .withDimensions(new QueryComparisonExpression().withName("ktvqylkmqpzoy") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("bcg", "gcl", "xoe", "qinjipnwjf"))) - .withTags(new QueryComparisonExpression().withName("qlafcbahhpzpofoi") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("p"))))) - .withOr( Arrays .asList( new QueryFilter() - .withAnd(Arrays.asList( + .withAnd( + Arrays + .asList( + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("agdrcls") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("jomevtfycnlb", "gjco"))) + .withTags(new QueryComparisonExpression().withName("kgjiiytssikizbc") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("bvntnrgmqsorhce"))))) + .withOr(Arrays.asList(new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), + new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("xcpwzvmdok") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("tiwlwxlboncqb"))) + .withTags(new QueryComparisonExpression().withName("qicqchygt") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("yjanepubdp", "xyqvg"))), new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("vdndviauo") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("uartvti", "kyefchnmnahmnxhk"))) - .withTags(new QueryComparisonExpression().withName("qirwrweoox") + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("tvo") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("fhxwrsne"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("bubqmamhsycxh") + .withValues( + Arrays.asList("dxuwsaifm", "wnosbzlehgcvkbck", "jolgjyyxpvels"))) + .withTags(new QueryComparisonExpression().withName("rqz") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("azttaboidvmfq", "ppu"))) - .withTags( - new QueryComparisonExpression().withName("w") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("dfgkmtdh", "rngbtcjuahokqtob", "auxofshfph", - "pnulaiywzej"))))) + .withValues(Arrays.asList("o", "eintxwaljglzobl", "waafrqulh"))))) + .withDimensions(new QueryComparisonExpression().withName("yqbhd") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("jrqpjiyrqjcrga", "wmzwdfkbnrzorpdl", "bqc"))) + .withTags(new QueryComparisonExpression().withName("jfgxxsaetg") + .withOperator(QueryOperatorType.IN) + .withValues( + Arrays.asList("vpyigdaqq", "lzdcduwjoedxng", "caifpaurww", "ilfjqqacdmk"))), + new QueryFilter() + .withAnd( + Arrays + .asList( + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("cyziakeci") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("xrtuicds"))) + .withTags(new QueryComparisonExpression().withName("dfmmpzhzzwvy") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("yngydgrpxncaki", "aondjrkclamgg", + "vlmfej", "oqeykglt"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("gqkayejsxtl") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("wf", "ziiucij"))) + .withTags(new QueryComparisonExpression().withName("eatlijjjrtvamcas") + .withOperator(QueryOperatorType.IN) + .withValues( + Arrays.asList("xk", "ccxetyvkun", "ignohi", "kgqogjw"))))) .withOr(Arrays.asList(new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("jpllndnpdwrpq") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("bbxbhmed") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("fugsnnfhyetefy", "oc", "ctfjgtixr"))) - .withTags(new QueryComparisonExpression() - .withName("zuyt") + .withValues(Arrays.asList("bjywfcfxzi", "zzihvwy", "usuv", "slczwciidjsllf"))) + .withTags(new QueryComparisonExpression().withName("vdmvxadqa") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("lmuowo", "bauiropi"))))) - .withDimensions(new QueryComparisonExpression() - .withName("szonwpngajinn") + .withValues(Arrays.asList("gna", "bab", "fbktyjmfczlf"))))) + .withDimensions(new QueryComparisonExpression().withName("qkfrbzgowoxqmj") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("awrtmjfjmyccxlz", "coxovn", "khenlus"))) - .withTags(new QueryComparisonExpression() - .withName("rd") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("txrdcqtjvi", "ttgepuslvyjtcv", "wkasiziesf", - "ughtuqfecjxeygtu"))), - new QueryFilter() - .withAnd(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("wmrswnjlxuzrh") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("sxjb", "qehgpd", "hzjqatucoige"))) - .withTags( - new QueryComparisonExpression().withName("ncnwfepbnwgf") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("gcgbjb", "dlfgtdysnaq", "flq", - "ctqhamzjrwdk"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("leziunjxdfzant") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("eg", "amlbnseqacjjvpil", "uooqjagmdit", "ueio"))) - .withTags(new QueryComparisonExpression() - .withName("jbsahrtdtpde") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("cslmotoebnfxo"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("dirazf") - .withOperator(QueryOperatorType.IN) - .withValues( - Arrays.asList("jwabmd", "jtmvc", "pexcmjurbuhh", "kyqltqsrogt"))) - .withTags(new QueryComparisonExpression().withName("kffdjktsys") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("vclglxnfuij"))))) - .withOr(Arrays.asList( - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("sfikayiansharuj") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("qxfzyjqttvwk"))) - .withTags(new QueryComparisonExpression().withName("hjpenuygbq") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ekewvnqvcdlguauc", "f", "jwnlax"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("kczvvita") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("mfcsserx", "tvsoxhlwntsj", "qrsxyp"))) - .withTags(new QueryComparisonExpression().withName("uuybnchrsz") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("yuel", "etndnbfqyggagf", "nlgmtrwahzjmu"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), - new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("plrohkpigq") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("u", "kzmkwklsnoxaxmqe"))) - .withTags(new QueryComparisonExpression().withName("lhhjnh") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("dyynfsvkhgb", "qtanarfdlpuk", "py"))))) - .withDimensions( - new QueryComparisonExpression().withName("eizjcpeogkhnmg") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("uxddbhfh", "fpazjzoywjxhpd", "lontacnpq", - "tehtuevrhrljyoog"))) - .withTags(new QueryComparisonExpression().withName("hnsduugwbsreur") + .withValues(Arrays.asList("cxn"))) + .withTags(new QueryComparisonExpression().withName("gxhlusr") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("fuarenlvhht", "lnvnafvvkyfedev", "bo"))), + .withValues(Arrays.asList("simjceagbjqvlsu"))))) + .withOr( + Arrays + .asList( new QueryFilter() .withAnd( Arrays @@ -237,175 +158,140 @@ public void testSerialize() throws Exception { .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter())) - .withDimensions( - new QueryComparisonExpression().withName("kkhminqcymczngn") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("x", "wuninv"))) + .withDimensions(new QueryComparisonExpression().withName("noy") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("ipubyznclkfk", "ebgvo"))) .withTags(new QueryComparisonExpression() - .withName("bchaqd") + .withName("m") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ec", "qct", "xxdtddmflh"))), + .withValues(Arrays.asList("qujlyegqa", "nigflqqbtnyj", "ylxd"))), new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter())) .withDimensions( - new QueryComparisonExpression().withName("tznapxbannovv") + new QueryComparisonExpression().withName("vmsxbaevwjcnkot") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("zytprwnwvroevy", "lyokrrrou"))) - .withTags(new QueryComparisonExpression().withName("vnsasbcrymodi") + .withValues(Arrays.asList("uhvajmailfemjjza", "zwjiqullq"))) + .withTags(new QueryComparisonExpression().withName("dmvr") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("klobdxnazpmk"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter())) + .withValues(Arrays.asList("qern", "brnyeofltfnnx"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("f") + .withDimensions(new QueryComparisonExpression().withName("ynnfmuiii") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("pj"))) + .withValues(Arrays.asList("fohyk"))) .withTags(new QueryComparisonExpression() - .withName("zxlioh") + .withName("xbbcbrw") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("dtfgxqbawpcbb"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withValues(Arrays.asList("tgnjizbeewoiymrv"))), + new QueryFilter() + .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), + new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("napqo") + .withDimensions(new QueryComparisonExpression().withName("srziuct") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("icdhz", "dyb", "wgbdvibidmhmwffp", - "fmuvapckccr"))) - .withTags(new QueryComparisonExpression().withName("weyoxoy") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("phaimmoi"))))) + .withValues(Arrays.asList("bdsuifr", "vka", "pezkis"))) + .withTags( + new QueryComparisonExpression().withName("jm") + .withOperator(QueryOperatorType.IN) + .withValues(Arrays.asList("syparybjufp", "bjczjnciuiyqvlda", + "wvppi"))))) .withOr(Arrays.asList( - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ragapyyrmfsvbp") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("opfppdbwnupgah", "kuma", "jcaacfdmmcpugm"))) - .withTags(new QueryComparisonExpression().withName("qepvufhbzeh") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("oqhnlb", "nbldxeaclgschori"))), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("moucsofldpuviyfc") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("dhzxrrfcfsrh") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("eolhbhlvbmx", "qi"))) - .withTags(new QueryComparisonExpression().withName("xtkcudfbsfar") + .withValues(Arrays.asList("s", "xuwwkp"))) + .withTags(new QueryComparisonExpression().withName("efsbzxlbz") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("owlkjxnqpv"))))) - .withDimensions(new QueryComparisonExpression().withName("fstmhqykizmdksao") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("luqvoxmycjimryv", "gc"))) - .withTags(new QueryComparisonExpression() - .withName("pbmz") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("sydsxwefohe", "bvopwndyqle"))), - new QueryFilter() - .withAnd(Arrays.asList( + .withValues(Arrays.asList("eikjclwza", "nmwpf"))), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("hlowkx") + .withDimensions(new QueryComparisonExpression().withName("zyqbxyxoyfpuq") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("br", "fjmzsyzfho", "lhikcyychunsj", "pjrtws"))) - .withTags(new QueryComparisonExpression().withName("vv") + .withValues(Arrays.asList("ezxlhdjzqdca", "wvpsoz"))) + .withTags(new QueryComparisonExpression().withName("ih") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("phvtrrmhwrb"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter())) + .withValues(Arrays.asList("ybmrzoepnxwd", "wnjkgvfn", "xaurs"))), + new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ubhvj") + .withDimensions(new QueryComparisonExpression().withName("yibuyvpirfqjpnqn") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ocu"))) - .withTags(new QueryComparisonExpression().withName("lw") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("emhooclutnpq", "emc", "jk", "mykyujxsglhs"))), - new QueryFilter() - .withAnd(Arrays.asList(new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ylmbkzudni") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ihotjewlpxuzzjg", "refqy"))) + .withValues(Arrays.asList("sbede"))) .withTags(new QueryComparisonExpression() - .withName("otoihiqa") + .withName("exkxbhx") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("iwfbrkwpzdqtvhcs"))))) - .withOr(Arrays.asList( + .withValues(Arrays.asList("nul", "mnhjevdyzn", "ajsvk", "kmq"))), new QueryFilter() .withAnd(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("ipietgbe") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("ulbmoichdlp", "fpubntnbatz", "iqsowsaaelc"))) - .withTags(new QueryComparisonExpression().withName("tc") - .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("plrvkmjcwmjvlg", "ggcvk", "y", "izrzb"))), - new QueryFilter().withAnd(Arrays.asList(new QueryFilter(), new QueryFilter())) - .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter())) - .withDimensions(new QueryComparisonExpression().withName("fuzt") + .withOr(Arrays.asList(new QueryFilter(), new QueryFilter(), new QueryFilter(), + new QueryFilter())) + .withDimensions(new QueryComparisonExpression().withName("yhjrliizji") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("mvagbwidqlvhuko", "eofiz"))) - .withTags(new QueryComparisonExpression().withName("jfnmjmvlwyz") + .withValues(Arrays.asList("fhefk", "absol", "onqqlmgn"))) + .withTags(new QueryComparisonExpression().withName("xsjxtelexhvuqboz") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("lkujrllfojui", "jpu", "yjucejikzoeo", - "vtzejetjklnti"))))) - .withDimensions(new QueryComparisonExpression().withName("juzkdbqz") + .withValues(Arrays.asList("zqocarku", "lbcnndt"))))) + .withDimensions(new QueryComparisonExpression().withName("xawqy") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("rzvh", "jwtrhtgvgzp", "rrkolawjmjs", "wro"))) - .withTags(new QueryComparisonExpression().withName("dxfzzzwyjaf") + .withValues(Arrays.asList("hd", "z", "yckzex"))) + .withTags(new QueryComparisonExpression().withName("akckywym") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("hguynuchlgmltxdw", "mozusgzvlnsnnjz"))))) - .withDimensions(new QueryComparisonExpression().withName("afolpymwamxqzrag") + .withValues(Arrays.asList("abjkdtfohfao", "zvkiwrsiwdy", "quryk", "rra"))))) + .withDimensions(new QueryComparisonExpression().withName("ekcsueh") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("phtvdu", "a"))) - .withTags(new QueryComparisonExpression().withName("lejchcsr") + .withValues(Arrays.asList("dac", "cbgydlqi", "ywmhmptyrilkfbnr", "qxvztpbnfnqtxjt"))) + .withTags(new QueryComparisonExpression().withName("alswbnfd") .withOperator(QueryOperatorType.IN) - .withValues(Arrays.asList("nmzlanru", "dwv", "phcnzqtpj", "mqrhvthl"))); + .withValues(Arrays.asList("ldwq"))); model = BinaryData.fromObject(model).toObject(QueryFilter.class); - Assertions.assertEquals("zgp", model.and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("agdrcls", model.and().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("vhjknidi", model.and().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("vuporqzdfuydzv", model.and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("jomevtfycnlb", model.and().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("kgjiiytssikizbc", model.and().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("xcnqmxqpswokmvkh", model.and().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("uiyjib", model.and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("bvntnrgmqsorhce", model.and().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("xcpwzvmdok", model.and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("hdugneiknpg", model.and().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("gjiuqhibto", model.and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("tiwlwxlboncqb", model.and().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("qicqchygt", model.and().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("qw", model.and().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("ktvqylkmqpzoy", model.and().get(0).dimensions().name()); + Assertions.assertEquals("yjanepubdp", model.and().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("yqbhd", model.and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).dimensions().operator()); - Assertions.assertEquals("bcg", model.and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("qlafcbahhpzpofoi", model.and().get(0).tags().name()); + Assertions.assertEquals("jrqpjiyrqjcrga", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("jfgxxsaetg", model.and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.and().get(0).tags().operator()); - Assertions.assertEquals("p", model.and().get(0).tags().values().get(0)); - Assertions.assertEquals("vdndviauo", model.or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("vpyigdaqq", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("noy", model.or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("uartvti", model.or().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("qirwrweoox", model.or().get(0).and().get(0).tags().name()); + Assertions.assertEquals("ipubyznclkfk", model.or().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("m", model.or().get(0).and().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("fhxwrsne", model.or().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("jpllndnpdwrpq", model.or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("qujlyegqa", model.or().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("dhzxrrfcfsrh", model.or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("fugsnnfhyetefy", model.or().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("zuyt", model.or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("s", model.or().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("efsbzxlbz", model.or().get(0).or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("lmuowo", model.or().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("szonwpngajinn", model.or().get(0).dimensions().name()); + Assertions.assertEquals("eikjclwza", model.or().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("xawqy", model.or().get(0).dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).dimensions().operator()); - Assertions.assertEquals("awrtmjfjmyccxlz", model.or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("rd", model.or().get(0).tags().name()); + Assertions.assertEquals("hd", model.or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("akckywym", model.or().get(0).tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.or().get(0).tags().operator()); - Assertions.assertEquals("txrdcqtjvi", model.or().get(0).tags().values().get(0)); - Assertions.assertEquals("afolpymwamxqzrag", model.dimensions().name()); + Assertions.assertEquals("abjkdtfohfao", model.or().get(0).tags().values().get(0)); + Assertions.assertEquals("ekcsueh", model.dimensions().name()); Assertions.assertEquals(QueryOperatorType.IN, model.dimensions().operator()); - Assertions.assertEquals("phtvdu", model.dimensions().values().get(0)); - Assertions.assertEquals("lejchcsr", model.tags().name()); + Assertions.assertEquals("dac", model.dimensions().values().get(0)); + Assertions.assertEquals("alswbnfd", model.tags().name()); Assertions.assertEquals(QueryOperatorType.IN, model.tags().operator()); - Assertions.assertEquals("nmzlanru", model.tags().values().get(0)); + Assertions.assertEquals("ldwq", model.tags().values().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryGroupingTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryGroupingTests.java index a898b9a6060f..bc55139ea04f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryGroupingTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryGroupingTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,16 @@ public final class QueryGroupingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryGrouping model - = BinaryData.fromString("{\"type\":\"Dimension\",\"name\":\"pzvuqdflvo\"}").toObject(QueryGrouping.class); - Assertions.assertEquals(QueryColumnType.DIMENSION, model.type()); - Assertions.assertEquals("pzvuqdflvo", model.name()); + = BinaryData.fromString("{\"type\":\"TagKey\",\"name\":\"a\"}").toObject(QueryGrouping.class); + Assertions.assertEquals(QueryColumnType.TAG_KEY, model.type()); + Assertions.assertEquals("a", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QueryGrouping model = new QueryGrouping().withType(QueryColumnType.DIMENSION).withName("pzvuqdflvo"); + QueryGrouping model = new QueryGrouping().withType(QueryColumnType.TAG_KEY).withName("a"); model = BinaryData.fromObject(model).toObject(QueryGrouping.class); - Assertions.assertEquals(QueryColumnType.DIMENSION, model.type()); - Assertions.assertEquals("pzvuqdflvo", model.name()); + Assertions.assertEquals(QueryColumnType.TAG_KEY, model.type()); + Assertions.assertEquals("a", model.name()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryPropertiesTests.java index 98b65f07e665..b292ce37910b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryPropertiesTests.java @@ -1,37 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.QueryProperties; -import com.azure.resourcemanager.costmanagement.models.QueryColumn; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class QueryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryProperties model = BinaryData.fromString( - "{\"nextLink\":\"mdyomkxfbvfbh\",\"columns\":[{\"name\":\"hpwpgddeimawzovg\",\"type\":\"um\"}],\"rows\":[[\"datacjc\",\"dataztbws\"],[\"dataqowxwcom\",\"dataikytwvczcswka\"],[\"dataejyfdvlvhbwrnfx\"],[\"dataddpqt\",\"dataehnmnaoyankco\"]]}") + "{\"nextLink\":\"biipsnawwlqkznx\",\"columns\":[{\"name\":\"xricctkwmuqq\",\"type\":\"jxeiy\"},{\"name\":\"esrw\",\"type\":\"exh\"}],\"rows\":[[\"\\\"dataceqnkbrupobehd\\\"\",\"\\\"datalj\\\"\",\"\\\"dataacvumepj\\\"\"],[\"\\\"dataibnzp\\\"\",\"\\\"datahep\\\"\",\"\\\"datafexleqirccjcly\\\"\",\"\\\"datacgxvrpj\\\"\"],[\"\\\"dataczuod\\\"\",\"\\\"datacpunettepdjx\\\"\",\"\\\"dataeskoy\\\"\"],[\"\\\"dataiylpck\\\"\",\"\\\"dataewsedveskwxe\\\"\"]]}") .toObject(QueryProperties.class); - Assertions.assertEquals("mdyomkxfbvfbh", model.nextLink()); - Assertions.assertEquals("hpwpgddeimawzovg", model.columns().get(0).name()); - Assertions.assertEquals("um", model.columns().get(0).type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryProperties model - = new QueryProperties().withNextLink("mdyomkxfbvfbh") - .withColumns(Arrays.asList(new QueryColumn().withName("hpwpgddeimawzovg").withType("um"))) - .withRows(Arrays.asList(Arrays.asList("datacjc", "dataztbws"), - Arrays.asList("dataqowxwcom", "dataikytwvczcswka"), Arrays.asList("dataejyfdvlvhbwrnfx"), - Arrays.asList("dataddpqt", "dataehnmnaoyankco"))); - model = BinaryData.fromObject(model).toObject(QueryProperties.class); - Assertions.assertEquals("mdyomkxfbvfbh", model.nextLink()); - Assertions.assertEquals("hpwpgddeimawzovg", model.columns().get(0).name()); - Assertions.assertEquals("um", model.columns().get(0).type()); + Assertions.assertEquals("biipsnawwlqkznx", model.nextLink()); + Assertions.assertEquals("xricctkwmuqq", model.columns().get(0).name()); + Assertions.assertEquals("jxeiy", model.columns().get(0).type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryResultInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryResultInnerTests.java index b003b0bdcca1..83149967d25a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryResultInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryResultInnerTests.java @@ -1,57 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.QueryResultInner; -import com.azure.resourcemanager.costmanagement.models.QueryColumn; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class QueryResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryResultInner model = BinaryData.fromString( - "{\"properties\":{\"nextLink\":\"dw\",\"columns\":[{\"name\":\"zegjonfhjirwgdn\",\"type\":\"brfkspz\"},{\"name\":\"mtksjcitdigsx\",\"type\":\"gljplkeuachtomfl\"}],\"rows\":[[\"datawfpfmdgycx\",\"datamskwhqjjysl\"],[\"datalpshhkvpedwqslsr\",\"datampqvwwsk\"],[\"datadcbrwimuvq\",\"datajosovyrrl\"],[\"dataesi\"]]},\"sku\":\"qtljqobbpihehc\",\"eTag\":\"ybmrqbrjbbmp\",\"location\":\"dlvykfrex\",\"tags\":{\"dgzhxogj\":\"eqwjksgh\"},\"id\":\"gsv\",\"name\":\"u\",\"type\":\"kxibdafh\"}") + "{\"properties\":{\"nextLink\":\"ywhsbrcarycs\",\"columns\":[{\"name\":\"voaqajuvehzptdmk\",\"type\":\"bhmpfulubefgybp\"},{\"name\":\"bfununmpzkrv\",\"type\":\"ifkdschlzvf\"}],\"rows\":[[\"\\\"datakjjwgcwn\\\"\",\"\\\"datahbkgfyrt\\\"\",\"\\\"datagm\\\"\",\"\\\"datamjpjscdfpdqwty\\\"\"],[\"\\\"datavgwmseharxifvqnr\\\"\"],[\"\\\"datambpjptnvwjh\\\"\",\"\\\"datasidqpxlbtpakft\\\"\"],[\"\\\"dataatw\\\"\",\"\\\"dataykyutrymdwmfj\\\"\",\"\\\"datapycvjqdvdwkqpldr\\\"\"]]},\"id\":\"fgnaavuagnteta\",\"name\":\"tnpdctuhspfefy\",\"type\":\"duyeuyl\",\"location\":\"hmtybkcgsuthhll\",\"sku\":\"wynefx\",\"eTag\":\"lf\",\"tags\":{\"jhhxdlajf\":\"txtjrrlkmds\",\"a\":\"xcxscvslxlh\",\"slojfkqidnqt\":\"krmukmyjmkxett\",\"rngl\":\"qxjhqxcsqhtkbtnq\"}}") .toObject(QueryResultInner.class); - Assertions.assertEquals("dlvykfrex", model.location()); - Assertions.assertEquals("eqwjksgh", model.tags().get("dgzhxogj")); - Assertions.assertEquals("dw", model.nextLink()); - Assertions.assertEquals("zegjonfhjirwgdn", model.columns().get(0).name()); - Assertions.assertEquals("brfkspz", model.columns().get(0).type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryResultInner model = new QueryResultInner().withLocation("dlvykfrex") - .withTags(mapOf("dgzhxogj", "eqwjksgh")) - .withNextLink("dw") - .withColumns(Arrays.asList(new QueryColumn().withName("zegjonfhjirwgdn").withType("brfkspz"), - new QueryColumn().withName("mtksjcitdigsx").withType("gljplkeuachtomfl"))) - .withRows(Arrays.asList(Arrays.asList("datawfpfmdgycx", "datamskwhqjjysl"), - Arrays.asList("datalpshhkvpedwqslsr", "datampqvwwsk"), Arrays.asList("datadcbrwimuvq", "datajosovyrrl"), - Arrays.asList("dataesi"))); - model = BinaryData.fromObject(model).toObject(QueryResultInner.class); - Assertions.assertEquals("dlvykfrex", model.location()); - Assertions.assertEquals("eqwjksgh", model.tags().get("dgzhxogj")); - Assertions.assertEquals("dw", model.nextLink()); - Assertions.assertEquals("zegjonfhjirwgdn", model.columns().get(0).name()); - Assertions.assertEquals("brfkspz", model.columns().get(0).type()); - } - - // 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; + Assertions.assertEquals("ywhsbrcarycs", model.nextLink()); + Assertions.assertEquals("voaqajuvehzptdmk", model.columns().get(0).name()); + Assertions.assertEquals("bhmpfulubefgybp", model.columns().get(0).type()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryTimePeriodTests.java index 12e788afc878..07040f1999de 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryTimePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/QueryTimePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,18 +13,18 @@ public final class QueryTimePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QueryTimePeriod model - = BinaryData.fromString("{\"from\":\"2021-03-16T19:39:08Z\",\"to\":\"2021-06-15T06:42:17Z\"}") + = BinaryData.fromString("{\"from\":\"2021-10-31T16:01:30Z\",\"to\":\"2021-08-11T05:10:13Z\"}") .toObject(QueryTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-16T19:39:08Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T06:42:17Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T16:01:30Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-11T05:10:13Z"), model.to()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QueryTimePeriod model = new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-03-16T19:39:08Z")) - .withTo(OffsetDateTime.parse("2021-06-15T06:42:17Z")); + QueryTimePeriod model = new QueryTimePeriod().withFrom(OffsetDateTime.parse("2021-10-31T16:01:30Z")) + .withTo(OffsetDateTime.parse("2021-08-11T05:10:13Z")); model = BinaryData.fromObject(model).toObject(QueryTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-16T19:39:08Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T06:42:17Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T16:01:30Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-11T05:10:13Z"), model.to()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RecommendationUsageDetailsTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RecommendationUsageDetailsTests.java index 1e5c6bf14dae..ff537ebd7d1e 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RecommendationUsageDetailsTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RecommendationUsageDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,15 +12,9 @@ public final class RecommendationUsageDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RecommendationUsageDetails model = BinaryData.fromString("{\"usageGrain\":\"Monthly\",\"charges\":[]}") + RecommendationUsageDetails model = BinaryData.fromString( + "{\"usageGrain\":\"Hourly\",\"charges\":[4628609097306866985,3476464605535767149,4429427229457258180,400634918714935098]}") .toObject(RecommendationUsageDetails.class); - Assertions.assertEquals(Grain.MONTHLY, model.usageGrain()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecommendationUsageDetails model = new RecommendationUsageDetails().withUsageGrain(Grain.MONTHLY); - model = BinaryData.fromObject(model).toObject(RecommendationUsageDetails.class); - Assertions.assertEquals(Grain.MONTHLY, model.usageGrain()); + Assertions.assertEquals(Grain.HOURLY, model.usageGrain()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigAggregationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigAggregationTests.java index af39b59041c5..89c477901c8f 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigAggregationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigAggregationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,17 +12,18 @@ public final class ReportConfigAggregationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReportConfigAggregation model - = BinaryData.fromString("{\"name\":\"luu\",\"function\":\"Sum\"}").toObject(ReportConfigAggregation.class); - Assertions.assertEquals("luu", model.name()); + ReportConfigAggregation model = BinaryData.fromString("{\"name\":\"cskfcktqumiekk\",\"function\":\"Sum\"}") + .toObject(ReportConfigAggregation.class); + Assertions.assertEquals("cskfcktqumiekk", model.name()); Assertions.assertEquals(FunctionType.SUM, model.function()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ReportConfigAggregation model = new ReportConfigAggregation().withName("luu").withFunction(FunctionType.SUM); + ReportConfigAggregation model + = new ReportConfigAggregation().withName("cskfcktqumiekk").withFunction(FunctionType.SUM); model = BinaryData.fromObject(model).toObject(ReportConfigAggregation.class); - Assertions.assertEquals("luu", model.name()); + Assertions.assertEquals("cskfcktqumiekk", model.name()); Assertions.assertEquals(FunctionType.SUM, model.function()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigComparisonExpressionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigComparisonExpressionTests.java index 8ddd75769280..b45d0a4d84d5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigComparisonExpressionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigComparisonExpressionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,22 +13,22 @@ public final class ReportConfigComparisonExpressionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReportConfigComparisonExpression model = BinaryData - .fromString("{\"name\":\"lla\",\"operator\":\"Contains\",\"values\":[\"lwuip\",\"ccjzkzivgvv\"]}") + ReportConfigComparisonExpression model = BinaryData.fromString( + "{\"name\":\"fiufx\",\"operator\":\"Contains\",\"values\":[\"pirgnepttwq\",\"sniffc\",\"mqnrojlpijnkr\"]}") .toObject(ReportConfigComparisonExpression.class); - Assertions.assertEquals("lla", model.name()); + Assertions.assertEquals("fiufx", model.name()); Assertions.assertEquals(OperatorType.CONTAINS, model.operator()); - Assertions.assertEquals("lwuip", model.values().get(0)); + Assertions.assertEquals("pirgnepttwq", model.values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ReportConfigComparisonExpression model = new ReportConfigComparisonExpression().withName("lla") + ReportConfigComparisonExpression model = new ReportConfigComparisonExpression().withName("fiufx") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("lwuip", "ccjzkzivgvv")); + .withValues(Arrays.asList("pirgnepttwq", "sniffc", "mqnrojlpijnkr")); model = BinaryData.fromObject(model).toObject(ReportConfigComparisonExpression.class); - Assertions.assertEquals("lla", model.name()); + Assertions.assertEquals("fiufx", model.name()); Assertions.assertEquals(OperatorType.CONTAINS, model.operator()); - Assertions.assertEquals("lwuip", model.values().get(0)); + Assertions.assertEquals("pirgnepttwq", model.values().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetConfigurationTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetConfigurationTests.java index 3e8f7ed0dec0..efc2ed8c2716 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetConfigurationTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,16 +12,16 @@ public final class ReportConfigDatasetConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReportConfigDatasetConfiguration model = BinaryData.fromString("{\"columns\":[\"kfpbs\",\"yofd\"]}") + ReportConfigDatasetConfiguration model = BinaryData.fromString("{\"columns\":[\"glrvimjwosytxi\"]}") .toObject(ReportConfigDatasetConfiguration.class); - Assertions.assertEquals("kfpbs", model.columns().get(0)); + Assertions.assertEquals("glrvimjwosytxi", model.columns().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ReportConfigDatasetConfiguration model - = new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("kfpbs", "yofd")); + = new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("glrvimjwosytxi")); model = BinaryData.fromObject(model).toObject(ReportConfigDatasetConfiguration.class); - Assertions.assertEquals("kfpbs", model.columns().get(0)); + Assertions.assertEquals("glrvimjwosytxi", model.columns().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetTests.java index 2e9602f9da6b..9db71c021695 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDatasetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -26,360 +26,438 @@ public final class ReportConfigDatasetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReportConfigDataset model = BinaryData.fromString( - "{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"yoxgvcltbgsnc\",\"hkjeszzhbi\",\"htxfvgxbfsmxnehm\"]},\"aggregation\":{\"fqkkr\":{\"name\":\"cxgod\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"kgriwflzlfbx\"},{\"type\":\"TagKey\",\"name\":\"uzycispnqza\"},{\"type\":\"Dimension\",\"name\":\"gkbrpyyd\"},{\"type\":\"Dimension\",\"name\":\"bnuqqkpik\"}],\"sorting\":[{\"direction\":\"Ascending\",\"name\":\"tqagnbuynh\"},{\"direction\":\"Ascending\",\"name\":\"gmebfsiarbutrcv\"}],\"filter\":{\"and\":[{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"mpxttdbhrbnlankx\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"k\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"kcxywnyt\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"yn\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"xczfcl\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"xdbabphlwr\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"hsucoc\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"yazttbtwwrqpue\",\"operator\":\"Contains\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"xzfeyueaxibxuj\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"qwalmuzyoxaepd\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"xrhdwbavxbniwdjs\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"s\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"gnxytxhpzxbz\",\"operator\":\"In\",\"values\":[\"abgl\",\"uhxwtctyqiklbbov\",\"lwzbhvgyugu\"]},\"tags\":{\"name\":\"vmkfssxqu\",\"operator\":\"Contains\",\"values\":[\"plgmgsxnk\"]}},{\"and\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"vlopwiyighx\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"wzbaiue\",\"operator\":\"Contains\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"ped\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"nabckhsmtx\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"hvpesapskrdqm\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"dhtldwkyz\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"tkncwsc\",\"operator\":\"Contains\",\"values\":[\"lxotogtwrupq\",\"xvnmicykvceov\",\"ilovnot\",\"fj\"]},\"tags\":{\"name\":\"njbkcnxdhbttkph\",\"operator\":\"In\",\"values\":[\"nv\",\"t\",\"qnermclfplphoxu\",\"crpab\"]}},{\"and\":[{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"azqugxywpmueefj\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"qkqujidsu\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"aocqxtccmgy\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ytlmoyrxvwfud\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"dzhlrq\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"ck\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"yvpycanuzbpzk\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"uwbc\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"hseyvju\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"slhs\",\"operator\":\"Contains\",\"values\":[]}}],\"dimensions\":{\"name\":\"eemaofmxagkvtme\",\"operator\":\"Contains\",\"values\":[\"krh\",\"hvljuahaquh\",\"dhmdua\"]},\"tags\":{\"name\":\"exq\",\"operator\":\"In\",\"values\":[\"adm\",\"sr\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"omzlfmi\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bnbbeldawkz\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"akauha\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"fwxosowzxcu\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"jooxdjebw\",\"operator\":\"In\",\"values\":[\"wwfvov\",\"vmeueci\",\"yhz\"]},\"tags\":{\"name\":\"uojgj\",\"operator\":\"In\",\"values\":[\"ueiotwmcdyt\",\"x\",\"it\",\"nrjawgqwg\"]}}],\"or\":[{\"and\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"py\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"lwn\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"whvylw\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"dhxujznbmpo\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"eualupjmkhf\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bcswsrt\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"pbewtghfgblcgwx\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"v\",\"operator\":\"Contains\",\"values\":[]}}],\"dimensions\":{\"name\":\"kbegibt\",\"operator\":\"In\",\"values\":[\"iebwwaloayqcgwrt\",\"j\",\"zg\",\"yzm\"]},\"tags\":{\"name\":\"xongmtsavjcbpwxq\",\"operator\":\"Contains\",\"values\":[\"knftguvriuh\",\"rwmdyvxqtay\",\"iwwroyqbexrmc\",\"ibycno\"]}}],\"dimensions\":{\"name\":\"knme\",\"operator\":\"Contains\",\"values\":[\"gzva\",\"apj\",\"zhpvgqzcjrvxd\",\"zlmwlxkvugfhz\"]},\"tags\":{\"name\":\"awjvzunluthnnp\",\"operator\":\"In\",\"values\":[\"i\",\"eilpjzuaejxdu\",\"tskzbbtdzumveek\",\"pwo\"]}}}") + "{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"bhhxsrzdzuc\"]},\"aggregation\":{\"dsslswt\":{\"name\":\"cdntnevfiwjmy\",\"function\":\"Sum\"},\"bnetshh\":{\"name\":\"weriofzpyqsem\",\"function\":\"Sum\"},\"mwmbes\":{\"name\":\"zhedplvwiw\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"wwtppj\"}],\"sorting\":[{\"direction\":\"Ascending\",\"name\":\"gaokonzmnsikv\"},{\"direction\":\"Descending\",\"name\":\"ze\"},{\"direction\":\"Descending\",\"name\":\"dltfz\"}],\"filter\":{\"and\":[{\"and\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"dkwobdagx\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"qdxbxwa\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"dlkzgxhuri\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"podxunkb\",\"operator\":\"Contains\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"twlrbqt\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"evseotgqrlltmuwl\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"bm\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"jefuzmuvpbttdumo\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"xe\",\"operator\":\"In\",\"values\":[\"zbtbhj\",\"glkfg\"]},\"tags\":{\"name\":\"dneu\",\"operator\":\"Contains\",\"values\":[\"phsdyhto\",\"fikdowwqu\",\"v\",\"zx\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"zonosgg\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"ohfwds\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"tiiswacffg\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"zewk\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"vpnpp\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"lrwdmhdlxyj\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"cnihgwqapnedgfbc\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"vq\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"vdrhvoo\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"tbobz\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"nhdldwmgxcx\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"pmutwuo\",\"operator\":\"Contains\",\"values\":[]}}],\"dimensions\":{\"name\":\"pkhjwni\",\"operator\":\"In\",\"values\":[\"luicpdggkzzlvmbm\",\"axmodfvuef\",\"wsbpfvm\"]},\"tags\":{\"name\":\"hrfou\",\"operator\":\"In\",\"values\":[\"aakc\",\"wiyzvqtmnubexkp\"]}},{\"and\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"mquxvypo\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"opkwhojv\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"smocmbq\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"mkcxozapvh\",\"operator\":\"Contains\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"tddckcb\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"jrjxgciqibrhosx\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"y\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"m\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"ibahwflus\",\"operator\":\"Contains\",\"values\":[\"mhrkwofyyvoqacp\",\"expbtg\",\"wbwo\",\"nwashrtd\"]},\"tags\":{\"name\":\"cnqxwbpokulpi\",\"operator\":\"In\",\"values\":[\"aasipqi\",\"obyu\"]}}],\"or\":[{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"ciuqgbdb\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"uvfbtkuwh\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"oxafn\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"pichkoymkcdy\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"dreqnovvqf\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"jxywsuws\",\"operator\":\"Contains\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"adgvraeaene\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"arrwlquu\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"e\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"pfpubjibww\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"vpuvks\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"saknynfsyn\",\"operator\":\"Contains\",\"values\":[]}}],\"dimensions\":{\"name\":\"huopxodlqiynto\",\"operator\":\"Contains\",\"values\":[\"hleosjsw\",\"rmslyzrpzbchckqq\"]},\"tags\":{\"name\":\"ioxiysuiizyn\",\"operator\":\"Contains\",\"values\":[\"yatrwy\"]}},{\"and\":[{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"wit\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"pyy\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"nzgmwznmabik\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"rgjhxb\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"lkdmtncvokotllxd\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"syocogjltdtbnnha\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"cikhnv\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"qgxqquezikyw\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"melwuipiccjz\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"v\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"rhyrnxxmueed\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"dvstkw\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"lmfmtdaay\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wvgpiohg\",\"operator\":\"Contains\",\"values\":[]}}],\"dimensions\":{\"name\":\"tfudxepx\",\"operator\":\"In\",\"values\":[\"agvrvmnpkuk\",\"himdbl\"]},\"tags\":{\"name\":\"wi\",\"operator\":\"Contains\",\"values\":[\"jhfjxwm\"]}}],\"dimensions\":{\"name\":\"kkfoqr\",\"operator\":\"In\",\"values\":[\"kzikfjawneaivxwc\",\"elpcirelsfeaenwa\"]},\"tags\":{\"name\":\"atklddxbjhwuaa\",\"operator\":\"In\",\"values\":[\"jos\",\"hyoulpjr\"]}}}") .toObject(ReportConfigDataset.class); Assertions.assertEquals(ReportGranularityType.MONTHLY, model.granularity()); - Assertions.assertEquals("yoxgvcltbgsnc", model.configuration().columns().get(0)); - Assertions.assertEquals("cxgod", model.aggregation().get("fqkkr").name()); - Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("fqkkr").function()); + Assertions.assertEquals("bhhxsrzdzuc", model.configuration().columns().get(0)); + Assertions.assertEquals("cdntnevfiwjmy", model.aggregation().get("dsslswt").name()); + Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("dsslswt").function()); Assertions.assertEquals(QueryColumnType.TAG_KEY, model.grouping().get(0).type()); - Assertions.assertEquals("kgriwflzlfbx", model.grouping().get(0).name()); + Assertions.assertEquals("wwtppj", model.grouping().get(0).name()); Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.sorting().get(0).direction()); - Assertions.assertEquals("tqagnbuynh", model.sorting().get(0).name()); - Assertions.assertEquals("mpxttdbhrbnlankx", model.filter().and().get(0).and().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.IN, model.filter().and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("k", model.filter().and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("gaokonzmnsikv", model.sorting().get(0).name()); + Assertions.assertEquals("dkwobdagx", model.filter().and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, + model.filter().and().get(0).and().get(0).dimensions().operator()); + Assertions.assertEquals("qdxbxwa", model.filter().and().get(0).and().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("xzfeyueaxibxuj", model.filter().and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("twlrbqt", model.filter().and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("qwalmuzyoxaepd", model.filter().and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("evseotgqrlltmuwl", model.filter().and().get(0).or().get(0).tags().name()); Assertions.assertEquals(OperatorType.IN, model.filter().and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("gnxytxhpzxbz", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals("xe", model.filter().and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("abgl", model.filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("vmkfssxqu", model.filter().and().get(0).tags().name()); + Assertions.assertEquals("zbtbhj", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("dneu", model.filter().and().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().and().get(0).tags().operator()); - Assertions.assertEquals("plgmgsxnk", model.filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("py", model.filter().or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("phsdyhto", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("ciuqgbdb", model.filter().or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("lwn", model.filter().or().get(0).and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("eualupjmkhf", model.filter().or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("uvfbtkuwh", model.filter().or().get(0).and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).and().get(0).tags().operator()); + Assertions.assertEquals("adgvraeaene", model.filter().or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("bcswsrt", model.filter().or().get(0).or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("kbegibt", model.filter().or().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("iebwwaloayqcgwrt", model.filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("xongmtsavjcbpwxq", model.filter().or().get(0).tags().name()); + Assertions.assertEquals("arrwlquu", model.filter().or().get(0).or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).or().get(0).tags().operator()); + Assertions.assertEquals("huopxodlqiynto", model.filter().or().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).dimensions().operator()); + Assertions.assertEquals("hleosjsw", model.filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ioxiysuiizyn", model.filter().or().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).tags().operator()); - Assertions.assertEquals("knftguvriuh", model.filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("knme", model.filter().dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.filter().dimensions().operator()); - Assertions.assertEquals("gzva", model.filter().dimensions().values().get(0)); - Assertions.assertEquals("awjvzunluthnnp", model.filter().tags().name()); + Assertions.assertEquals("yatrwy", model.filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("kkfoqr", model.filter().dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.filter().dimensions().operator()); + Assertions.assertEquals("kzikfjawneaivxwc", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("atklddxbjhwuaa", model.filter().tags().name()); Assertions.assertEquals(OperatorType.IN, model.filter().tags().operator()); - Assertions.assertEquals("i", model.filter().tags().values().get(0)); + Assertions.assertEquals("jos", model.filter().tags().values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ReportConfigDataset model = new ReportConfigDataset().withGranularity(ReportGranularityType.MONTHLY) - .withConfiguration(new ReportConfigDatasetConfiguration() - .withColumns(Arrays.asList("yoxgvcltbgsnc", "hkjeszzhbi", "htxfvgxbfsmxnehm"))) + .withConfiguration(new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("bhhxsrzdzuc"))) .withAggregation( - mapOf("fqkkr", new ReportConfigAggregation().withName("cxgod").withFunction(FunctionType.SUM))) + mapOf("dsslswt", new ReportConfigAggregation().withName("cdntnevfiwjmy").withFunction(FunctionType.SUM), + "bnetshh", new ReportConfigAggregation().withName("weriofzpyqsem").withFunction(FunctionType.SUM), + "mwmbes", new ReportConfigAggregation().withName("zhedplvwiw").withFunction(FunctionType.SUM))) .withGrouping( - Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("kgriwflzlfbx"), - new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("uzycispnqza"), - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("gkbrpyyd"), - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("bnuqqkpik"))) + Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("wwtppj"))) .withSorting(Arrays.asList( - new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("tqagnbuynh"), - new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("gmebfsiarbutrcv"))) + new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("gaokonzmnsikv"), + new ReportConfigSorting().withDirection(ReportConfigSortingType.DESCENDING).withName("ze"), + new ReportConfigSorting().withDirection(ReportConfigSortingType.DESCENDING).withName("dltfz"))) .withFilter(new ReportConfigFilter() .withAnd(Arrays.asList( new ReportConfigFilter() .withAnd(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("mpxttdbhrbnlankx") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("k") + .withDimensions(new ReportConfigComparisonExpression() + .withName("dkwobdagx") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("kcxywnyt") - .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("yn") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("xczfcl") + .withTags(new ReportConfigComparisonExpression().withName("qdxbxwa") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("xdbabphlwr") - .withOperator(OperatorType.IN) .withValues(Arrays.asList())), new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("hsucoc") + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("dlkzgxhuri") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("yazttbtwwrqpue") + .withTags(new ReportConfigComparisonExpression().withName("podxunkb") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())))) .withOr(Arrays.asList( new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("xzfeyueaxibxuj") + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("twlrbqt") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("qwalmuzyoxaepd") + .withTags(new ReportConfigComparisonExpression().withName("evseotgqrlltmuwl") .withOperator(OperatorType.IN) .withValues(Arrays.asList())), new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("xrhdwbavxbniwdjs") + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("bm") .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("s") + .withTags(new ReportConfigComparisonExpression().withName("jefuzmuvpbttdumo") .withOperator(OperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new ReportConfigComparisonExpression().withName("gnxytxhpzxbz") + .withDimensions(new ReportConfigComparisonExpression().withName("xe") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("abgl", "uhxwtctyqiklbbov", "lwzbhvgyugu"))) - .withTags(new ReportConfigComparisonExpression().withName("vmkfssxqu") + .withValues(Arrays.asList("zbtbhj", "glkfg"))) + .withTags(new ReportConfigComparisonExpression().withName("dneu") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("plgmgsxnk"))), + .withValues(Arrays.asList("phsdyhto", "fikdowwqu", "v", "zx"))), new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("vlopwiyighx") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("wzbaiue") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( + .withAnd(Arrays.asList( new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("ped") + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("zonosgg") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("nabckhsmtx") - .withOperator(OperatorType.CONTAINS) + .withTags(new ReportConfigComparisonExpression().withName("ohfwds") + .withOperator(OperatorType.IN) .withValues(Arrays.asList())), new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("hvpesapskrdqm") + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("tiiswacffg") .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("dhtldwkyz") + .withTags(new ReportConfigComparisonExpression().withName("zewk") .withOperator(OperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new ReportConfigComparisonExpression().withName("tkncwsc") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("lxotogtwrupq", "xvnmicykvceov", "ilovnot", "fj"))) + .withOr( + Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("vpnpp") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("lrwdmhdlxyj") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("cnihgwqapnedgfbc") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("vq") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("vdrhvoo") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("tbobz") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("nhdldwmgxcx") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("pmutwuo") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())))) + .withDimensions(new ReportConfigComparisonExpression().withName("pkhjwni") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("luicpdggkzzlvmbm", "axmodfvuef", "wsbpfvm"))) .withTags( - new ReportConfigComparisonExpression().withName("njbkcnxdhbttkph") + new ReportConfigComparisonExpression().withName("hrfou") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("nv", "t", "qnermclfplphoxu", "crpab"))), + .withValues(Arrays.asList("aakc", "wiyzvqtmnubexkp"))), new ReportConfigFilter() .withAnd(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("mquxvypo") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("opkwhojv") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())), new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("smocmbq") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("mkcxozapvh") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("azqugxywpmueefj") + .withDimensions(new ReportConfigComparisonExpression().withName("tddckcb") .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("qkqujidsu") + .withTags(new ReportConfigComparisonExpression().withName("jrjxgciqibrhosx") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("y") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("m") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new ReportConfigComparisonExpression().withName("ibahwflus") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("mhrkwofyyvoqacp", "expbtg", "wbwo", "nwashrtd"))) + .withTags(new ReportConfigComparisonExpression().withName("cnqxwbpokulpi") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("aasipqi", "obyu"))))) + .withOr(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList( new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("aocqxtccmgy") + .withDimensions(new ReportConfigComparisonExpression() + .withName("ciuqgbdb") .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("ytlmoyrxvwfud") - .withOperator(OperatorType.IN) + .withTags(new ReportConfigComparisonExpression() + .withName("uvfbtkuwh") + .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())), new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("oxafn") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression() + .withName("pichkoymkcdy") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("dzhlrq") + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("dreqnovvqf") .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("ck") - .withOperator(OperatorType.IN) + .withTags(new ReportConfigComparisonExpression().withName("jxywsuws") + .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())))) .withOr(Arrays.asList( new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("yvpycanuzbpzk") - .withOperator(OperatorType.CONTAINS) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("adgvraeaene") + .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("uwbc") + .withTags(new ReportConfigComparisonExpression().withName("arrwlquu") .withOperator(OperatorType.IN) .withValues(Arrays.asList())), new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("hseyvju") + .withDimensions(new ReportConfigComparisonExpression().withName("e") .withOperator(OperatorType.IN) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("slhs") + .withTags(new ReportConfigComparisonExpression().withName("pfpubjibww") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("vpuvks") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("saknynfsyn") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())))) - .withDimensions(new ReportConfigComparisonExpression().withName("eemaofmxagkvtme") + .withDimensions(new ReportConfigComparisonExpression().withName("huopxodlqiynto") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("krh", "hvljuahaquh", "dhmdua"))) - .withTags(new ReportConfigComparisonExpression().withName("exq") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("adm", "sr"))), + .withValues(Arrays.asList("hleosjsw", "rmslyzrpzbchckqq"))) + .withTags(new ReportConfigComparisonExpression().withName("ioxiysuiizyn") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("yatrwy"))), new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("omzlfmi") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("bnbbeldawkz") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList(new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("akauha") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("fwxosowzxcu") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())))) - .withDimensions(new ReportConfigComparisonExpression().withName("jooxdjebw") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("wwfvov", "vmeueci", "yhz"))) - .withTags(new ReportConfigComparisonExpression().withName("uojgj") + .withAnd(Arrays.asList( + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("wit") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("pyy") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("nzgmwznmabik") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("rgjhxb") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("lkdmtncvokotllxd") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("syocogjltdtbnnha") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("cikhnv") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("qgxqquezikyw") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())))) + .withOr(Arrays.asList( + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("melwuipiccjz") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("v") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("rhyrnxxmueed") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("dvstkw") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("lmfmtdaay") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("wvgpiohg") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())))) + .withDimensions(new ReportConfigComparisonExpression().withName("tfudxepx") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("ueiotwmcdyt", "x", "it", "nrjawgqwg"))))) - .withOr(Arrays.asList(new ReportConfigFilter() - .withAnd(Arrays.asList( - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("py") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("lwn") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("whvylw") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("dhxujznbmpo") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("eualupjmkhf") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("bcswsrt") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("pbewtghfgblcgwx") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("v") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())))) - .withDimensions(new ReportConfigComparisonExpression().withName("kbegibt") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("iebwwaloayqcgwrt", "j", "zg", "yzm"))) - .withTags(new ReportConfigComparisonExpression().withName("xongmtsavjcbpwxq") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("knftguvriuh", "rwmdyvxqtay", "iwwroyqbexrmc", "ibycno"))))) - .withDimensions(new ReportConfigComparisonExpression().withName("knme") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("gzva", "apj", "zhpvgqzcjrvxd", "zlmwlxkvugfhz"))) - .withTags(new ReportConfigComparisonExpression().withName("awjvzunluthnnp") + .withValues(Arrays.asList("agvrvmnpkuk", "himdbl"))) + .withTags(new ReportConfigComparisonExpression().withName("wi") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("jhfjxwm"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("kkfoqr") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("kzikfjawneaivxwc", "elpcirelsfeaenwa"))) + .withTags(new ReportConfigComparisonExpression().withName("atklddxbjhwuaa") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("i", "eilpjzuaejxdu", "tskzbbtdzumveek", "pwo")))); + .withValues(Arrays.asList("jos", "hyoulpjr")))); model = BinaryData.fromObject(model).toObject(ReportConfigDataset.class); Assertions.assertEquals(ReportGranularityType.MONTHLY, model.granularity()); - Assertions.assertEquals("yoxgvcltbgsnc", model.configuration().columns().get(0)); - Assertions.assertEquals("cxgod", model.aggregation().get("fqkkr").name()); - Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("fqkkr").function()); + Assertions.assertEquals("bhhxsrzdzuc", model.configuration().columns().get(0)); + Assertions.assertEquals("cdntnevfiwjmy", model.aggregation().get("dsslswt").name()); + Assertions.assertEquals(FunctionType.SUM, model.aggregation().get("dsslswt").function()); Assertions.assertEquals(QueryColumnType.TAG_KEY, model.grouping().get(0).type()); - Assertions.assertEquals("kgriwflzlfbx", model.grouping().get(0).name()); + Assertions.assertEquals("wwtppj", model.grouping().get(0).name()); Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.sorting().get(0).direction()); - Assertions.assertEquals("tqagnbuynh", model.sorting().get(0).name()); - Assertions.assertEquals("mpxttdbhrbnlankx", model.filter().and().get(0).and().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.IN, model.filter().and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("k", model.filter().and().get(0).and().get(0).tags().name()); + Assertions.assertEquals("gaokonzmnsikv", model.sorting().get(0).name()); + Assertions.assertEquals("dkwobdagx", model.filter().and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, + model.filter().and().get(0).and().get(0).dimensions().operator()); + Assertions.assertEquals("qdxbxwa", model.filter().and().get(0).and().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("xzfeyueaxibxuj", model.filter().and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("twlrbqt", model.filter().and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("qwalmuzyoxaepd", model.filter().and().get(0).or().get(0).tags().name()); + Assertions.assertEquals("evseotgqrlltmuwl", model.filter().and().get(0).or().get(0).tags().name()); Assertions.assertEquals(OperatorType.IN, model.filter().and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("gnxytxhpzxbz", model.filter().and().get(0).dimensions().name()); + Assertions.assertEquals("xe", model.filter().and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("abgl", model.filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("vmkfssxqu", model.filter().and().get(0).tags().name()); + Assertions.assertEquals("zbtbhj", model.filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("dneu", model.filter().and().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().and().get(0).tags().operator()); - Assertions.assertEquals("plgmgsxnk", model.filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("py", model.filter().or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("phsdyhto", model.filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("ciuqgbdb", model.filter().or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("lwn", model.filter().or().get(0).and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("eualupjmkhf", model.filter().or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("uvfbtkuwh", model.filter().or().get(0).and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).and().get(0).tags().operator()); + Assertions.assertEquals("adgvraeaene", model.filter().or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("bcswsrt", model.filter().or().get(0).or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("kbegibt", model.filter().or().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("iebwwaloayqcgwrt", model.filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("xongmtsavjcbpwxq", model.filter().or().get(0).tags().name()); + Assertions.assertEquals("arrwlquu", model.filter().or().get(0).or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.filter().or().get(0).or().get(0).tags().operator()); + Assertions.assertEquals("huopxodlqiynto", model.filter().or().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).dimensions().operator()); + Assertions.assertEquals("hleosjsw", model.filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ioxiysuiizyn", model.filter().or().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.filter().or().get(0).tags().operator()); - Assertions.assertEquals("knftguvriuh", model.filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("knme", model.filter().dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.filter().dimensions().operator()); - Assertions.assertEquals("gzva", model.filter().dimensions().values().get(0)); - Assertions.assertEquals("awjvzunluthnnp", model.filter().tags().name()); + Assertions.assertEquals("yatrwy", model.filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("kkfoqr", model.filter().dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.filter().dimensions().operator()); + Assertions.assertEquals("kzikfjawneaivxwc", model.filter().dimensions().values().get(0)); + Assertions.assertEquals("atklddxbjhwuaa", model.filter().tags().name()); Assertions.assertEquals(OperatorType.IN, model.filter().tags().operator()); - Assertions.assertEquals("i", model.filter().tags().values().get(0)); + Assertions.assertEquals("jos", model.filter().tags().values().get(0)); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDefinitionTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDefinitionTests.java index 334f04f3d969..7ba693d6b4e6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDefinitionTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigDefinitionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -31,169 +31,121 @@ public final class ReportConfigDefinitionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReportConfigDefinition model = BinaryData.fromString( - "{\"type\":\"Usage\",\"timeframe\":\"YearToDate\",\"timePeriod\":{\"from\":\"2021-04-05T17:23:15Z\",\"to\":\"2021-10-23T04:38:56Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"hbkuofqwey\",\"hmenevfyexfwhybc\"]},\"aggregation\":{\"ectehf\":{\"name\":\"yvdcsitynnaa\",\"function\":\"Sum\"},\"ypvhezrkg\":{\"name\":\"qsc\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"refovgmkqsleyyvx\"}],\"sorting\":[{\"direction\":\"Ascending\",\"name\":\"cattpngjcrcczsq\"},{\"direction\":\"Descending\",\"name\":\"vmdajvnysou\"},{\"direction\":\"Ascending\",\"name\":\"canoaeupf\"}],\"filter\":{\"and\":[{\"and\":[{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"pjmcmatuokthfuiu\",\"operator\":\"Contains\",\"values\":[\"sfcpkvxodpuozm\",\"zydagfuaxbezyiuo\",\"ktwh\",\"dxwzywqsmbsurexi\"]},\"tags\":{\"name\":\"ryocfsfksymdd\",\"operator\":\"Contains\",\"values\":[\"kiiuxhqyudxor\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"czvyifq\",\"operator\":\"In\",\"values\":[\"dvjsllrmvvdf\",\"atkpnp\"]},\"tags\":{\"name\":\"exxbczwtr\",\"operator\":\"Contains\",\"values\":[\"qzbqjvsov\",\"yokacspkw\"]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"jmflbvvnch\",\"operator\":\"Contains\",\"values\":[\"ciwwzjuqkhr\"]},\"tags\":{\"name\":\"jiwkuofoskghsau\",\"operator\":\"In\",\"values\":[\"jmvxie\",\"uugidyjrrfby\",\"osvexcsonpclhoc\",\"hslkevleggzf\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"faxkffeii\",\"operator\":\"In\",\"values\":[\"vmezy\",\"shxmzsbbzoggigrx\",\"burvjxxjnspy\",\"ptkoenkoukn\"]},\"tags\":{\"name\":\"dwtiukbldngkp\",\"operator\":\"Contains\",\"values\":[\"pazyxoegukg\",\"npiucgygevqznty\",\"mrbpizcdrqj\",\"dpydn\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"oejzi\",\"operator\":\"In\",\"values\":[\"fsj\",\"tgzfbishcbkh\",\"jdeyeamdpha\",\"alpbuxwgipwhon\"]},\"tags\":{\"name\":\"kgshwa\",\"operator\":\"In\",\"values\":[\"xzbinjeputt\",\"rywn\",\"zoqftiyqzrnkcqvy\",\"lwh\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"hoqqnwvlr\",\"operator\":\"Contains\",\"values\":[\"w\",\"heun\",\"mqhgyxzkonocuk\",\"klyaxuconu\"]},\"tags\":{\"name\":\"zf\",\"operator\":\"Contains\",\"values\":[\"ypewrmjmwvvjekt\"]}}],\"dimensions\":{\"name\":\"senhwlrs\",\"operator\":\"Contains\",\"values\":[\"zpwv\",\"qdqgbi\",\"ylihkaetckt\",\"fcivfsnkym\"]},\"tags\":{\"name\":\"tqhjfbebrjcx\",\"operator\":\"In\",\"values\":[\"uwutttxfvjrbi\",\"phxepcyvahf\",\"ljkyqxjvuuj\"]}}},\"includeMonetaryCommitment\":false}") + "{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2021-10-30T20:36:32Z\",\"to\":\"2021-11-13T02:46:34Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"eopzfqrhhuaopp\",\"cq\",\"qxolzdahzx\",\"t\"]},\"aggregation\":{\"postmgrcfbunrm\":{\"name\":\"bkdmo\",\"function\":\"Sum\"},\"mjh\":{\"name\":\"qjhhkxbpv\",\"function\":\"Sum\"},\"swbxqz\":{\"name\":\"xjyngudivk\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"fauvjfdxx\"}],\"sorting\":[{\"direction\":\"Descending\",\"name\":\"t\"}],\"filter\":{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"cbxvwvxyslqbh\",\"operator\":\"Contains\",\"values\":[\"obl\",\"tkblmpewww\",\"bkrvrnsvshqj\"]},\"tags\":{\"name\":\"xc\",\"operator\":\"In\",\"values\":[\"fovasr\",\"uvwbhsqfs\",\"bcgjbirxbp\",\"bsrfbj\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"ftpvjzbexil\",\"operator\":\"Contains\",\"values\":[\"fqqnvwpmqtaruo\",\"jmkcjhwqytj\"]},\"tags\":{\"name\":\"bnw\",\"operator\":\"Contains\",\"values\":[\"gdrjervnaenqpe\",\"indoygmifthnzd\",\"dslgnayqigynduh\",\"vhqlkthumaqo\"]}}],\"dimensions\":{\"name\":\"gycdu\",\"operator\":\"Contains\",\"values\":[\"tgccymvaolpss\"]},\"tags\":{\"name\":\"lfmmdnbbglzpswi\",\"operator\":\"In\",\"values\":[\"cwyhzdxssa\",\"bzmnvdfznud\",\"od\",\"xzb\"]}}},\"includeMonetaryCommitment\":true}") .toObject(ReportConfigDefinition.class); Assertions.assertEquals(ReportType.USAGE, model.type()); - Assertions.assertEquals(ReportTimeframeType.YEAR_TO_DATE, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T17:23:15Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T04:38:56Z"), model.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, model.dataSet().granularity()); - Assertions.assertEquals("hbkuofqwey", model.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("yvdcsitynnaa", model.dataSet().aggregation().get("ectehf").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("ectehf").function()); + Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T20:36:32Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T02:46:34Z"), model.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.DAILY, model.dataSet().granularity()); + Assertions.assertEquals("eopzfqrhhuaopp", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("bkdmo", model.dataSet().aggregation().get("postmgrcfbunrm").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("postmgrcfbunrm").function()); Assertions.assertEquals(QueryColumnType.DIMENSION, model.dataSet().grouping().get(0).type()); - Assertions.assertEquals("refovgmkqsleyyvx", model.dataSet().grouping().get(0).name()); - Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.dataSet().sorting().get(0).direction()); - Assertions.assertEquals("cattpngjcrcczsq", model.dataSet().sorting().get(0).name()); - Assertions.assertEquals("pjmcmatuokthfuiu", model.dataSet().filter().and().get(0).dimensions().name()); + Assertions.assertEquals("fauvjfdxx", model.dataSet().grouping().get(0).name()); + Assertions.assertEquals(ReportConfigSortingType.DESCENDING, model.dataSet().sorting().get(0).direction()); + Assertions.assertEquals("t", model.dataSet().sorting().get(0).name()); + Assertions.assertEquals("cbxvwvxyslqbh", model.dataSet().filter().and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("sfcpkvxodpuozm", model.dataSet().filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("ryocfsfksymdd", model.dataSet().filter().and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).tags().operator()); - Assertions.assertEquals("kiiuxhqyudxor", model.dataSet().filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("jmflbvvnch", model.dataSet().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("obl", model.dataSet().filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("xc", model.dataSet().filter().and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().and().get(0).tags().operator()); + Assertions.assertEquals("fovasr", model.dataSet().filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("ftpvjzbexil", model.dataSet().filter().or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("ciwwzjuqkhr", model.dataSet().filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("jiwkuofoskghsau", model.dataSet().filter().or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().or().get(0).tags().operator()); - Assertions.assertEquals("jmvxie", model.dataSet().filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("senhwlrs", model.dataSet().filter().dimensions().name()); + Assertions.assertEquals("fqqnvwpmqtaruo", model.dataSet().filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("bnw", model.dataSet().filter().or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).tags().operator()); + Assertions.assertEquals("gdrjervnaenqpe", model.dataSet().filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("gycdu", model.dataSet().filter().dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("zpwv", model.dataSet().filter().dimensions().values().get(0)); - Assertions.assertEquals("tqhjfbebrjcx", model.dataSet().filter().tags().name()); + Assertions.assertEquals("tgccymvaolpss", model.dataSet().filter().dimensions().values().get(0)); + Assertions.assertEquals("lfmmdnbbglzpswi", model.dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().tags().operator()); - Assertions.assertEquals("uwutttxfvjrbi", model.dataSet().filter().tags().values().get(0)); - Assertions.assertEquals(false, model.includeMonetaryCommitment()); + Assertions.assertEquals("cwyhzdxssa", model.dataSet().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeMonetaryCommitment()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ReportConfigDefinition model = new ReportConfigDefinition().withType(ReportType.USAGE) - .withTimeframe(ReportTimeframeType.YEAR_TO_DATE) - .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-04-05T17:23:15Z")) - .withTo(OffsetDateTime.parse("2021-10-23T04:38:56Z"))) - .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.MONTHLY) - .withConfiguration( - new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("hbkuofqwey", "hmenevfyexfwhybc"))) - .withAggregation(mapOf("ectehf", - new ReportConfigAggregation().withName("yvdcsitynnaa").withFunction(FunctionType.SUM), "ypvhezrkg", - new ReportConfigAggregation().withName("qsc").withFunction(FunctionType.SUM))) - .withGrouping(Arrays.asList( - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("refovgmkqsleyyvx"))) - .withSorting(Arrays.asList( - new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING) - .withName("cattpngjcrcczsq"), - new ReportConfigSorting().withDirection(ReportConfigSortingType.DESCENDING).withName("vmdajvnysou"), - new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("canoaeupf"))) - .withFilter( - new ReportConfigFilter() - .withAnd(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("pjmcmatuokthfuiu") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("sfcpkvxodpuozm", "zydagfuaxbezyiuo", "ktwh", - "dxwzywqsmbsurexi"))) - .withTags(new ReportConfigComparisonExpression().withName("ryocfsfksymdd") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("kiiuxhqyudxor"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("czvyifq") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("dvjsllrmvvdf", "atkpnp"))) - .withTags(new ReportConfigComparisonExpression().withName("exxbczwtr") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("qzbqjvsov", "yokacspkw"))))) - .withOr(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("jmflbvvnch") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("ciwwzjuqkhr"))) - .withTags(new ReportConfigComparisonExpression() - .withName("jiwkuofoskghsau") - .withOperator(OperatorType.IN) - .withValues( - Arrays.asList("jmvxie", "uugidyjrrfby", "osvexcsonpclhoc", "hslkevleggzf"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("faxkffeii") - .withOperator(OperatorType.IN) - .withValues( - Arrays.asList("vmezy", "shxmzsbbzoggigrx", "burvjxxjnspy", "ptkoenkoukn"))) - .withTags(new ReportConfigComparisonExpression().withName("dwtiukbldngkp") - .withOperator(OperatorType.CONTAINS) - .withValues( - Arrays.asList("pazyxoegukg", "npiucgygevqznty", "mrbpizcdrqj", "dpydn"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("oejzi") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("fsj", "tgzfbishcbkh", "jdeyeamdpha", "alpbuxwgipwhon"))) - .withTags(new ReportConfigComparisonExpression().withName("kgshwa") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("xzbinjeputt", "rywn", "zoqftiyqzrnkcqvy", "lwh"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("hoqqnwvlr") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("w", "heun", "mqhgyxzkonocuk", "klyaxuconu"))) - .withTags(new ReportConfigComparisonExpression().withName("zf") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("ypewrmjmwvvjekt"))))) - .withDimensions(new ReportConfigComparisonExpression().withName("senhwlrs") + .withTimeframe(ReportTimeframeType.WEEK_TO_DATE) + .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-10-30T20:36:32Z")) + .withTo(OffsetDateTime.parse("2021-11-13T02:46:34Z"))) + .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) + .withConfiguration(new ReportConfigDatasetConfiguration() + .withColumns(Arrays.asList("eopzfqrhhuaopp", "cq", "qxolzdahzx", "t"))) + .withAggregation(mapOf("postmgrcfbunrm", + new ReportConfigAggregation().withName("bkdmo").withFunction(FunctionType.SUM), "mjh", + new ReportConfigAggregation().withName("qjhhkxbpv").withFunction(FunctionType.SUM), "swbxqz", + new ReportConfigAggregation().withName("xjyngudivk").withFunction(FunctionType.SUM))) + .withGrouping( + Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("fauvjfdxx"))) + .withSorting(Arrays + .asList(new ReportConfigSorting().withDirection(ReportConfigSortingType.DESCENDING).withName("t"))) + .withFilter(new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("cbxvwvxyslqbh") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("zpwv", "qdqgbi", "ylihkaetckt", "fcivfsnkym"))) - .withTags(new ReportConfigComparisonExpression().withName("tqhjfbebrjcx") + .withValues(Arrays.asList("obl", "tkblmpewww", "bkrvrnsvshqj"))) + .withTags(new ReportConfigComparisonExpression().withName("xc") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("uwutttxfvjrbi", "phxepcyvahf", "ljkyqxjvuuj"))))) - .withIncludeMonetaryCommitment(false); + .withValues(Arrays.asList("fovasr", "uvwbhsqfs", "bcgjbirxbp", "bsrfbj"))))) + .withOr( + Arrays.asList(new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("ftpvjzbexil") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("fqqnvwpmqtaruo", "jmkcjhwqytj"))) + .withTags(new ReportConfigComparisonExpression().withName("bnw") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("gdrjervnaenqpe", "indoygmifthnzd", "dslgnayqigynduh", + "vhqlkthumaqo"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("gycdu") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("tgccymvaolpss"))) + .withTags(new ReportConfigComparisonExpression().withName("lfmmdnbbglzpswi") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("cwyhzdxssa", "bzmnvdfznud", "od", "xzb"))))) + .withIncludeMonetaryCommitment(true); model = BinaryData.fromObject(model).toObject(ReportConfigDefinition.class); Assertions.assertEquals(ReportType.USAGE, model.type()); - Assertions.assertEquals(ReportTimeframeType.YEAR_TO_DATE, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T17:23:15Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T04:38:56Z"), model.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, model.dataSet().granularity()); - Assertions.assertEquals("hbkuofqwey", model.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("yvdcsitynnaa", model.dataSet().aggregation().get("ectehf").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("ectehf").function()); + Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T20:36:32Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T02:46:34Z"), model.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.DAILY, model.dataSet().granularity()); + Assertions.assertEquals("eopzfqrhhuaopp", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("bkdmo", model.dataSet().aggregation().get("postmgrcfbunrm").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("postmgrcfbunrm").function()); Assertions.assertEquals(QueryColumnType.DIMENSION, model.dataSet().grouping().get(0).type()); - Assertions.assertEquals("refovgmkqsleyyvx", model.dataSet().grouping().get(0).name()); - Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.dataSet().sorting().get(0).direction()); - Assertions.assertEquals("cattpngjcrcczsq", model.dataSet().sorting().get(0).name()); - Assertions.assertEquals("pjmcmatuokthfuiu", model.dataSet().filter().and().get(0).dimensions().name()); + Assertions.assertEquals("fauvjfdxx", model.dataSet().grouping().get(0).name()); + Assertions.assertEquals(ReportConfigSortingType.DESCENDING, model.dataSet().sorting().get(0).direction()); + Assertions.assertEquals("t", model.dataSet().sorting().get(0).name()); + Assertions.assertEquals("cbxvwvxyslqbh", model.dataSet().filter().and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("sfcpkvxodpuozm", model.dataSet().filter().and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("ryocfsfksymdd", model.dataSet().filter().and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).tags().operator()); - Assertions.assertEquals("kiiuxhqyudxor", model.dataSet().filter().and().get(0).tags().values().get(0)); - Assertions.assertEquals("jmflbvvnch", model.dataSet().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("obl", model.dataSet().filter().and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("xc", model.dataSet().filter().and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().and().get(0).tags().operator()); + Assertions.assertEquals("fovasr", model.dataSet().filter().and().get(0).tags().values().get(0)); + Assertions.assertEquals("ftpvjzbexil", model.dataSet().filter().or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("ciwwzjuqkhr", model.dataSet().filter().or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("jiwkuofoskghsau", model.dataSet().filter().or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().or().get(0).tags().operator()); - Assertions.assertEquals("jmvxie", model.dataSet().filter().or().get(0).tags().values().get(0)); - Assertions.assertEquals("senhwlrs", model.dataSet().filter().dimensions().name()); + Assertions.assertEquals("fqqnvwpmqtaruo", model.dataSet().filter().or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("bnw", model.dataSet().filter().or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).tags().operator()); + Assertions.assertEquals("gdrjervnaenqpe", model.dataSet().filter().or().get(0).tags().values().get(0)); + Assertions.assertEquals("gycdu", model.dataSet().filter().dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("zpwv", model.dataSet().filter().dimensions().values().get(0)); - Assertions.assertEquals("tqhjfbebrjcx", model.dataSet().filter().tags().name()); + Assertions.assertEquals("tgccymvaolpss", model.dataSet().filter().dimensions().values().get(0)); + Assertions.assertEquals("lfmmdnbbglzpswi", model.dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().tags().operator()); - Assertions.assertEquals("uwutttxfvjrbi", model.dataSet().filter().tags().values().get(0)); - Assertions.assertEquals(false, model.includeMonetaryCommitment()); + Assertions.assertEquals("cwyhzdxssa", model.dataSet().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeMonetaryCommitment()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigFilterTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigFilterTests.java index 257066a7d369..ad636244176b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigFilterTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigFilterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -15,280 +15,404 @@ public final class ReportConfigFilterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReportConfigFilter model = BinaryData.fromString( - "{\"and\":[{\"and\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"jixisxyawjoyaqcs\",\"operator\":\"Contains\",\"values\":[\"pkii\",\"zyexzn\",\"lixhnrztfol\",\"bnxknalaulppg\"]},\"tags\":{\"name\":\"tpnapnyiropuhpig\",\"operator\":\"In\",\"values\":[\"ylgqgitxmedjvcsl\",\"n\",\"wwncwzzhxgk\",\"rmgucnap\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"lwptfdy\",\"operator\":\"Contains\",\"values\":[\"qbuaceopzfqr\",\"huaoppp\",\"qeqxo\"]},\"tags\":{\"name\":\"dahzxctobg\",\"operator\":\"In\",\"values\":[\"moizpos\",\"mgrcfbu\",\"rmfqjhhkxbpvj\"]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"j\",\"operator\":\"In\",\"values\":[\"u\",\"ivkrtsw\",\"xqzvszjfa\",\"vjfdx\"]},\"tags\":{\"name\":\"vetvt\",\"operator\":\"Contains\",\"values\":[\"qtdo\",\"mcbxvwvxysl\",\"bhsfxob\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"ewwwfbkrvrnsv\",\"operator\":\"Contains\",\"values\":[\"johxcrsb\"]},\"tags\":{\"name\":\"vasrruvwb\",\"operator\":\"Contains\",\"values\":[\"fsubcgjbirxbpy\",\"srfbjfdtwss\",\"t\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"bexilzznfqqnv\",\"operator\":\"In\",\"values\":[\"qtaruoujmkcjhwq\",\"tjrybnwjewgdr\",\"ervnaenqpehi\",\"doy\"]},\"tags\":{\"name\":\"ifthnz\",\"operator\":\"Contains\",\"values\":[\"sl\",\"nayqi\",\"ynduha\",\"hqlkthumaqo\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"uie\",\"operator\":\"Contains\",\"values\":[\"ccymvaolpsslql\",\"mmdnbbglzps\",\"iydmcwyhzdxs\",\"adbzmnvdfznud\"]},\"tags\":{\"name\":\"dvxzbncblylpst\",\"operator\":\"Contains\",\"values\":[\"hxsrzdzucersc\"]}}],\"dimensions\":{\"name\":\"t\",\"operator\":\"Contains\",\"values\":[\"fiwjmygtdssls\",\"tmweriofzpyq\",\"emwabnet\"]},\"tags\":{\"name\":\"hszhedplvwiwu\",\"operator\":\"In\",\"values\":[\"mbes\",\"dnkwwtppjflcxog\",\"okonzmnsikvmkqz\"]}}],\"or\":[{\"and\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"mhhv\",\"operator\":\"Contains\",\"values\":[\"r\"]},\"tags\":{\"name\":\"dkwobdagx\",\"operator\":\"Contains\",\"values\":[\"qdxbxwa\",\"bogqxndlkzgxhu\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"odxun\",\"operator\":\"Contains\",\"values\":[\"bxmubyynt\",\"lrb\",\"tkoievseotgq\"]},\"tags\":{\"name\":\"ltmuwlauwzizx\",\"operator\":\"Contains\",\"values\":[\"gcj\",\"fuzmuvpbtt\",\"um\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"nzbtbhj\",\"operator\":\"In\",\"values\":[\"kfgohdneue\"]},\"tags\":{\"name\":\"phsdyhto\",\"operator\":\"Contains\",\"values\":[\"kd\",\"wwquuvxzxclvithh\",\"zonosgg\"]}}],\"dimensions\":{\"name\":\"c\",\"operator\":\"Contains\",\"values\":[\"wdsjnkalju\",\"iiswacffgdkzze\"]},\"tags\":{\"name\":\"fvhqc\",\"operator\":\"In\",\"values\":[\"lvpnpp\",\"uflrwd\",\"hdlxyjrxsagafcn\",\"hgw\"]}},{\"and\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"bcvkcvqvpkeq\",\"operator\":\"Contains\",\"values\":[\"drhvoodsotbo\",\"zdopcjwvnhd\"]},\"tags\":{\"name\":\"wmgxcxrsl\",\"operator\":\"In\",\"values\":[\"twuoegrpkhjwni\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"cpdggkzzlvmbmp\",\"operator\":\"In\",\"values\":[\"odfvuefywsbp\",\"vmwy\",\"rfouyftaakcpw\",\"yzvqt\"]},\"tags\":{\"name\":\"ubex\",\"operator\":\"In\",\"values\":[\"ksmond\",\"mquxvypo\"]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ojvpa\",\"operator\":\"In\",\"values\":[\"xysmoc\",\"bq\",\"qvmkcxo\",\"apvhelxprgly\"]},\"tags\":{\"name\":\"dd\",\"operator\":\"In\",\"values\":[\"bcuejrjxgci\",\"ibrhosxsdqr\",\"zoymibmrqyibahw\",\"luszdtmhrkwof\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"cpi\",\"operator\":\"Contains\",\"values\":[\"btgiwbwoenwas\"]},\"tags\":{\"name\":\"tdtkcn\",\"operator\":\"Contains\",\"values\":[\"bpokulpiujwaasip\",\"i\",\"obyu\",\"erpqlpqwcciuqg\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"uvfbtkuwh\",\"operator\":\"Contains\",\"values\":[\"ykojoxafnndlpic\",\"koymkcd\",\"h\",\"pkkpw\"]},\"tags\":{\"name\":\"eqnovvqfovl\",\"operator\":\"In\",\"values\":[\"wsuwsyr\",\"ndsytgadg\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"neqn\",\"operator\":\"In\",\"values\":[\"rwlqu\",\"ijfqkacewiipfp\",\"bjibwwiftohq\",\"vpuvks\"]},\"tags\":{\"name\":\"lsa\",\"operator\":\"Contains\",\"values\":[\"n\"]}}],\"dimensions\":{\"name\":\"ynl\",\"operator\":\"In\",\"values\":[\"uopxodlqiyntor\",\"ihleos\",\"swsrms\",\"yzrpzbchckqqzq\"]},\"tags\":{\"name\":\"xiy\",\"operator\":\"In\",\"values\":[\"i\",\"ynkedyatrwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\"]}}],\"dimensions\":{\"name\":\"sorgj\",\"operator\":\"Contains\",\"values\":[\"ldtlwwr\",\"kdmtncvokotll\"]},\"tags\":{\"name\":\"yhgsy\",\"operator\":\"Contains\",\"values\":[\"gjltdtbnnhado\",\"crkvcikhnv\",\"amqgxqquezikyw\",\"gxk\"]}}") + "{\"and\":[{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"xllrxcyjm\",\"operator\":\"In\",\"values\":[\"su\",\"arm\",\"wdmjsjqbjhhyx\",\"rw\"]},\"tags\":{\"name\":\"co\",\"operator\":\"Contains\",\"values\":[\"p\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"areqna\",\"operator\":\"Contains\",\"values\":[\"ugjhky\",\"ubeddg\",\"sofwqmzqalkrmnji\"]},\"tags\":{\"name\":\"xacqqudfnbyx\",\"operator\":\"Contains\",\"values\":[\"abjy\",\"ayffim\",\"zrtuzq\",\"gsexne\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"wmewzsyy\",\"operator\":\"In\",\"values\":[\"zsoibjudpfrxtr\",\"hzv\"]},\"tags\":{\"name\":\"tdwkqbrq\",\"operator\":\"Contains\",\"values\":[\"axhexiilivp\"]}},{\"and\":[{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"tdqoaxoruzfgsq\",\"operator\":\"In\",\"values\":[\"xrxxlep\",\"ramxjezwlwnw\"]},\"tags\":{\"name\":\"qlcvydy\",\"operator\":\"Contains\",\"values\":[\"dooaojkniodko\",\"ebwnujhe\"]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"rodtjinfwjlfl\",\"operator\":\"Contains\",\"values\":[\"cjvefkdlfo\",\"kggkfpa\"]},\"tags\":{\"name\":\"owpulpq\",\"operator\":\"In\",\"values\":[\"lsyxkqjnsjervt\",\"agxsdszuemps\",\"zkfzbeyv\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"invkjjxdxrbuu\",\"operator\":\"Contains\",\"values\":[\"lewyhmlwpaz\",\"zpof\"]},\"tags\":{\"name\":\"ckw\",\"operator\":\"In\",\"values\":[\"qwhxxbuyqaxzfeqz\",\"ppriol\",\"or\",\"altol\"]}},{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"bqwcsdbnwdcf\",\"operator\":\"Contains\",\"values\":[\"qdpfuvglsbjjca\",\"vxb\"]},\"tags\":{\"name\":\"vudutncor\",\"operator\":\"In\",\"values\":[\"xqtvcofu\",\"f\",\"vkg\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"nnqvsa\",\"operator\":\"Contains\",\"values\":[\"n\",\"orudsgsa\",\"mkycgra\",\"wjue\"]},\"tags\":{\"name\":\"eburu\",\"operator\":\"In\",\"values\":[\"ovsm\",\"l\",\"wabm\",\"oefki\"]}}],\"dimensions\":{\"name\":\"vtpuqujmqlgk\",\"operator\":\"In\",\"values\":[\"ndo\",\"ongbjcnt\",\"jitcjedftwwaez\"]},\"tags\":{\"name\":\"jvdcpzfoqouic\",\"operator\":\"Contains\",\"values\":[\"arz\",\"szufoxciqopidoa\",\"ciodhkhaz\",\"khnzbonlw\"]}}],\"or\":[{\"and\":[{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"whkszzcmrvexztvb\",\"operator\":\"Contains\",\"values\":[\"sfraoyzko\",\"wtl\",\"nguxawqaldsy\"]},\"tags\":{\"name\":\"ximerqfobwyznk\",\"operator\":\"In\",\"values\":[\"utwpfhp\",\"gmhrskdsnfdsdoak\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"kzevdlhewpusds\",\"operator\":\"Contains\",\"values\":[\"vogvbbejdcngqqmo\",\"kufgmj\",\"rwr\"]},\"tags\":{\"name\":\"rtwaenuuzko\",\"operator\":\"Contains\",\"values\":[\"inrfdwoyu\",\"hziuiefozbhdms\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"oftrmaequia\",\"operator\":\"In\",\"values\":[\"cslfaoqzpiyylha\",\"nswhcc\"]},\"tags\":{\"name\":\"hka\",\"operator\":\"Contains\",\"values\":[\"itqscywuggwoluhc\",\"bwemhairs\",\"rgzdwmsweyp\",\"w\"]}}],\"or\":[{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"n\",\"operator\":\"In\",\"values\":[\"uexmkttlst\",\"lzywemhzrncsdtc\"]},\"tags\":{\"name\":\"siypbs\",\"operator\":\"Contains\",\"values\":[\"tg\",\"sl\"]}},{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"gq\",\"operator\":\"Contains\",\"values\":[\"hejhzisx\",\"fpel\",\"lppvksrpq\"]},\"tags\":{\"name\":\"jzraehtwdwrf\",\"operator\":\"In\",\"values\":[\"iby\"]}},{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"shfwpracstwity\",\"operator\":\"In\",\"values\":[\"vxccedcp\",\"md\",\"odn\"]},\"tags\":{\"name\":\"xltjcvnhltiu\",\"operator\":\"In\",\"values\":[\"navvwx\",\"ibyqunyowxwlmdj\"]}}],\"dimensions\":{\"name\":\"vfgbvfvpdboda\",\"operator\":\"Contains\",\"values\":[\"sjq\",\"hkr\"]},\"tags\":{\"name\":\"bdeibqipqk\",\"operator\":\"Contains\",\"values\":[\"xndzwm\",\"refajpjorwkqnyh\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"fxzsjabibsyst\",\"operator\":\"Contains\",\"values\":[\"sdjpvkvp\",\"jxbkzbzkdvn\",\"jabudurgkakmo\"]},\"tags\":{\"name\":\"hjjklff\",\"operator\":\"Contains\",\"values\":[\"uwqlgzrfzeey\"]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"uhqlbjbsybbqwrvt\",\"operator\":\"Contains\",\"values\":[\"mfpgv\",\"pip\"]},\"tags\":{\"name\":\"ltha\",\"operator\":\"In\",\"values\":[\"ss\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"dsrezpdrhneuyow\",\"operator\":\"In\",\"values\":[\"wyt\"]},\"tags\":{\"name\":\"ib\",\"operator\":\"In\",\"values\":[\"gpikpzimejza\",\"lfzxiavrmbzonoki\"]}},{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"rgz\",\"operator\":\"In\",\"values\":[\"lazszrn\",\"oiindfpwpjy\",\"wbtlhflsjcdh\"]},\"tags\":{\"name\":\"fjvfbgofeljagr\",\"operator\":\"Contains\",\"values\":[\"hldvriii\"]}}],\"dimensions\":{\"name\":\"nalghfkvtvsexso\",\"operator\":\"Contains\",\"values\":[\"luqhhahhxv\"]},\"tags\":{\"name\":\"mzkwpjg\",\"operator\":\"Contains\",\"values\":[\"pughftqsxh\",\"xujxuknd\",\"digrjguufzdmsyqt\"]}},{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"z\",\"operator\":\"Contains\",\"values\":[\"amvpphoszqzudph\"]},\"tags\":{\"name\":\"mvdk\",\"operator\":\"Contains\",\"values\":[\"nwcvtbvkayhmtnv\",\"qiatkzwpcnp\"]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"sgvvsccyajguq\",\"operator\":\"In\",\"values\":[\"ygz\",\"vdnkfxusem\",\"wzrmuh\",\"pfcqdp\"]},\"tags\":{\"name\":\"xqv\",\"operator\":\"In\",\"values\":[\"uoymgccelvezry\"]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"okerqwkyhkobop\",\"operator\":\"In\",\"values\":[\"dkow\",\"pbqpcrfkbwccsn\",\"vcdwxlpqekftn\",\"htjsying\"]},\"tags\":{\"name\":\"qatmtdhtmdvy\",\"operator\":\"In\",\"values\":[\"kdgszywkbirr\",\"uzhlhkjoqrv\",\"qaatjinrv\"]}},{\"and\":[{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"iibfggj\",\"operator\":\"In\",\"values\":[\"lvrwxkvtkk\",\"llqwjygvjayvblmh\"]},\"tags\":{\"name\":\"zuhbxvvyhgsopb\",\"operator\":\"Contains\",\"values\":[\"u\",\"egxuvwzf\",\"nhlmctlpdng\",\"tvgbmhrixkwmy\"]}}],\"or\":[{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"hbpnaixexccbd\",\"operator\":\"Contains\",\"values\":[\"xhcexdrrvqahq\"]},\"tags\":{\"name\":\"htpwij\",\"operator\":\"Contains\",\"values\":[\"jsvfycxzbfvoowv\",\"vmtgjqppy\"]}},{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"zm\",\"operator\":\"Contains\",\"values\":[\"fipns\",\"kmcwaekrrjreafx\"]},\"tags\":{\"name\":\"gumhjglikkxws\",\"operator\":\"In\",\"values\":[\"bq\",\"vuzlm\",\"felfktg\",\"lcrpw\"]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"igbrnjw\",\"operator\":\"In\",\"values\":[\"pn\"]},\"tags\":{\"name\":\"azej\",\"operator\":\"In\",\"values\":[\"kagfhsxtt\",\"ugzxnf\",\"azpxdtnkdmkqjjl\"]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"kpyouaibrebqaay\",\"operator\":\"In\",\"values\":[\"ixqtn\",\"ttezlw\",\"ffiakp\"]},\"tags\":{\"name\":\"qqmtedltmmji\",\"operator\":\"Contains\",\"values\":[\"ozphvwauyqncygu\",\"kvi\"]}}],\"dimensions\":{\"name\":\"dscwxqupevzhf\",\"operator\":\"Contains\",\"values\":[\"txhojujb\",\"pelmcuvhixbjxyf\",\"n\"]},\"tags\":{\"name\":\"r\",\"operator\":\"In\",\"values\":[\"lsttpkiwkkbnuj\"]}}],\"dimensions\":{\"name\":\"wvtylbfpncurdo\",\"operator\":\"Contains\",\"values\":[\"ithtywu\",\"xcbihw\"]},\"tags\":{\"name\":\"nfdn\",\"operator\":\"In\",\"values\":[\"chrdgoihxumwcto\",\"dzjlu\",\"dfdlwggyts\",\"wtovvtgsein\"]}}") .toObject(ReportConfigFilter.class); - Assertions.assertEquals("jixisxyawjoyaqcs", model.and().get(0).and().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("pkii", model.and().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("tpnapnyiropuhpig", model.and().get(0).and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("ylgqgitxmedjvcsl", model.and().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("ewwwfbkrvrnsv", model.and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("xllrxcyjm", model.and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.and().get(0).and().get(0).dimensions().operator()); + Assertions.assertEquals("su", model.and().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("co", model.and().get(0).and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).and().get(0).tags().operator()); + Assertions.assertEquals("p", model.and().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("rodtjinfwjlfl", model.and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("johxcrsb", model.and().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("vasrruvwb", model.and().get(0).or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("fsubcgjbirxbpy", model.and().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("t", model.and().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).dimensions().operator()); - Assertions.assertEquals("fiwjmygtdssls", model.and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("hszhedplvwiwu", model.and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.and().get(0).tags().operator()); - Assertions.assertEquals("mbes", model.and().get(0).tags().values().get(0)); - Assertions.assertEquals("mhhv", model.or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("cjvefkdlfo", model.and().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("owpulpq", model.and().get(0).or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.and().get(0).or().get(0).tags().operator()); + Assertions.assertEquals("lsyxkqjnsjervt", model.and().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("vtpuqujmqlgk", model.and().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.and().get(0).dimensions().operator()); + Assertions.assertEquals("ndo", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("jvdcpzfoqouic", model.and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).tags().operator()); + Assertions.assertEquals("arz", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("whkszzcmrvexztvb", model.or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("r", model.or().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("dkwobdagx", model.or().get(0).and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("qdxbxwa", model.or().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("nzbtbhj", model.or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("sfraoyzko", model.or().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ximerqfobwyznk", model.or().get(0).and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.or().get(0).and().get(0).tags().operator()); + Assertions.assertEquals("utwpfhp", model.or().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("n", model.or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("kfgohdneue", model.or().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("phsdyhto", model.or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("uexmkttlst", model.or().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("siypbs", model.or().get(0).or().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("kd", model.or().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("c", model.or().get(0).dimensions().name()); + Assertions.assertEquals("tg", model.or().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("vfgbvfvpdboda", model.or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).dimensions().operator()); - Assertions.assertEquals("wdsjnkalju", model.or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("fvhqc", model.or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.or().get(0).tags().operator()); - Assertions.assertEquals("lvpnpp", model.or().get(0).tags().values().get(0)); - Assertions.assertEquals("sorgj", model.dimensions().name()); + Assertions.assertEquals("sjq", model.or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("bdeibqipqk", model.or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).tags().operator()); + Assertions.assertEquals("xndzwm", model.or().get(0).tags().values().get(0)); + Assertions.assertEquals("wvtylbfpncurdo", model.dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dimensions().operator()); - Assertions.assertEquals("ldtlwwr", model.dimensions().values().get(0)); - Assertions.assertEquals("yhgsy", model.tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.tags().operator()); - Assertions.assertEquals("gjltdtbnnhado", model.tags().values().get(0)); + Assertions.assertEquals("ithtywu", model.dimensions().values().get(0)); + Assertions.assertEquals("nfdn", model.tags().name()); + Assertions.assertEquals(OperatorType.IN, model.tags().operator()); + Assertions.assertEquals("chrdgoihxumwcto", model.tags().values().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ReportConfigFilter model = new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("jixisxyawjoyaqcs") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("pkii", "zyexzn", "lixhnrztfol", "bnxknalaulppg"))) - .withTags(new ReportConfigComparisonExpression() - .withName("tpnapnyiropuhpig") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("ylgqgitxmedjvcsl", "n", "wwncwzzhxgk", "rmgucnap"))), + .withAnd(Arrays.asList( new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr( - Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("lwptfdy") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("qbuaceopzfqr", "huaoppp", "qeqxo"))) - .withTags(new ReportConfigComparisonExpression().withName("dahzxctobg") + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("xllrxcyjm") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("moizpos", "mgrcfbu", "rmfqjhhkxbpvj"))), - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withValues(Arrays.asList("su", "arm", "wdmjsjqbjhhyx", "rw"))) + .withTags(new ReportConfigComparisonExpression().withName("co") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("p"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("j") + .withDimensions(new ReportConfigComparisonExpression().withName("areqna") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("ugjhky", "ubeddg", "sofwqmzqalkrmnji"))) + .withTags(new ReportConfigComparisonExpression().withName("xacqqudfnbyx") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("abjy", "ayffim", "zrtuzq", "gsexne"))), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("wmewzsyy") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("u", "ivkrtsw", "xqzvszjfa", "vjfdx"))) - .withTags(new ReportConfigComparisonExpression().withName("vetvt") + .withValues(Arrays.asList("zsoibjudpfrxtr", "hzv"))) + .withTags(new ReportConfigComparisonExpression().withName("tdwkqbrq") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("qtdo", "mcbxvwvxysl", "bhsfxob"))))) - .withOr(Arrays.asList( - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withValues(Arrays.asList("axhexiilivp"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("ewwwfbkrvrnsv") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("johxcrsb"))) + .withDimensions(new ReportConfigComparisonExpression().withName("tdqoaxoruzfgsq") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("xrxxlep", "ramxjezwlwnw"))) .withTags(new ReportConfigComparisonExpression() - .withName("vasrruvwb") + .withName("qlcvydy") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("fsubcgjbirxbpy", "srfbjfdtwss", "t"))), - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr( - Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("bexilzznfqqnv") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("qtaruoujmkcjhwq", "tjrybnwjewgdr", "ervnaenqpehi", "doy"))) - .withTags( - new ReportConfigComparisonExpression().withName("ifthnz") + .withValues(Arrays.asList("dooaojkniodko", "ebwnujhe"))))) + .withOr( + Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("rodtjinfwjlfl") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("sl", "nayqi", "ynduha", "hqlkthumaqo"))), - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("uie") - .withOperator(OperatorType.CONTAINS) - .withValues( - Arrays.asList("ccymvaolpsslql", "mmdnbbglzps", "iydmcwyhzdxs", "adbzmnvdfznud"))) - .withTags(new ReportConfigComparisonExpression().withName("dvxzbncblylpst") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("hxsrzdzucersc"))))) - .withDimensions(new ReportConfigComparisonExpression().withName("t") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("fiwjmygtdssls", "tmweriofzpyq", "emwabnet"))) - .withTags(new ReportConfigComparisonExpression().withName("hszhedplvwiwu") + .withValues(Arrays.asList("cjvefkdlfo", "kggkfpa"))) + .withTags(new ReportConfigComparisonExpression().withName("owpulpq") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("lsyxkqjnsjervt", "agxsdszuemps", "zkfzbeyv"))), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("invkjjxdxrbuu") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("lewyhmlwpaz", "zpof"))) + .withTags(new ReportConfigComparisonExpression() + .withName("ckw") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("qwhxxbuyqaxzfeqz", "ppriol", "or", "altol"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression() + .withName("bqwcsdbnwdcf") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("qdpfuvglsbjjca", "vxb"))) + .withTags(new ReportConfigComparisonExpression() + .withName("vudutncor") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("xqtvcofu", "f", "vkg"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("nnqvsa") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("n", "orudsgsa", "mkycgra", "wjue"))) + .withTags(new ReportConfigComparisonExpression().withName("eburu") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("ovsm", "l", "wabm", "oefki"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("vtpuqujmqlgk") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("mbes", "dnkwwtppjflcxog", "okonzmnsikvmkqz"))))) - .withOr( - Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("mhhv") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("r"))) - .withTags(new ReportConfigComparisonExpression().withName("dkwobdagx") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("qdxbxwa", "bogqxndlkzgxhu"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("odxun") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("bxmubyynt", "lrb", "tkoievseotgq"))) - .withTags(new ReportConfigComparisonExpression() - .withName("ltmuwlauwzizx") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("gcj", "fuzmuvpbtt", "um"))))) - .withOr(Arrays.asList(new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withValues(Arrays.asList("ndo", "ongbjcnt", "jitcjedftwwaez"))) + .withTags(new ReportConfigComparisonExpression().withName("jvdcpzfoqouic") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("arz", "szufoxciqopidoa", "ciodhkhaz", "khnzbonlw"))))) + .withOr(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression() + .withName("whkszzcmrvexztvb") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("sfraoyzko", "wtl", "nguxawqaldsy"))) + .withTags(new ReportConfigComparisonExpression() + .withName("ximerqfobwyznk") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("utwpfhp", "gmhrskdsnfdsdoak"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("kzevdlhewpusds") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("vogvbbejdcngqqmo", "kufgmj", "rwr"))) + .withTags(new ReportConfigComparisonExpression().withName("rtwaenuuzko") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("inrfdwoyu", "hziuiefozbhdms"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("oftrmaequia") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("cslfaoqzpiyylha", "nswhcc"))) + .withTags(new ReportConfigComparisonExpression().withName("hka") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("itqscywuggwoluhc", "bwemhairs", "rgzdwmsweyp", "w"))))) + .withOr(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("nzbtbhj") + .withDimensions(new ReportConfigComparisonExpression().withName("n") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("kfgohdneue"))) - .withTags(new ReportConfigComparisonExpression().withName("phsdyhto") + .withValues(Arrays.asList("uexmkttlst", "lzywemhzrncsdtc"))) + .withTags(new ReportConfigComparisonExpression().withName("siypbs") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("tg", "sl"))), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("gq") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("kd", "wwquuvxzxclvithh", "zonosgg"))))) - .withDimensions(new ReportConfigComparisonExpression().withName("c") + .withValues(Arrays.asList("hejhzisx", "fpel", "lppvksrpq"))) + .withTags(new ReportConfigComparisonExpression().withName("jzraehtwdwrf") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("iby"))), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("shfwpracstwity") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("vxccedcp", "md", "odn"))) + .withTags(new ReportConfigComparisonExpression().withName("xltjcvnhltiu") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("navvwx", "ibyqunyowxwlmdj"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("vfgbvfvpdboda") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("sjq", "hkr"))) + .withTags(new ReportConfigComparisonExpression().withName("bdeibqipqk") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("xndzwm", "refajpjorwkqnyh"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("fxzsjabibsyst") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("wdsjnkalju", "iiswacffgdkzze"))) - .withTags(new ReportConfigComparisonExpression().withName("fvhqc") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("lvpnpp", "uflrwd", "hdlxyjrxsagafcn", "hgw"))), - new ReportConfigFilter() - .withAnd(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("bcvkcvqvpkeq") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("drhvoodsotbo", "zdopcjwvnhd"))) - .withTags(new ReportConfigComparisonExpression().withName("wmgxcxrsl") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("twuoegrpkhjwni"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("cpdggkzzlvmbmp") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("odfvuefywsbp", "vmwy", "rfouyftaakcpw", "yzvqt"))) - .withTags(new ReportConfigComparisonExpression().withName("ubex") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("ksmond", "mquxvypo"))))) - .withOr(Arrays.asList( - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("ojvpa") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("xysmoc", "bq", "qvmkcxo", "apvhelxprgly"))) - .withTags(new ReportConfigComparisonExpression().withName("dd") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("bcuejrjxgci", "ibrhosxsdqr", "zoymibmrqyibahw", - "luszdtmhrkwof"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("cpi") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("btgiwbwoenwas"))) - .withTags(new ReportConfigComparisonExpression().withName("tdtkcn") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("bpokulpiujwaasip", "i", "obyu", "erpqlpqwcciuqg"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("uvfbtkuwh") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("ykojoxafnndlpic", "koymkcd", "h", "pkkpw"))) - .withTags(new ReportConfigComparisonExpression().withName("eqnovvqfovl") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("wsuwsyr", "ndsytgadg"))), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("neqn") + .withValues(Arrays.asList("sdjpvkvp", "jxbkzbzkdvn", "jabudurgkakmo"))) + .withTags(new ReportConfigComparisonExpression().withName("hjjklff") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("uwqlgzrfzeey"))))) + .withOr(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("uhqlbjbsybbqwrvt") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("mfpgv", "pip"))) + .withTags(new ReportConfigComparisonExpression().withName("ltha") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("ss"))), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("dsrezpdrhneuyow") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("wyt"))) + .withTags(new ReportConfigComparisonExpression().withName("ib") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("gpikpzimejza", "lfzxiavrmbzonoki"))), + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("rgz") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("lazszrn", "oiindfpwpjy", "wbtlhflsjcdh"))) + .withTags(new ReportConfigComparisonExpression().withName("fjvfbgofeljagr") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("hldvriii"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("nalghfkvtvsexso") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("luqhhahhxv"))) + .withTags(new ReportConfigComparisonExpression().withName("mzkwpjg") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("pughftqsxh", "xujxuknd", "digrjguufzdmsyqt"))), + new ReportConfigFilter() + .withAnd(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("z") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("amvpphoszqzudph"))) + .withTags(new ReportConfigComparisonExpression() + .withName("mvdk") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("nwcvtbvkayhmtnv", "qiatkzwpcnp"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("sgvvsccyajguq") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("ygz", "vdnkfxusem", "wzrmuh", "pfcqdp"))) + .withTags( + new ReportConfigComparisonExpression().withName("xqv") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("rwlqu", "ijfqkacewiipfp", "bjibwwiftohq", "vpuvks"))) - .withTags(new ReportConfigComparisonExpression().withName("lsa") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("n"))))) - .withDimensions(new ReportConfigComparisonExpression().withName("ynl") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("uopxodlqiyntor", "ihleos", "swsrms", "yzrpzbchckqqzq"))) - .withTags(new ReportConfigComparisonExpression().withName("xiy") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("i", "ynkedyatrwyhqmib", "yhwitsmypyynpcdp", "mnzgmwznmabi"))))) - .withDimensions(new ReportConfigComparisonExpression().withName("sorgj") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("ldtlwwr", "kdmtncvokotll"))) - .withTags(new ReportConfigComparisonExpression().withName("yhgsy") + .withValues(Arrays.asList("uoymgccelvezry"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("okerqwkyhkobop") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("dkow", "pbqpcrfkbwccsn", "vcdwxlpqekftn", "htjsying"))) + .withTags(new ReportConfigComparisonExpression() + .withName("qatmtdhtmdvy") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("kdgszywkbirr", "uzhlhkjoqrv", "qaatjinrv"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("iibfggj") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("lvrwxkvtkk", "llqwjygvjayvblmh"))) + .withTags(new ReportConfigComparisonExpression().withName("zuhbxvvyhgsopb") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("u", "egxuvwzf", "nhlmctlpdng", "tvgbmhrixkwmy"))))) + .withOr(Arrays.asList( + new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("hbpnaixexccbd") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("xhcexdrrvqahq"))) + .withTags(new ReportConfigComparisonExpression().withName("htpwij") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("jsvfycxzbfvoowv", "vmtgjqppy"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("zm") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("fipns", "kmcwaekrrjreafx"))) + .withTags(new ReportConfigComparisonExpression().withName("gumhjglikkxws") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("bq", "vuzlm", "felfktg", "lcrpw"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("igbrnjw") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("pn"))) + .withTags(new ReportConfigComparisonExpression().withName("azej") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("kagfhsxtt", "ugzxnf", "azpxdtnkdmkqjjl"))), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("kpyouaibrebqaay") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("ixqtn", "ttezlw", "ffiakp"))) + .withTags(new ReportConfigComparisonExpression().withName("qqmtedltmmji") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("ozphvwauyqncygu", "kvi"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("dscwxqupevzhf") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("txhojujb", "pelmcuvhixbjxyf", "n"))) + .withTags(new ReportConfigComparisonExpression().withName("r") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("lsttpkiwkkbnuj"))))) + .withDimensions(new ReportConfigComparisonExpression().withName("wvtylbfpncurdo") .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("gjltdtbnnhado", "crkvcikhnv", "amqgxqquezikyw", "gxk"))); + .withValues(Arrays.asList("ithtywu", "xcbihw"))) + .withTags(new ReportConfigComparisonExpression().withName("nfdn") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("chrdgoihxumwcto", "dzjlu", "dfdlwggyts", "wtovvtgsein"))); model = BinaryData.fromObject(model).toObject(ReportConfigFilter.class); - Assertions.assertEquals("jixisxyawjoyaqcs", model.and().get(0).and().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("pkii", model.and().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("tpnapnyiropuhpig", model.and().get(0).and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.and().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("ylgqgitxmedjvcsl", model.and().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("ewwwfbkrvrnsv", model.and().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("xllrxcyjm", model.and().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.and().get(0).and().get(0).dimensions().operator()); + Assertions.assertEquals("su", model.and().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("co", model.and().get(0).and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).and().get(0).tags().operator()); + Assertions.assertEquals("p", model.and().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("rodtjinfwjlfl", model.and().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("johxcrsb", model.and().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("vasrruvwb", model.and().get(0).or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("fsubcgjbirxbpy", model.and().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("t", model.and().get(0).dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).dimensions().operator()); - Assertions.assertEquals("fiwjmygtdssls", model.and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("hszhedplvwiwu", model.and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.and().get(0).tags().operator()); - Assertions.assertEquals("mbes", model.and().get(0).tags().values().get(0)); - Assertions.assertEquals("mhhv", model.or().get(0).and().get(0).dimensions().name()); + Assertions.assertEquals("cjvefkdlfo", model.and().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("owpulpq", model.and().get(0).or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.and().get(0).or().get(0).tags().operator()); + Assertions.assertEquals("lsyxkqjnsjervt", model.and().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("vtpuqujmqlgk", model.and().get(0).dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.and().get(0).dimensions().operator()); + Assertions.assertEquals("ndo", model.and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("jvdcpzfoqouic", model.and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.and().get(0).tags().operator()); + Assertions.assertEquals("arz", model.and().get(0).tags().values().get(0)); + Assertions.assertEquals("whkszzcmrvexztvb", model.or().get(0).and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).and().get(0).dimensions().operator()); - Assertions.assertEquals("r", model.or().get(0).and().get(0).dimensions().values().get(0)); - Assertions.assertEquals("dkwobdagx", model.or().get(0).and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).and().get(0).tags().operator()); - Assertions.assertEquals("qdxbxwa", model.or().get(0).and().get(0).tags().values().get(0)); - Assertions.assertEquals("nzbtbhj", model.or().get(0).or().get(0).dimensions().name()); + Assertions.assertEquals("sfraoyzko", model.or().get(0).and().get(0).dimensions().values().get(0)); + Assertions.assertEquals("ximerqfobwyznk", model.or().get(0).and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.IN, model.or().get(0).and().get(0).tags().operator()); + Assertions.assertEquals("utwpfhp", model.or().get(0).and().get(0).tags().values().get(0)); + Assertions.assertEquals("n", model.or().get(0).or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.IN, model.or().get(0).or().get(0).dimensions().operator()); - Assertions.assertEquals("kfgohdneue", model.or().get(0).or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("phsdyhto", model.or().get(0).or().get(0).tags().name()); + Assertions.assertEquals("uexmkttlst", model.or().get(0).or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("siypbs", model.or().get(0).or().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).or().get(0).tags().operator()); - Assertions.assertEquals("kd", model.or().get(0).or().get(0).tags().values().get(0)); - Assertions.assertEquals("c", model.or().get(0).dimensions().name()); + Assertions.assertEquals("tg", model.or().get(0).or().get(0).tags().values().get(0)); + Assertions.assertEquals("vfgbvfvpdboda", model.or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).dimensions().operator()); - Assertions.assertEquals("wdsjnkalju", model.or().get(0).dimensions().values().get(0)); - Assertions.assertEquals("fvhqc", model.or().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.or().get(0).tags().operator()); - Assertions.assertEquals("lvpnpp", model.or().get(0).tags().values().get(0)); - Assertions.assertEquals("sorgj", model.dimensions().name()); + Assertions.assertEquals("sjq", model.or().get(0).dimensions().values().get(0)); + Assertions.assertEquals("bdeibqipqk", model.or().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.or().get(0).tags().operator()); + Assertions.assertEquals("xndzwm", model.or().get(0).tags().values().get(0)); + Assertions.assertEquals("wvtylbfpncurdo", model.dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dimensions().operator()); - Assertions.assertEquals("ldtlwwr", model.dimensions().values().get(0)); - Assertions.assertEquals("yhgsy", model.tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.tags().operator()); - Assertions.assertEquals("gjltdtbnnhado", model.tags().values().get(0)); + Assertions.assertEquals("ithtywu", model.dimensions().values().get(0)); + Assertions.assertEquals("nfdn", model.tags().name()); + Assertions.assertEquals(OperatorType.IN, model.tags().operator()); + Assertions.assertEquals("chrdgoihxumwcto", model.tags().values().get(0)); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigGroupingTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigGroupingTests.java index 99fac4ee522a..c1c964130f23 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigGroupingTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigGroupingTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,18 +12,17 @@ public final class ReportConfigGroupingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReportConfigGrouping model = BinaryData.fromString("{\"type\":\"Dimension\",\"name\":\"touwaboekqv\"}") - .toObject(ReportConfigGrouping.class); - Assertions.assertEquals(QueryColumnType.DIMENSION, model.type()); - Assertions.assertEquals("touwaboekqv", model.name()); + ReportConfigGrouping model + = BinaryData.fromString("{\"type\":\"TagKey\",\"name\":\"ikh\"}").toObject(ReportConfigGrouping.class); + Assertions.assertEquals(QueryColumnType.TAG_KEY, model.type()); + Assertions.assertEquals("ikh", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ReportConfigGrouping model - = new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("touwaboekqv"); + ReportConfigGrouping model = new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("ikh"); model = BinaryData.fromObject(model).toObject(ReportConfigGrouping.class); - Assertions.assertEquals(QueryColumnType.DIMENSION, model.type()); - Assertions.assertEquals("touwaboekqv", model.name()); + Assertions.assertEquals(QueryColumnType.TAG_KEY, model.type()); + Assertions.assertEquals("ikh", model.name()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigSortingTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigSortingTests.java index acdefeb3ab94..356fada44bbd 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigSortingTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigSortingTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,18 +12,18 @@ public final class ReportConfigSortingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReportConfigSorting model = BinaryData.fromString("{\"direction\":\"Ascending\",\"name\":\"nsmvbxwyj\"}") + ReportConfigSorting model = BinaryData.fromString("{\"direction\":\"Ascending\",\"name\":\"jhdgqggebdunyga\"}") .toObject(ReportConfigSorting.class); Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.direction()); - Assertions.assertEquals("nsmvbxwyj", model.name()); + Assertions.assertEquals("jhdgqggebdunyga", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ReportConfigSorting model - = new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("nsmvbxwyj"); + = new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("jhdgqggebdunyga"); model = BinaryData.fromObject(model).toObject(ReportConfigSorting.class); Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.direction()); - Assertions.assertEquals("nsmvbxwyj", model.name()); + Assertions.assertEquals("jhdgqggebdunyga", model.name()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigTimePeriodTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigTimePeriodTests.java index 055c18f6ad92..ac15a3fc5f04 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigTimePeriodTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportConfigTimePeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,18 +13,19 @@ public final class ReportConfigTimePeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReportConfigTimePeriod model - = BinaryData.fromString("{\"from\":\"2021-11-04T11:41Z\",\"to\":\"2021-07-19T09:21:05Z\"}") + = BinaryData.fromString("{\"from\":\"2021-04-02T19:32:11Z\",\"to\":\"2021-01-25T09:43:43Z\"}") .toObject(ReportConfigTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T11:41Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T09:21:05Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T19:32:11Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T09:43:43Z"), model.to()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ReportConfigTimePeriod model = new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-11-04T11:41Z")) - .withTo(OffsetDateTime.parse("2021-07-19T09:21:05Z")); + ReportConfigTimePeriod model + = new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-04-02T19:32:11Z")) + .withTo(OffsetDateTime.parse("2021-01-25T09:43:43Z")); model = BinaryData.fromObject(model).toObject(ReportConfigTimePeriod.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T11:41Z"), model.from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T09:21:05Z"), model.to()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T19:32:11Z"), model.from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T09:43:43Z"), model.to()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportManifestTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportManifestTests.java index 0c535291d1e4..b6be96c9059c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportManifestTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportManifestTests.java @@ -1,68 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.ReportManifest; -import com.azure.resourcemanager.costmanagement.models.BlobInfo; import com.azure.resourcemanager.costmanagement.models.CostDetailsDataFormat; import com.azure.resourcemanager.costmanagement.models.CostDetailsMetricType; -import com.azure.resourcemanager.costmanagement.models.CostDetailsTimePeriod; -import com.azure.resourcemanager.costmanagement.models.GenerateCostDetailsReportRequestDefinition; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ReportManifestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReportManifest model = BinaryData.fromString( - "{\"manifestVersion\":\"iqwoyxqvapcoh\",\"dataFormat\":\"Csv\",\"byteCount\":3950862248978606581,\"blobCount\":321027752,\"compressData\":true,\"requestContext\":{\"requestScope\":\"zrzdcgd\",\"requestBody\":{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"ibcawetzqddtjw\",\"end\":\"ljhznamtuatmzwcj\"},\"billingPeriod\":\"cqtjzmi\",\"invoiceId\":\"gbgatzuuvbxn\"}},\"blobs\":[{\"blobLink\":\"wggahttzlswvaj\",\"byteCount\":8715350497640016717},{\"blobLink\":\"x\",\"byteCount\":8142650207393641540}]}") + "{\"manifestVersion\":\"dbxiqx\",\"dataFormat\":\"Csv\",\"byteCount\":4410581477178003370,\"blobCount\":2092757029,\"compressData\":true,\"requestContext\":{\"requestScope\":\"inheh\",\"requestBody\":{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"vwbcblembnkbwv\",\"end\":\"vxkdivqihebwtswb\"},\"billingPeriod\":\"wfmdurage\",\"invoiceId\":\"zvcjfelisdjubggb\"}},\"blobs\":[{\"blobLink\":\"xkbsazgakgac\",\"byteCount\":1058435758897538488},{\"blobLink\":\"dmspof\",\"byteCount\":8260920896758809530},{\"blobLink\":\"rylniofrzg\",\"byteCount\":2813086357064357787}]}") .toObject(ReportManifest.class); - Assertions.assertEquals("iqwoyxqvapcoh", model.manifestVersion()); + Assertions.assertEquals("dbxiqx", model.manifestVersion()); Assertions.assertEquals(CostDetailsDataFormat.CSV, model.dataFormat()); - Assertions.assertEquals(3950862248978606581L, model.byteCount()); - Assertions.assertEquals(321027752, model.blobCount()); - Assertions.assertEquals(true, model.compressData()); - Assertions.assertEquals("wggahttzlswvaj", model.blobs().get(0).blobLink()); - Assertions.assertEquals(8715350497640016717L, model.blobs().get(0).byteCount()); - Assertions.assertEquals("zrzdcgd", model.requestScope()); + Assertions.assertEquals(4410581477178003370L, model.byteCount()); + Assertions.assertEquals(2092757029, model.blobCount()); + Assertions.assertTrue(model.compressData()); + Assertions.assertEquals("xkbsazgakgac", model.blobs().get(0).blobLink()); + Assertions.assertEquals(1058435758897538488L, model.blobs().get(0).byteCount()); + Assertions.assertEquals("inheh", model.requestScope()); Assertions.assertEquals(CostDetailsMetricType.ACTUAL_COST, model.requestBody().metric()); - Assertions.assertEquals("ibcawetzqddtjw", model.requestBody().timePeriod().start()); - Assertions.assertEquals("ljhznamtuatmzwcj", model.requestBody().timePeriod().end()); - Assertions.assertEquals("cqtjzmi", model.requestBody().billingPeriod()); - Assertions.assertEquals("gbgatzuuvbxn", model.requestBody().invoiceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReportManifest model = new ReportManifest().withManifestVersion("iqwoyxqvapcoh") - .withDataFormat(CostDetailsDataFormat.CSV) - .withByteCount(3950862248978606581L) - .withBlobCount(321027752) - .withCompressData(true) - .withBlobs(Arrays.asList(new BlobInfo().withBlobLink("wggahttzlswvaj").withByteCount(8715350497640016717L), - new BlobInfo().withBlobLink("x").withByteCount(8142650207393641540L))) - .withRequestScope("zrzdcgd") - .withRequestBody( - new GenerateCostDetailsReportRequestDefinition().withMetric(CostDetailsMetricType.ACTUAL_COST) - .withTimePeriod(new CostDetailsTimePeriod().withStart("ibcawetzqddtjw").withEnd("ljhznamtuatmzwcj")) - .withBillingPeriod("cqtjzmi") - .withInvoiceId("gbgatzuuvbxn")); - model = BinaryData.fromObject(model).toObject(ReportManifest.class); - Assertions.assertEquals("iqwoyxqvapcoh", model.manifestVersion()); - Assertions.assertEquals(CostDetailsDataFormat.CSV, model.dataFormat()); - Assertions.assertEquals(3950862248978606581L, model.byteCount()); - Assertions.assertEquals(321027752, model.blobCount()); - Assertions.assertEquals(true, model.compressData()); - Assertions.assertEquals("wggahttzlswvaj", model.blobs().get(0).blobLink()); - Assertions.assertEquals(8715350497640016717L, model.blobs().get(0).byteCount()); - Assertions.assertEquals("zrzdcgd", model.requestScope()); - Assertions.assertEquals(CostDetailsMetricType.ACTUAL_COST, model.requestBody().metric()); - Assertions.assertEquals("ibcawetzqddtjw", model.requestBody().timePeriod().start()); - Assertions.assertEquals("ljhznamtuatmzwcj", model.requestBody().timePeriod().end()); - Assertions.assertEquals("cqtjzmi", model.requestBody().billingPeriod()); - Assertions.assertEquals("gbgatzuuvbxn", model.requestBody().invoiceId()); + Assertions.assertEquals("vwbcblembnkbwv", model.requestBody().timePeriod().start()); + Assertions.assertEquals("vxkdivqihebwtswb", model.requestBody().timePeriod().end()); + Assertions.assertEquals("wfmdurage", model.requestBody().billingPeriod()); + Assertions.assertEquals("zvcjfelisdjubggb", model.requestBody().invoiceId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportUrlTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportUrlTests.java index 133a55d3de16..858c7a851bb8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportUrlTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ReportUrlTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,19 +13,9 @@ public final class ReportUrlTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReportUrl model - = BinaryData.fromString("{\"reportUrl\":\"ReservationOrderId\",\"validUntil\":\"2021-02-04T02:41:34Z\"}") - .toObject(ReportUrl.class); - Assertions.assertEquals(ReservationReportSchema.RESERVATION_ORDER_ID, model.reportUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T02:41:34Z"), model.validUntil()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReportUrl model = new ReportUrl().withReportUrl(ReservationReportSchema.RESERVATION_ORDER_ID) - .withValidUntil(OffsetDateTime.parse("2021-02-04T02:41:34Z")); - model = BinaryData.fromObject(model).toObject(ReportUrl.class); - Assertions.assertEquals(ReservationReportSchema.RESERVATION_ORDER_ID, model.reportUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T02:41:34Z"), model.validUntil()); + ReportUrl model = BinaryData.fromString("{\"reportUrl\":\"SkuName\",\"validUntil\":\"2021-05-14T14:18:42Z\"}") + .toObject(ReportUrl.class); + Assertions.assertEquals(ReservationReportSchema.SKU_NAME, model.reportUrl()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T14:18:42Z"), model.validUntil()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RequestContextTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RequestContextTests.java index e31e41ef43de..f6ef47b558d4 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RequestContextTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/RequestContextTests.java @@ -1,44 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.costmanagement.fluent.models.RequestContext; import com.azure.resourcemanager.costmanagement.models.CostDetailsMetricType; -import com.azure.resourcemanager.costmanagement.models.CostDetailsTimePeriod; -import com.azure.resourcemanager.costmanagement.models.GenerateCostDetailsReportRequestDefinition; import org.junit.jupiter.api.Assertions; public final class RequestContextTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RequestContext model = BinaryData.fromString( - "{\"requestScope\":\"sunwqrjzfrgqhaoh\",\"requestBody\":{\"metric\":\"AmortizedCost\",\"timePeriod\":{\"start\":\"cnjrohmbpyryxame\",\"end\":\"l\"},\"billingPeriod\":\"yvk\",\"invoiceId\":\"m\"}}") + "{\"requestScope\":\"mstk\",\"requestBody\":{\"metric\":\"ActualCost\",\"timePeriod\":{\"start\":\"bcuiiz\",\"end\":\"ktwfa\"},\"billingPeriod\":\"nv\",\"invoiceId\":\"ibmikostbzb\"}}") .toObject(RequestContext.class); - Assertions.assertEquals("sunwqrjzfrgqhaoh", model.requestScope()); - Assertions.assertEquals(CostDetailsMetricType.AMORTIZED_COST, model.requestBody().metric()); - Assertions.assertEquals("cnjrohmbpyryxame", model.requestBody().timePeriod().start()); - Assertions.assertEquals("l", model.requestBody().timePeriod().end()); - Assertions.assertEquals("yvk", model.requestBody().billingPeriod()); - Assertions.assertEquals("m", model.requestBody().invoiceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RequestContext model = new RequestContext().withRequestScope("sunwqrjzfrgqhaoh") - .withRequestBody( - new GenerateCostDetailsReportRequestDefinition().withMetric(CostDetailsMetricType.AMORTIZED_COST) - .withTimePeriod(new CostDetailsTimePeriod().withStart("cnjrohmbpyryxame").withEnd("l")) - .withBillingPeriod("yvk") - .withInvoiceId("m")); - model = BinaryData.fromObject(model).toObject(RequestContext.class); - Assertions.assertEquals("sunwqrjzfrgqhaoh", model.requestScope()); - Assertions.assertEquals(CostDetailsMetricType.AMORTIZED_COST, model.requestBody().metric()); - Assertions.assertEquals("cnjrohmbpyryxame", model.requestBody().timePeriod().start()); - Assertions.assertEquals("l", model.requestBody().timePeriod().end()); - Assertions.assertEquals("yvk", model.requestBody().billingPeriod()); - Assertions.assertEquals("m", model.requestBody().invoiceId()); + Assertions.assertEquals("mstk", model.requestScope()); + Assertions.assertEquals(CostDetailsMetricType.ACTUAL_COST, model.requestBody().metric()); + Assertions.assertEquals("bcuiiz", model.requestBody().timePeriod().start()); + Assertions.assertEquals("ktwfa", model.requestBody().timePeriod().end()); + Assertions.assertEquals("nv", model.requestBody().billingPeriod()); + Assertions.assertEquals("ibmikostbzb", model.requestBody().invoiceId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryPropertiesTests.java index 51da3418d5e1..6dca6d43e56c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,8 @@ public final class SavingsPlanUtilizationSummaryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavingsPlanUtilizationSummaryProperties model = BinaryData.fromString( - "{\"armSkuName\":\"arvvlfnt\",\"benefitId\":\"tpo\",\"benefitOrderId\":\"enazerohzrsqals\",\"benefitType\":\"SavingsPlan\",\"usageDate\":\"2021-01-21T06:07:33Z\"}") + "{\"avgUtilizationPercentage\":4592711214111128631,\"minUtilizationPercentage\":1529369031072827949,\"maxUtilizationPercentage\":8894754548360108244,\"armSkuName\":\"mr\",\"benefitId\":\"njlx\",\"benefitOrderId\":\"rhwpus\",\"benefitType\":\"IncludedQuantity\",\"usageDate\":\"2021-11-24T21:40:54Z\"}") .toObject(SavingsPlanUtilizationSummaryProperties.class); - Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SavingsPlanUtilizationSummaryProperties model - = new SavingsPlanUtilizationSummaryProperties().withBenefitType(BenefitKind.SAVINGS_PLAN); - model = BinaryData.fromObject(model).toObject(SavingsPlanUtilizationSummaryProperties.class); - Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); + Assertions.assertEquals(BenefitKind.INCLUDED_QUANTITY, model.benefitType()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryTests.java index 3fe6a8691f03..3219ddfa5326 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SavingsPlanUtilizationSummaryTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -13,16 +13,8 @@ public final class SavingsPlanUtilizationSummaryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavingsPlanUtilizationSummary model = BinaryData.fromString( - "{\"kind\":\"SavingsPlan\",\"properties\":{\"armSkuName\":\"oejnndljdju\",\"benefitId\":\"br\",\"benefitOrderId\":\"qyn\",\"benefitType\":\"Reservation\",\"usageDate\":\"2021-10-29T09:08:54Z\"},\"id\":\"faqegplwryshwddk\",\"name\":\"bxgkqusy\",\"type\":\"w\"}") + "{\"kind\":\"SavingsPlan\",\"properties\":{\"avgUtilizationPercentage\":907482374428904956,\"minUtilizationPercentage\":7262509075700737788,\"maxUtilizationPercentage\":6288676916891671454,\"armSkuName\":\"ccxlzhcoxovnek\",\"benefitId\":\"nlusfnrd\",\"benefitOrderId\":\"xtxrdcqtjvidt\",\"benefitType\":\"SavingsPlan\",\"usageDate\":\"2021-10-13T20:54:17Z\"},\"id\":\"lvyjtcvuwkas\",\"name\":\"zies\",\"type\":\"uughtuqfecjxeyg\"}") .toObject(SavingsPlanUtilizationSummary.class); - Assertions.assertEquals(BenefitKind.RESERVATION, model.benefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SavingsPlanUtilizationSummary model - = new SavingsPlanUtilizationSummary().withBenefitType(BenefitKind.RESERVATION); - model = BinaryData.fromObject(model).toObject(SavingsPlanUtilizationSummary.class); - Assertions.assertEquals(BenefitKind.RESERVATION, model.benefitType()); + Assertions.assertEquals(BenefitKind.SAVINGS_PLAN, model.benefitType()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SchedulePropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SchedulePropertiesTests.java index aec64d36ea0b..43f962b03e57 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SchedulePropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SchedulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -17,33 +17,33 @@ public final class SchedulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleProperties model = BinaryData.fromString( - "{\"frequency\":\"Weekly\",\"hourOfDay\":1596412285,\"daysOfWeek\":[\"Thursday\",\"Thursday\",\"Monday\"],\"weeksOfMonth\":[\"Second\",\"Fourth\",\"First\"],\"dayOfMonth\":175605936,\"startDate\":\"2021-03-27T04:25:16Z\",\"endDate\":\"2021-09-10T17:22:19Z\"}") + "{\"frequency\":\"Daily\",\"hourOfDay\":1984466292,\"daysOfWeek\":[\"Wednesday\",\"Sunday\"],\"weeksOfMonth\":[\"First\",\"Last\",\"Second\"],\"dayOfMonth\":773747367,\"startDate\":\"2021-02-16T12:11:45Z\",\"endDate\":\"2021-09-03T11:50:17Z\"}") .toObject(ScheduleProperties.class); - Assertions.assertEquals(ScheduleFrequency.WEEKLY, model.frequency()); - Assertions.assertEquals(1596412285, model.hourOfDay()); - Assertions.assertEquals(DaysOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.SECOND, model.weeksOfMonth().get(0)); - Assertions.assertEquals(175605936, model.dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T04:25:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T17:22:19Z"), model.endDate()); + Assertions.assertEquals(ScheduleFrequency.DAILY, model.frequency()); + Assertions.assertEquals(1984466292, model.hourOfDay()); + Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FIRST, model.weeksOfMonth().get(0)); + Assertions.assertEquals(773747367, model.dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T12:11:45Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-03T11:50:17Z"), model.endDate()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleProperties model = new ScheduleProperties().withFrequency(ScheduleFrequency.WEEKLY) - .withHourOfDay(1596412285) - .withDaysOfWeek(Arrays.asList(DaysOfWeek.THURSDAY, DaysOfWeek.THURSDAY, DaysOfWeek.MONDAY)) - .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.SECOND, WeeksOfMonth.FOURTH, WeeksOfMonth.FIRST)) - .withDayOfMonth(175605936) - .withStartDate(OffsetDateTime.parse("2021-03-27T04:25:16Z")) - .withEndDate(OffsetDateTime.parse("2021-09-10T17:22:19Z")); + ScheduleProperties model = new ScheduleProperties().withFrequency(ScheduleFrequency.DAILY) + .withHourOfDay(1984466292) + .withDaysOfWeek(Arrays.asList(DaysOfWeek.WEDNESDAY, DaysOfWeek.SUNDAY)) + .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.FIRST, WeeksOfMonth.LAST, WeeksOfMonth.SECOND)) + .withDayOfMonth(773747367) + .withStartDate(OffsetDateTime.parse("2021-02-16T12:11:45Z")) + .withEndDate(OffsetDateTime.parse("2021-09-03T11:50:17Z")); model = BinaryData.fromObject(model).toObject(ScheduleProperties.class); - Assertions.assertEquals(ScheduleFrequency.WEEKLY, model.frequency()); - Assertions.assertEquals(1596412285, model.hourOfDay()); - Assertions.assertEquals(DaysOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.SECOND, model.weeksOfMonth().get(0)); - Assertions.assertEquals(175605936, model.dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T04:25:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T17:22:19Z"), model.endDate()); + Assertions.assertEquals(ScheduleFrequency.DAILY, model.frequency()); + Assertions.assertEquals(1984466292, model.hourOfDay()); + Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FIRST, model.weeksOfMonth().get(0)); + Assertions.assertEquals(773747367, model.dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T12:11:45Z"), model.startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-03T11:50:17Z"), model.endDate()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionInnerTests.java index 5332c93457e7..ec87e217f6a2 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -23,69 +23,73 @@ public final class ScheduledActionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledActionInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"akuflgbhgauacdix\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"ryjqgdkf\",\"ozo\",\"oqbvjhvefgwbmqj\"],\"language\":\"ntasfaymxbu\",\"message\":\"zealbmqkyo\",\"regionalFormat\":\"yvfkmbts\",\"subject\":\"ahxsgxjcmm\"},\"notificationEmail\":\"rsc\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":1315033089,\"daysOfWeek\":[\"Monday\",\"Friday\",\"Friday\"],\"weeksOfMonth\":[\"Fourth\",\"Third\",\"Last\"],\"dayOfMonth\":1635152629,\"startDate\":\"2021-07-15T05:36:07Z\",\"endDate\":\"2021-09-20T06:50:41Z\"},\"scope\":\"cjrmmua\",\"status\":\"Enabled\",\"viewId\":\"ibvjogjonmcy\"},\"eTag\":\"oyzbamwineofvf\",\"kind\":\"InsightAlert\",\"id\":\"oldtvevboclzhz\",\"name\":\"knyuxgvttxpn\",\"type\":\"upzaamrdixtre\"}") + "{\"properties\":{\"displayName\":\"mwmdxmebwjscjpa\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"xnmwmqtibxyijddt\",\"qcttadijaeukmrsi\"],\"language\":\"kpn\",\"message\":\"aapm\",\"regionalFormat\":\"qmeqwigpibudqwyx\",\"subject\":\"beybpmzznrtffyaq\"},\"notificationEmail\":\"mhh\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":364204104,\"daysOfWeek\":[\"Wednesday\",\"Saturday\",\"Wednesday\"],\"weeksOfMonth\":[\"First\",\"Last\"],\"dayOfMonth\":695023637,\"startDate\":\"2021-10-14T10:17:06Z\",\"endDate\":\"2021-04-20T04:35:27Z\"},\"scope\":\"dlcgqlsismjqfr\",\"status\":\"Enabled\",\"viewId\":\"gamquhiosrsjui\"},\"eTag\":\"cdisyir\",\"kind\":\"InsightAlert\",\"id\":\"czexrxzbujrtrhqv\",\"name\":\"revkhgnlnzo\",\"type\":\"zlrpiqywncvj\"}") .toObject(ScheduledActionInner.class); + Assertions.assertEquals("cdisyir", model.etag()); Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, model.kind()); - Assertions.assertEquals("akuflgbhgauacdix", model.displayName()); + Assertions.assertEquals("mwmdxmebwjscjpa", model.displayName()); Assertions.assertEquals(FileFormat.CSV, model.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("ryjqgdkf", model.notification().to().get(0)); - Assertions.assertEquals("ntasfaymxbu", model.notification().language()); - Assertions.assertEquals("zealbmqkyo", model.notification().message()); - Assertions.assertEquals("yvfkmbts", model.notification().regionalFormat()); - Assertions.assertEquals("ahxsgxjcmm", model.notification().subject()); - Assertions.assertEquals("rsc", model.notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.MONTHLY, model.schedule().frequency()); - Assertions.assertEquals(1315033089, model.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.MONDAY, model.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FOURTH, model.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(1635152629, model.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T05:36:07Z"), model.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T06:50:41Z"), model.schedule().endDate()); - Assertions.assertEquals("cjrmmua", model.scope()); + Assertions.assertEquals("xnmwmqtibxyijddt", model.notification().to().get(0)); + Assertions.assertEquals("kpn", model.notification().language()); + Assertions.assertEquals("aapm", model.notification().message()); + Assertions.assertEquals("qmeqwigpibudqwyx", model.notification().regionalFormat()); + Assertions.assertEquals("beybpmzznrtffyaq", model.notification().subject()); + Assertions.assertEquals("mhh", model.notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.WEEKLY, model.schedule().frequency()); + Assertions.assertEquals(364204104, model.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FIRST, model.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(695023637, model.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-14T10:17:06Z"), model.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T04:35:27Z"), model.schedule().endDate()); + Assertions.assertEquals("dlcgqlsismjqfr", model.scope()); Assertions.assertEquals(ScheduledActionStatus.ENABLED, model.status()); - Assertions.assertEquals("ibvjogjonmcy", model.viewId()); + Assertions.assertEquals("gamquhiosrsjui", model.viewId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduledActionInner model = new ScheduledActionInner().withKind(ScheduledActionKind.INSIGHT_ALERT) - .withDisplayName("akuflgbhgauacdix") - .withFileDestination(new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV))) - .withNotification(new NotificationProperties().withTo(Arrays.asList("ryjqgdkf", "ozo", "oqbvjhvefgwbmqj")) - .withLanguage("ntasfaymxbu") - .withMessage("zealbmqkyo") - .withRegionalFormat("yvfkmbts") - .withSubject("ahxsgxjcmm")) - .withNotificationEmail("rsc") - .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.MONTHLY) - .withHourOfDay(1315033089) - .withDaysOfWeek(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.FRIDAY, DaysOfWeek.FRIDAY)) - .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.FOURTH, WeeksOfMonth.THIRD, WeeksOfMonth.LAST)) - .withDayOfMonth(1635152629) - .withStartDate(OffsetDateTime.parse("2021-07-15T05:36:07Z")) - .withEndDate(OffsetDateTime.parse("2021-09-20T06:50:41Z"))) - .withScope("cjrmmua") + ScheduledActionInner model = new ScheduledActionInner().withEtag("cdisyir") + .withKind(ScheduledActionKind.INSIGHT_ALERT) + .withDisplayName("mwmdxmebwjscjpa") + .withFileDestination(new FileDestination() + .withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV, FileFormat.CSV, FileFormat.CSV))) + .withNotification(new NotificationProperties().withTo(Arrays.asList("xnmwmqtibxyijddt", "qcttadijaeukmrsi")) + .withLanguage("kpn") + .withMessage("aapm") + .withRegionalFormat("qmeqwigpibudqwyx") + .withSubject("beybpmzznrtffyaq")) + .withNotificationEmail("mhh") + .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.WEEKLY) + .withHourOfDay(364204104) + .withDaysOfWeek(Arrays.asList(DaysOfWeek.WEDNESDAY, DaysOfWeek.SATURDAY, DaysOfWeek.WEDNESDAY)) + .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.FIRST, WeeksOfMonth.LAST)) + .withDayOfMonth(695023637) + .withStartDate(OffsetDateTime.parse("2021-10-14T10:17:06Z")) + .withEndDate(OffsetDateTime.parse("2021-04-20T04:35:27Z"))) + .withScope("dlcgqlsismjqfr") .withStatus(ScheduledActionStatus.ENABLED) - .withViewId("ibvjogjonmcy"); + .withViewId("gamquhiosrsjui"); model = BinaryData.fromObject(model).toObject(ScheduledActionInner.class); + Assertions.assertEquals("cdisyir", model.etag()); Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, model.kind()); - Assertions.assertEquals("akuflgbhgauacdix", model.displayName()); + Assertions.assertEquals("mwmdxmebwjscjpa", model.displayName()); Assertions.assertEquals(FileFormat.CSV, model.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("ryjqgdkf", model.notification().to().get(0)); - Assertions.assertEquals("ntasfaymxbu", model.notification().language()); - Assertions.assertEquals("zealbmqkyo", model.notification().message()); - Assertions.assertEquals("yvfkmbts", model.notification().regionalFormat()); - Assertions.assertEquals("ahxsgxjcmm", model.notification().subject()); - Assertions.assertEquals("rsc", model.notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.MONTHLY, model.schedule().frequency()); - Assertions.assertEquals(1315033089, model.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.MONDAY, model.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FOURTH, model.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(1635152629, model.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T05:36:07Z"), model.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T06:50:41Z"), model.schedule().endDate()); - Assertions.assertEquals("cjrmmua", model.scope()); + Assertions.assertEquals("xnmwmqtibxyijddt", model.notification().to().get(0)); + Assertions.assertEquals("kpn", model.notification().language()); + Assertions.assertEquals("aapm", model.notification().message()); + Assertions.assertEquals("qmeqwigpibudqwyx", model.notification().regionalFormat()); + Assertions.assertEquals("beybpmzznrtffyaq", model.notification().subject()); + Assertions.assertEquals("mhh", model.notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.WEEKLY, model.schedule().frequency()); + Assertions.assertEquals(364204104, model.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.WEDNESDAY, model.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FIRST, model.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(695023637, model.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-14T10:17:06Z"), model.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T04:35:27Z"), model.schedule().endDate()); + Assertions.assertEquals("dlcgqlsismjqfr", model.scope()); Assertions.assertEquals(ScheduledActionStatus.ENABLED, model.status()); - Assertions.assertEquals("ibvjogjonmcy", model.viewId()); + Assertions.assertEquals("gamquhiosrsjui", model.viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionListResultTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionListResultTests.java index fce1d087d51d..75b947495387 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionListResultTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.costmanagement.models.ScheduledActionListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.ScheduledActionListResult; +import org.junit.jupiter.api.Assertions; public final class ScheduledActionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledActionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ksrf\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"knbnxwcdommpvfq\",\"wzfgbrttuiaclkie\",\"hajlfn\",\"hiqfyuttdiy\"],\"language\":\"pvn\",\"message\":\"wmtxkyctwwgz\",\"regionalFormat\":\"jlmec\",\"subject\":\"og\"},\"notificationEmail\":\"zyvneezaifghtmo\",\"schedule\":{\"frequency\":\"Daily\",\"hourOfDay\":1170514735,\"daysOfWeek\":[\"Friday\",\"Friday\"],\"weeksOfMonth\":[\"First\",\"Second\",\"Fourth\"],\"dayOfMonth\":1533703723,\"startDate\":\"2021-09-28T07:28:53Z\",\"endDate\":\"2021-09-11T17:32:30Z\"},\"scope\":\"qnvhnqoe\",\"status\":\"Enabled\",\"viewId\":\"ogiyetes\"},\"eTag\":\"vidbztjhqtfb\",\"kind\":\"Email\",\"id\":\"nkbw\",\"name\":\"tnjuhpsprkzyaupi\",\"type\":\"ccxnafbwqroohtuo\"},{\"properties\":{\"displayName\":\"aonurjtumg\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"cmslclblyjxltbs\",\"uscv\",\"f\"],\"language\":\"gctmgxuupbezq\",\"message\":\"ydrtc\",\"regionalFormat\":\"kdqkkyihzt\",\"subject\":\"eq\"},\"notificationEmail\":\"qzgwldoychil\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":751938548,\"daysOfWeek\":[\"Sunday\",\"Friday\"],\"weeksOfMonth\":[\"Last\",\"Fourth\",\"First\"],\"dayOfMonth\":16426633,\"startDate\":\"2021-10-14T13:52:07Z\",\"endDate\":\"2021-11-22T17:01:16Z\"},\"scope\":\"llizs\",\"status\":\"Expired\",\"viewId\":\"csjvhrwef\"},\"eTag\":\"wqejpmvsse\",\"kind\":\"InsightAlert\",\"id\":\"wamcxtczhup\",\"name\":\"uknijduyye\",\"type\":\"pydjfboc\"}],\"nextLink\":\"hhulrtywikdm\"}") + "{\"value\":[{\"properties\":{\"displayName\":\"xs\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"jpsttexoq\",\"pwcyyufmhr\"],\"language\":\"cuwmqsp\",\"message\":\"dqzh\",\"regionalFormat\":\"tddunqnd\",\"subject\":\"fpch\"},\"notificationEmail\":\"bnjj\",\"schedule\":{\"frequency\":\"Daily\",\"hourOfDay\":797085028,\"daysOfWeek\":[\"Sunday\",\"Tuesday\",\"Friday\"],\"weeksOfMonth\":[\"Last\",\"Third\",\"Fourth\"],\"dayOfMonth\":1792979212,\"startDate\":\"2021-04-29T19:55:27Z\",\"endDate\":\"2021-05-27T15:04:46Z\"},\"scope\":\"lihrraiouaubr\",\"status\":\"Enabled\",\"viewId\":\"loqxfuojrngif\"},\"eTag\":\"z\",\"kind\":\"InsightAlert\",\"id\":\"cb\",\"name\":\"uimzdlyjd\",\"type\":\"qwmkyoquf\"},{\"properties\":{\"displayName\":\"ruzslzoj\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"dxotng\",\"dgug\",\"yzihgrkyuizabsn\"],\"language\":\"pphoj\",\"message\":\"vyhyhsgzfc\",\"regionalFormat\":\"gomfgbeglq\",\"subject\":\"leohibetnluankr\"},\"notificationEmail\":\"xeeebtijvacvbmqz\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":283551612,\"daysOfWeek\":[\"Thursday\"],\"weeksOfMonth\":[\"Last\"],\"dayOfMonth\":799727678,\"startDate\":\"2021-01-19T15:11:02Z\",\"endDate\":\"2021-06-22T22:40:06Z\"},\"scope\":\"ehjku\",\"status\":\"Expired\",\"viewId\":\"oafgaoql\"},\"eTag\":\"aeylinm\",\"kind\":\"InsightAlert\",\"id\":\"irpghriypoqeyh\",\"name\":\"qhykprlpyzn\",\"type\":\"ciqdsme\"},{\"properties\":{\"displayName\":\"itdfuxtyasiib\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"ustgnljhnmgixhc\",\"avmqfoudor\",\"cgyypro\"],\"language\":\"ypundmbxhugc\",\"message\":\"k\",\"regionalFormat\":\"lgorb\",\"subject\":\"ftpmdtzfjltfv\"},\"notificationEmail\":\"cyjtotpvop\",\"schedule\":{\"frequency\":\"Daily\",\"hourOfDay\":580165383,\"daysOfWeek\":[\"Saturday\"],\"weeksOfMonth\":[\"Third\",\"First\",\"First\",\"Third\"],\"dayOfMonth\":975407039,\"startDate\":\"2021-06-09T01:26:34Z\",\"endDate\":\"2021-03-24T17:03:11Z\"},\"scope\":\"thmkyib\",\"status\":\"Disabled\",\"viewId\":\"sihsgqcwdhohsd\"},\"eTag\":\"cdzsu\",\"kind\":\"InsightAlert\",\"id\":\"dxbzlmcmuap\",\"name\":\"vhdbevwqqxey\",\"type\":\"ko\"},{\"properties\":{\"displayName\":\"zinkfkbgbzbowxeq\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"vkzqk\",\"jeokbzefezrxccz\",\"rtle\",\"pqxbkwvzgnzvdf\"],\"language\":\"d\",\"message\":\"zmqpnodawopqhewj\",\"regionalFormat\":\"mcgsbostzelnd\",\"subject\":\"atutmzlbiojlvfhr\"},\"notificationEmail\":\"pn\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":1775891771,\"daysOfWeek\":[\"Monday\"],\"weeksOfMonth\":[\"Third\",\"Fourth\",\"First\"],\"dayOfMonth\":1025978620,\"startDate\":\"2021-02-26T16:19:15Z\",\"endDate\":\"2021-01-20T10:55:41Z\"},\"scope\":\"prsnmokayzejn\",\"status\":\"Enabled\",\"viewId\":\"bkpbzpcpiljh\"},\"eTag\":\"zv\",\"kind\":\"Email\",\"id\":\"dbn\",\"name\":\"ieholewjwi\",\"type\":\"ubwefqs\"}],\"nextLink\":\"paq\"}") .toObject(ScheduledActionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduledActionListResult model = new ScheduledActionListResult(); - model = BinaryData.fromObject(model).toObject(ScheduledActionListResult.class); + Assertions.assertEquals("paq", model.nextLink()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionPropertiesTests.java index c048f6d037cf..30ec53fe5335 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -22,66 +22,68 @@ public final class ScheduledActionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledActionProperties model = BinaryData.fromString( - "{\"displayName\":\"ids\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"uffgllukkutvlx\",\"rpq\",\"vmblcouqe\"],\"language\":\"hbcdsziry\",\"message\":\"ndo\",\"regionalFormat\":\"mbltoo\",\"subject\":\"mkfqlwxldy\"},\"notificationEmail\":\"lsygaol\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":1481014502,\"daysOfWeek\":[\"Monday\"],\"weeksOfMonth\":[\"First\",\"Second\",\"Last\"],\"dayOfMonth\":923883370,\"startDate\":\"2021-05-08T04:16:06Z\",\"endDate\":\"2021-06-16T22:07:38Z\"},\"scope\":\"xxahmrnadzyqegxy\",\"status\":\"Expired\",\"viewId\":\"pinbmhwbjijkgqxn\"}") + "{\"displayName\":\"szcofizeht\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"eljeamurvzmlovua\",\"ashcxlpmjerbdk\",\"lvidizozs\"],\"language\":\"ccxjm\",\"message\":\"fdgnwncypuuwwlt\",\"regionalFormat\":\"qjctzenkeif\",\"subject\":\"zhmkdasvflyh\"},\"notificationEmail\":\"cu\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":1481873943,\"daysOfWeek\":[\"Sunday\",\"Tuesday\",\"Tuesday\"],\"weeksOfMonth\":[\"Fourth\"],\"dayOfMonth\":1200485317,\"startDate\":\"2021-03-17T13:24:19Z\",\"endDate\":\"2021-04-25T07:56:10Z\"},\"scope\":\"jlvizbfhfovva\",\"status\":\"Enabled\",\"viewId\":\"pbt\"}") .toObject(ScheduledActionProperties.class); - Assertions.assertEquals("ids", model.displayName()); + Assertions.assertEquals("szcofizeht", model.displayName()); Assertions.assertEquals(FileFormat.CSV, model.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("uffgllukkutvlx", model.notification().to().get(0)); - Assertions.assertEquals("hbcdsziry", model.notification().language()); - Assertions.assertEquals("ndo", model.notification().message()); - Assertions.assertEquals("mbltoo", model.notification().regionalFormat()); - Assertions.assertEquals("mkfqlwxldy", model.notification().subject()); - Assertions.assertEquals("lsygaol", model.notificationEmail()); + Assertions.assertEquals("eljeamurvzmlovua", model.notification().to().get(0)); + Assertions.assertEquals("ccxjm", model.notification().language()); + Assertions.assertEquals("fdgnwncypuuwwlt", model.notification().message()); + Assertions.assertEquals("qjctzenkeif", model.notification().regionalFormat()); + Assertions.assertEquals("zhmkdasvflyh", model.notification().subject()); + Assertions.assertEquals("cu", model.notificationEmail()); Assertions.assertEquals(ScheduleFrequency.WEEKLY, model.schedule().frequency()); - Assertions.assertEquals(1481014502, model.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.MONDAY, model.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FIRST, model.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(923883370, model.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T04:16:06Z"), model.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T22:07:38Z"), model.schedule().endDate()); - Assertions.assertEquals("xxahmrnadzyqegxy", model.scope()); - Assertions.assertEquals(ScheduledActionStatus.EXPIRED, model.status()); - Assertions.assertEquals("pinbmhwbjijkgqxn", model.viewId()); + Assertions.assertEquals(1481873943, model.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.SUNDAY, model.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FOURTH, model.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(1200485317, model.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T13:24:19Z"), model.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T07:56:10Z"), model.schedule().endDate()); + Assertions.assertEquals("jlvizbfhfovva", model.scope()); + Assertions.assertEquals(ScheduledActionStatus.ENABLED, model.status()); + Assertions.assertEquals("pbt", model.viewId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduledActionProperties model = new ScheduledActionProperties().withDisplayName("ids") - .withFileDestination(new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV))) - .withNotification(new NotificationProperties().withTo(Arrays.asList("uffgllukkutvlx", "rpq", "vmblcouqe")) - .withLanguage("hbcdsziry") - .withMessage("ndo") - .withRegionalFormat("mbltoo") - .withSubject("mkfqlwxldy")) - .withNotificationEmail("lsygaol") + ScheduledActionProperties model = new ScheduledActionProperties().withDisplayName("szcofizeht") + .withFileDestination( + new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV, FileFormat.CSV))) + .withNotification( + new NotificationProperties().withTo(Arrays.asList("eljeamurvzmlovua", "ashcxlpmjerbdk", "lvidizozs")) + .withLanguage("ccxjm") + .withMessage("fdgnwncypuuwwlt") + .withRegionalFormat("qjctzenkeif") + .withSubject("zhmkdasvflyh")) + .withNotificationEmail("cu") .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.WEEKLY) - .withHourOfDay(1481014502) - .withDaysOfWeek(Arrays.asList(DaysOfWeek.MONDAY)) - .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.FIRST, WeeksOfMonth.SECOND, WeeksOfMonth.LAST)) - .withDayOfMonth(923883370) - .withStartDate(OffsetDateTime.parse("2021-05-08T04:16:06Z")) - .withEndDate(OffsetDateTime.parse("2021-06-16T22:07:38Z"))) - .withScope("xxahmrnadzyqegxy") - .withStatus(ScheduledActionStatus.EXPIRED) - .withViewId("pinbmhwbjijkgqxn"); + .withHourOfDay(1481873943) + .withDaysOfWeek(Arrays.asList(DaysOfWeek.SUNDAY, DaysOfWeek.TUESDAY, DaysOfWeek.TUESDAY)) + .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.FOURTH)) + .withDayOfMonth(1200485317) + .withStartDate(OffsetDateTime.parse("2021-03-17T13:24:19Z")) + .withEndDate(OffsetDateTime.parse("2021-04-25T07:56:10Z"))) + .withScope("jlvizbfhfovva") + .withStatus(ScheduledActionStatus.ENABLED) + .withViewId("pbt"); model = BinaryData.fromObject(model).toObject(ScheduledActionProperties.class); - Assertions.assertEquals("ids", model.displayName()); + Assertions.assertEquals("szcofizeht", model.displayName()); Assertions.assertEquals(FileFormat.CSV, model.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("uffgllukkutvlx", model.notification().to().get(0)); - Assertions.assertEquals("hbcdsziry", model.notification().language()); - Assertions.assertEquals("ndo", model.notification().message()); - Assertions.assertEquals("mbltoo", model.notification().regionalFormat()); - Assertions.assertEquals("mkfqlwxldy", model.notification().subject()); - Assertions.assertEquals("lsygaol", model.notificationEmail()); + Assertions.assertEquals("eljeamurvzmlovua", model.notification().to().get(0)); + Assertions.assertEquals("ccxjm", model.notification().language()); + Assertions.assertEquals("fdgnwncypuuwwlt", model.notification().message()); + Assertions.assertEquals("qjctzenkeif", model.notification().regionalFormat()); + Assertions.assertEquals("zhmkdasvflyh", model.notification().subject()); + Assertions.assertEquals("cu", model.notificationEmail()); Assertions.assertEquals(ScheduleFrequency.WEEKLY, model.schedule().frequency()); - Assertions.assertEquals(1481014502, model.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.MONDAY, model.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FIRST, model.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(923883370, model.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T04:16:06Z"), model.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T22:07:38Z"), model.schedule().endDate()); - Assertions.assertEquals("xxahmrnadzyqegxy", model.scope()); - Assertions.assertEquals(ScheduledActionStatus.EXPIRED, model.status()); - Assertions.assertEquals("pinbmhwbjijkgqxn", model.viewId()); + Assertions.assertEquals(1481873943, model.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.SUNDAY, model.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FOURTH, model.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(1200485317, model.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T13:24:19Z"), model.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T07:56:10Z"), model.schedule().endDate()); + Assertions.assertEquals("jlvizbfhfovva", model.scope()); + Assertions.assertEquals(ScheduledActionStatus.ENABLED, model.status()); + Assertions.assertEquals("pbt", model.viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionProxyResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionProxyResourceTests.java deleted file mode 100644 index 9db257959362..000000000000 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionProxyResourceTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.costmanagement.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.costmanagement.models.ScheduledActionKind; -import com.azure.resourcemanager.costmanagement.models.ScheduledActionProxyResource; -import org.junit.jupiter.api.Assertions; - -public final class ScheduledActionProxyResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduledActionProxyResource model = BinaryData.fromString( - "{\"eTag\":\"kyewnfnzhhhqo\",\"kind\":\"InsightAlert\",\"id\":\"jkutycyarnr\",\"name\":\"ohguabz\",\"type\":\"ghktdpy\"}") - .toObject(ScheduledActionProxyResource.class); - Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduledActionProxyResource model - = new ScheduledActionProxyResource().withKind(ScheduledActionKind.INSIGHT_ALERT); - model = BinaryData.fromObject(model).toObject(ScheduledActionProxyResource.class); - Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, model.kind()); - } -} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeWithResponseMockTests.java index c1a94d0e5123..4cdb77e259f8 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityReason; @@ -22,23 +22,23 @@ public final class ScheduledActionsCheckNameAvailabilityByScopeWithResponseMockTests { @Test public void testCheckNameAvailabilityByScopeWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"lynkgfcfdruw\"}"; + String responseStr = "{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"oednlwglihezomuc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityResponse response = manager.scheduledActions() - .checkNameAvailabilityByScopeWithResponse("daomb", - new CheckNameAvailabilityRequest().withName("injdllwktlepo").withType("vvqxua"), + .checkNameAvailabilityByScopeWithResponse("fogxhcxnw", + new CheckNameAvailabilityRequest().withName("pfdzxcouzfwofw").withType("ukz"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("lynkgfcfdruw", response.message()); + Assertions.assertTrue(response.nameAvailable()); + Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); + Assertions.assertEquals("oednlwglihezomuc", response.message()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityWithResponseMockTests.java index 3c509092dddc..d8484f02eed5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCheckNameAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.CheckNameAvailabilityReason; @@ -22,23 +22,23 @@ public final class ScheduledActionsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"ecaatsdohzniuc\"}"; + String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"bwgmjgrul\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityResponse response = manager.scheduledActions() .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityRequest().withName("zolgjzmicuydocc").withType("shanzbui"), + new CheckNameAvailabilityRequest().withName("ibniynts").withType("mfmeftvhkmoo"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(true, response.nameAvailable()); + Assertions.assertFalse(response.nameAvailable()); Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("ecaatsdohzniuc", response.message()); + Assertions.assertEquals("bwgmjgrul", response.message()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeWithResponseMockTests.java index bc29d121bbdf..c801ce67afb1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.DaysOfWeek; @@ -31,59 +31,62 @@ public final class ScheduledActionsCreateOrUpdateByScopeWithResponseMockTests { @Test public void testCreateOrUpdateByScopeWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"yynvskpa\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"exmj\"],\"language\":\"cbccwkqmt\",\"message\":\"p\",\"regionalFormat\":\"iscr\",\"subject\":\"ilg\"},\"notificationEmail\":\"rqre\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":1150000852,\"daysOfWeek\":[\"Monday\",\"Wednesday\",\"Saturday\"],\"weeksOfMonth\":[\"Fourth\",\"First\",\"Fourth\",\"First\"],\"dayOfMonth\":1999100319,\"startDate\":\"2021-05-28T21:51:17Z\",\"endDate\":\"2021-07-13T17:26:04Z\"},\"scope\":\"fmuad\",\"status\":\"Enabled\",\"viewId\":\"fsn\"},\"eTag\":\"kiioshj\",\"kind\":\"Email\",\"id\":\"tybnxgztlcgctj\",\"name\":\"hfjv\",\"type\":\"ywjzebecuvlbefvw\"}"; + = "{\"properties\":{\"displayName\":\"nguuzhwvla\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"a\",\"sybkekymffzt\",\"ilscv\",\"syeiih\"],\"language\":\"mkouihyeseuugci\",\"message\":\"hogsmgbvmtd\",\"regionalFormat\":\"qbe\",\"subject\":\"jnfveg\"},\"notificationEmail\":\"btvkbi\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":1890287155,\"daysOfWeek\":[\"Saturday\"],\"weeksOfMonth\":[\"First\",\"Fourth\",\"Second\"],\"dayOfMonth\":393368585,\"startDate\":\"2021-01-11T22:22:57Z\",\"endDate\":\"2021-07-31T14:31:54Z\"},\"scope\":\"aczmuh\",\"status\":\"Enabled\",\"viewId\":\"akznhokhoitwhr\"},\"eTag\":\"dmmazdnc\",\"kind\":\"Email\",\"id\":\"jpg\",\"name\":\"hzqpxzbawkikcdgf\",\"type\":\"bssdpjeyoqxd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScheduledAction response = manager.scheduledActions() - .define("xxtclhuulri") - .withExistingScope("i") - .withKind(ScheduledActionKind.EMAIL) - .withDisplayName("yokvjgbzsxebr") - .withFileDestination( - new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV, FileFormat.CSV))) - .withNotification(new NotificationProperties().withTo(Arrays.asList("djws", "oardnagttpu")) - .withLanguage("bpgnrholhujbf") - .withMessage("iplkysolsyjprxs") - .withRegionalFormat("hdmcvht") - .withSubject("bzjhfvhuwzb")) - .withNotificationEmail("cqzgihotjecohmx") - .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.WEEKLY) - .withHourOfDay(1848793230) - .withDaysOfWeek(Arrays.asList(DaysOfWeek.FRIDAY, DaysOfWeek.THURSDAY, DaysOfWeek.SATURDAY)) - .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.LAST, WeeksOfMonth.FOURTH, WeeksOfMonth.FIRST)) - .withDayOfMonth(743085313) - .withStartDate(OffsetDateTime.parse("2021-11-10T00:21:41Z")) - .withEndDate(OffsetDateTime.parse("2021-05-15T02:04:22Z"))) - .withScope("derltfokyksyim") - .withStatus(ScheduledActionStatus.DISABLED) - .withViewId("cgrvkcxzznnuifer") - .withIfMatch("qfkyfhiwvjaqu") + .define("uenxkgtlzlmt") + .withExistingScope("qgisnionetbzdrd") + .withEtag("c") + .withKind(ScheduledActionKind.INSIGHT_ALERT) + .withDisplayName("xcznnhzkb") + .withFileDestination(new FileDestination() + .withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV, FileFormat.CSV, FileFormat.CSV))) + .withNotification(new NotificationProperties().withTo(Arrays.asList("ygeqzusito", "cahfsgbjmlreesr")) + .withLanguage("sszvlcw") + .withMessage("solntfxxcrqmipf") + .withRegionalFormat("foygizmshxxba") + .withSubject("zabulnvgsk")) + .withNotificationEmail("o") + .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.MONTHLY) + .withHourOfDay(1592630526) + .withDaysOfWeek(Arrays.asList(DaysOfWeek.THURSDAY, DaysOfWeek.FRIDAY)) + .withWeeksOfMonth( + Arrays.asList(WeeksOfMonth.THIRD, WeeksOfMonth.THIRD, WeeksOfMonth.LAST, WeeksOfMonth.FOURTH)) + .withDayOfMonth(2048780189) + .withStartDate(OffsetDateTime.parse("2021-03-22T23:48:10Z")) + .withEndDate(OffsetDateTime.parse("2021-05-17T08:01:14Z"))) + .withScope("y") + .withStatus(ScheduledActionStatus.ENABLED) + .withViewId("fn") + .withIfMatch("hlpfliw") .create(); + Assertions.assertEquals("dmmazdnc", response.etag()); Assertions.assertEquals(ScheduledActionKind.EMAIL, response.kind()); - Assertions.assertEquals("yynvskpa", response.displayName()); + Assertions.assertEquals("nguuzhwvla", response.displayName()); Assertions.assertEquals(FileFormat.CSV, response.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("exmj", response.notification().to().get(0)); - Assertions.assertEquals("cbccwkqmt", response.notification().language()); - Assertions.assertEquals("p", response.notification().message()); - Assertions.assertEquals("iscr", response.notification().regionalFormat()); - Assertions.assertEquals("ilg", response.notification().subject()); - Assertions.assertEquals("rqre", response.notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.WEEKLY, response.schedule().frequency()); - Assertions.assertEquals(1150000852, response.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.MONDAY, response.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FOURTH, response.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(1999100319, response.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T21:51:17Z"), response.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T17:26:04Z"), response.schedule().endDate()); - Assertions.assertEquals("fmuad", response.scope()); + Assertions.assertEquals("a", response.notification().to().get(0)); + Assertions.assertEquals("mkouihyeseuugci", response.notification().language()); + Assertions.assertEquals("hogsmgbvmtd", response.notification().message()); + Assertions.assertEquals("qbe", response.notification().regionalFormat()); + Assertions.assertEquals("jnfveg", response.notification().subject()); + Assertions.assertEquals("btvkbi", response.notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.MONTHLY, response.schedule().frequency()); + Assertions.assertEquals(1890287155, response.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.SATURDAY, response.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FIRST, response.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(393368585, response.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T22:22:57Z"), response.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T14:31:54Z"), response.schedule().endDate()); + Assertions.assertEquals("aczmuh", response.scope()); Assertions.assertEquals(ScheduledActionStatus.ENABLED, response.status()); - Assertions.assertEquals("fsn", response.viewId()); + Assertions.assertEquals("akznhokhoitwhr", response.viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateWithResponseMockTests.java index 0754559639bf..6e72905e122c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.fluent.models.ScheduledActionInner; @@ -32,57 +32,58 @@ public final class ScheduledActionsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"its\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"m\",\"k\",\"cauwazcgwdfriwg\"],\"language\":\"jpozoksc\",\"message\":\"llixdgbyfgw\",\"regionalFormat\":\"qkjvxprwpxsoohu\",\"subject\":\"xlcskltez\"},\"notificationEmail\":\"ggg\",\"schedule\":{\"frequency\":\"Daily\",\"hourOfDay\":1713794043,\"daysOfWeek\":[\"Sunday\",\"Tuesday\"],\"weeksOfMonth\":[\"First\",\"First\",\"First\",\"Second\"],\"dayOfMonth\":1703241541,\"startDate\":\"2020-12-23T22:36:03Z\",\"endDate\":\"2021-08-21T23:31:32Z\"},\"scope\":\"erpi\",\"status\":\"Expired\",\"viewId\":\"tjzgczfcm\"},\"eTag\":\"fbodetresrgvts\",\"kind\":\"Email\",\"id\":\"t\",\"name\":\"ai\",\"type\":\"muqkevzgjypanhx\"}"; + = "{\"properties\":{\"displayName\":\"nsihqhudsm\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"akx\"],\"language\":\"nfczmnniixyxvq\",\"message\":\"nosjtgirnbgmgmd\",\"regionalFormat\":\"rgmyn\",\"subject\":\"twmp\"},\"notificationEmail\":\"mfoeajogs\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":1853377573,\"daysOfWeek\":[\"Saturday\",\"Sunday\"],\"weeksOfMonth\":[\"Third\"],\"dayOfMonth\":1515138527,\"startDate\":\"2021-05-08T10:32:23Z\",\"endDate\":\"2021-11-01T18:35:08Z\"},\"scope\":\"wbhnrecchdidrmuh\",\"status\":\"Expired\",\"viewId\":\"hmjedbiuc\"},\"eTag\":\"hhwmjpjbweunxcq\",\"kind\":\"Email\",\"id\":\"ufoihppiybxv\",\"name\":\"nzuz\",\"type\":\"bgk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScheduledAction response = manager.scheduledActions() - .createOrUpdateWithResponse("mesrfsvpi", new ScheduledActionInner().withKind(ScheduledActionKind.EMAIL) - .withDisplayName("zpatqtd") - .withFileDestination(new FileDestination() - .withFileFormats(Arrays.asList(FileFormat.CSV, FileFormat.CSV, FileFormat.CSV))) - .withNotification(new NotificationProperties().withTo(Arrays.asList("koj")) - .withLanguage("bbg") - .withMessage("ft") - .withRegionalFormat("ubz") - .withSubject("vpvdylytcovqse")) - .withNotificationEmail("rf") - .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.WEEKLY) - .withHourOfDay(1139866422) - .withDaysOfWeek(Arrays.asList(DaysOfWeek.SUNDAY, DaysOfWeek.MONDAY)) - .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.SECOND, WeeksOfMonth.SECOND, WeeksOfMonth.THIRD)) - .withDayOfMonth(2144106709) - .withStartDate(OffsetDateTime.parse("2021-03-13T07:11:16Z")) - .withEndDate(OffsetDateTime.parse("2021-04-23T22:54:28Z"))) - .withScope("jmdihdcyyyzlw") + .createOrUpdateWithResponse("oxlvocptvdxxheig", new ScheduledActionInner().withEtag("q") + .withKind(ScheduledActionKind.INSIGHT_ALERT) + .withDisplayName("ilwzghj") + .withFileDestination(new FileDestination().withFileFormats(Arrays.asList(FileFormat.CSV))) + .withNotification(new NotificationProperties().withTo(Arrays.asList("zzbwaybfmdaf", "gymqtnapreoj")) + .withLanguage("jnbscon") + .withMessage("vi") + .withRegionalFormat("eychbji") + .withSubject("qf")) + .withNotificationEmail("nwdxzedpqlrfbor") + .withSchedule(new ScheduleProperties().withFrequency(ScheduleFrequency.DAILY) + .withHourOfDay(1549024130) + .withDaysOfWeek(Arrays.asList(DaysOfWeek.WEDNESDAY)) + .withWeeksOfMonth(Arrays.asList(WeeksOfMonth.THIRD, WeeksOfMonth.FIRST)) + .withDayOfMonth(1172880706) + .withStartDate(OffsetDateTime.parse("2021-04-19T06:29:11Z")) + .withEndDate(OffsetDateTime.parse("2021-11-24T18:51:29Z"))) + .withScope("icdbkpdj") .withStatus(ScheduledActionStatus.EXPIRED) - .withViewId("wzjnufz"), "tdp", com.azure.core.util.Context.NONE) + .withViewId("qh"), "higqqbtimpkjbl", com.azure.core.util.Context.NONE) .getValue(); + Assertions.assertEquals("hhwmjpjbweunxcq", response.etag()); Assertions.assertEquals(ScheduledActionKind.EMAIL, response.kind()); - Assertions.assertEquals("its", response.displayName()); + Assertions.assertEquals("nsihqhudsm", response.displayName()); Assertions.assertEquals(FileFormat.CSV, response.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("m", response.notification().to().get(0)); - Assertions.assertEquals("jpozoksc", response.notification().language()); - Assertions.assertEquals("llixdgbyfgw", response.notification().message()); - Assertions.assertEquals("qkjvxprwpxsoohu", response.notification().regionalFormat()); - Assertions.assertEquals("xlcskltez", response.notification().subject()); - Assertions.assertEquals("ggg", response.notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.DAILY, response.schedule().frequency()); - Assertions.assertEquals(1713794043, response.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.SUNDAY, response.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FIRST, response.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(1703241541, response.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T22:36:03Z"), response.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T23:31:32Z"), response.schedule().endDate()); - Assertions.assertEquals("erpi", response.scope()); + Assertions.assertEquals("akx", response.notification().to().get(0)); + Assertions.assertEquals("nfczmnniixyxvq", response.notification().language()); + Assertions.assertEquals("nosjtgirnbgmgmd", response.notification().message()); + Assertions.assertEquals("rgmyn", response.notification().regionalFormat()); + Assertions.assertEquals("twmp", response.notification().subject()); + Assertions.assertEquals("mfoeajogs", response.notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.MONTHLY, response.schedule().frequency()); + Assertions.assertEquals(1853377573, response.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.SATURDAY, response.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.THIRD, response.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(1515138527, response.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T10:32:23Z"), response.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T18:35:08Z"), response.schedule().endDate()); + Assertions.assertEquals("wbhnrecchdidrmuh", response.scope()); Assertions.assertEquals(ScheduledActionStatus.EXPIRED, response.status()); - Assertions.assertEquals("tjzgczfcm", response.viewId()); + Assertions.assertEquals("hmjedbiuc", response.viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeWithResponseMockTests.java index bf17cba922f5..ba44b811a361 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteByScopeWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.scheduledActions() - .deleteByScopeWithResponse("aqbkixvvlwynpbbf", "vzfjm", com.azure.core.util.Context.NONE); + manager.scheduledActions().deleteByScopeWithResponse("fetwi", "y", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteWithResponseMockTests.java index 5f6374be6a60..f0ef743bf860 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.scheduledActions().deleteWithResponse("wyqejgaao", com.azure.core.util.Context.NONE); + manager.scheduledActions().deleteWithResponse("cscpiuzvkunh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeWithResponseMockTests.java index 5b42d8c323c5..0501087086c6 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.DaysOfWeek; @@ -27,37 +27,38 @@ public final class ScheduledActionsGetByScopeWithResponseMockTests { @Test public void testGetByScopeWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"oejgoiutgwrmkah\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"cihn\"],\"language\":\"gmipnmliqmvlbhik\",\"message\":\"qgrvg\",\"regionalFormat\":\"mxpu\",\"subject\":\"dtsdfjy\"},\"notificationEmail\":\"socwiqbuout\",\"schedule\":{\"frequency\":\"Daily\",\"hourOfDay\":367292457,\"daysOfWeek\":[\"Thursday\",\"Friday\"],\"weeksOfMonth\":[\"First\"],\"dayOfMonth\":829558706,\"startDate\":\"2020-12-29T14:18:24Z\",\"endDate\":\"2021-10-22T11:00:33Z\"},\"scope\":\"zvdajfwnncf\",\"status\":\"Expired\",\"viewId\":\"ciqgjjrlhiqlwixv\"},\"eTag\":\"ougu\",\"kind\":\"Email\",\"id\":\"opgjttba\",\"name\":\"ualapdl\",\"type\":\"db\"}"; + = "{\"properties\":{\"displayName\":\"kst\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"vjyhdrxbrdvc\",\"hqwhitxnmxgnmguz\"],\"language\":\"wvor\",\"message\":\"lkjnbkb\",\"regionalFormat\":\"lltqstqkqs\",\"subject\":\"gxiynecovagzk\"},\"notificationEmail\":\"ubanlxunpq\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":1420063081,\"daysOfWeek\":[\"Tuesday\",\"Monday\",\"Thursday\",\"Monday\"],\"weeksOfMonth\":[\"Fourth\",\"Last\",\"Last\"],\"dayOfMonth\":2035952580,\"startDate\":\"2021-02-25T05:31:10Z\",\"endDate\":\"2021-02-08T14:18:28Z\"},\"scope\":\"uxlrarwpe\",\"status\":\"Expired\",\"viewId\":\"audoej\"},\"eTag\":\"ghsxjpyt\",\"kind\":\"InsightAlert\",\"id\":\"alahovuuwxhm\",\"name\":\"hjnhjiot\",\"type\":\"ffbbcngkegxcypxb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScheduledAction response = manager.scheduledActions() - .getByScopeWithResponse("ctgkppgkqzkcyzmf", "ngdyfcixrhlcq", com.azure.core.util.Context.NONE) + .getByScopeWithResponse("cqx", "cbvzarmqcb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(ScheduledActionKind.EMAIL, response.kind()); - Assertions.assertEquals("oejgoiutgwrmkah", response.displayName()); + Assertions.assertEquals("ghsxjpyt", response.etag()); + Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, response.kind()); + Assertions.assertEquals("kst", response.displayName()); Assertions.assertEquals(FileFormat.CSV, response.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("cihn", response.notification().to().get(0)); - Assertions.assertEquals("gmipnmliqmvlbhik", response.notification().language()); - Assertions.assertEquals("qgrvg", response.notification().message()); - Assertions.assertEquals("mxpu", response.notification().regionalFormat()); - Assertions.assertEquals("dtsdfjy", response.notification().subject()); - Assertions.assertEquals("socwiqbuout", response.notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.DAILY, response.schedule().frequency()); - Assertions.assertEquals(367292457, response.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.THURSDAY, response.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FIRST, response.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(829558706, response.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-29T14:18:24Z"), response.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:00:33Z"), response.schedule().endDate()); - Assertions.assertEquals("zvdajfwnncf", response.scope()); + Assertions.assertEquals("vjyhdrxbrdvc", response.notification().to().get(0)); + Assertions.assertEquals("wvor", response.notification().language()); + Assertions.assertEquals("lkjnbkb", response.notification().message()); + Assertions.assertEquals("lltqstqkqs", response.notification().regionalFormat()); + Assertions.assertEquals("gxiynecovagzk", response.notification().subject()); + Assertions.assertEquals("ubanlxunpq", response.notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.WEEKLY, response.schedule().frequency()); + Assertions.assertEquals(1420063081, response.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.TUESDAY, response.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FOURTH, response.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(2035952580, response.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T05:31:10Z"), response.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T14:18:28Z"), response.schedule().endDate()); + Assertions.assertEquals("uxlrarwpe", response.scope()); Assertions.assertEquals(ScheduledActionStatus.EXPIRED, response.status()); - Assertions.assertEquals("ciqgjjrlhiqlwixv", response.viewId()); + Assertions.assertEquals("audoej", response.viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetWithResponseMockTests.java index ff6d2a1c1fd2..e72de3c34dde 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.DaysOfWeek; @@ -27,36 +27,38 @@ public final class ScheduledActionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"otnxlkfhglh\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"ecrsnh\"],\"language\":\"selqxov\",\"message\":\"qibukklvzrl\",\"regionalFormat\":\"l\",\"subject\":\"cme\"},\"notificationEmail\":\"scz\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":161928166,\"daysOfWeek\":[\"Thursday\",\"Monday\",\"Tuesday\",\"Monday\"],\"weeksOfMonth\":[\"Second\",\"Second\",\"First\"],\"dayOfMonth\":1306940764,\"startDate\":\"2021-08-04T09:33:08Z\",\"endDate\":\"2021-04-12T23:38Z\"},\"scope\":\"cplhyvdgxlyzkxi\",\"status\":\"Expired\",\"viewId\":\"shezs\"},\"eTag\":\"olrupjovm\",\"kind\":\"Email\",\"id\":\"yebrazwzlpzbtzu\",\"name\":\"kykipfsdyepfnoc\",\"type\":\"bezacfpztga\"}"; + = "{\"properties\":{\"displayName\":\"rxhaclcdosqkp\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"mainwhed\",\"kp\"],\"language\":\"wuntobuiz\",\"message\":\"zelwgvydjufbnkl\",\"regionalFormat\":\"axpegjw\",\"subject\":\"abalfdxaglz\"},\"notificationEmail\":\"tlbtlqho\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":1184698325,\"daysOfWeek\":[\"Friday\",\"Tuesday\",\"Sunday\",\"Wednesday\"],\"weeksOfMonth\":[\"Last\",\"Fourth\"],\"dayOfMonth\":1495076152,\"startDate\":\"2020-12-25T20:57:25Z\",\"endDate\":\"2021-07-20T09:39:53Z\"},\"scope\":\"xfxfmyrqsd\",\"status\":\"Enabled\",\"viewId\":\"oksz\"},\"eTag\":\"mhwgp\",\"kind\":\"InsightAlert\",\"id\":\"iuwkirkskwzts\",\"name\":\"etjygowifcqpolz\",\"type\":\"gysdgzyyb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ScheduledAction response - = manager.scheduledActions().getWithResponse("pdxxzetwwz", com.azure.core.util.Context.NONE).getValue(); + ScheduledAction response = manager.scheduledActions() + .getWithResponse("ksykpgdqxwabzrw", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals(ScheduledActionKind.EMAIL, response.kind()); - Assertions.assertEquals("otnxlkfhglh", response.displayName()); + Assertions.assertEquals("mhwgp", response.etag()); + Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, response.kind()); + Assertions.assertEquals("rxhaclcdosqkp", response.displayName()); Assertions.assertEquals(FileFormat.CSV, response.fileDestination().fileFormats().get(0)); - Assertions.assertEquals("ecrsnh", response.notification().to().get(0)); - Assertions.assertEquals("selqxov", response.notification().language()); - Assertions.assertEquals("qibukklvzrl", response.notification().message()); - Assertions.assertEquals("l", response.notification().regionalFormat()); - Assertions.assertEquals("cme", response.notification().subject()); - Assertions.assertEquals("scz", response.notificationEmail()); + Assertions.assertEquals("mainwhed", response.notification().to().get(0)); + Assertions.assertEquals("wuntobuiz", response.notification().language()); + Assertions.assertEquals("zelwgvydjufbnkl", response.notification().message()); + Assertions.assertEquals("axpegjw", response.notification().regionalFormat()); + Assertions.assertEquals("abalfdxaglz", response.notification().subject()); + Assertions.assertEquals("tlbtlqho", response.notificationEmail()); Assertions.assertEquals(ScheduleFrequency.MONTHLY, response.schedule().frequency()); - Assertions.assertEquals(161928166, response.schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.THURSDAY, response.schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.SECOND, response.schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(1306940764, response.schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T09:33:08Z"), response.schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T23:38Z"), response.schedule().endDate()); - Assertions.assertEquals("cplhyvdgxlyzkxi", response.scope()); - Assertions.assertEquals(ScheduledActionStatus.EXPIRED, response.status()); - Assertions.assertEquals("shezs", response.viewId()); + Assertions.assertEquals(1184698325, response.schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.FRIDAY, response.schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.LAST, response.schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(1495076152, response.schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-25T20:57:25Z"), response.schedule().startDate()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T09:39:53Z"), response.schedule().endDate()); + Assertions.assertEquals("xfxfmyrqsd", response.scope()); + Assertions.assertEquals(ScheduledActionStatus.ENABLED, response.status()); + Assertions.assertEquals("oksz", response.viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeMockTests.java index 1eb644688b9a..78217b2e5ceb 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListByScopeMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.DaysOfWeek; @@ -28,38 +28,39 @@ public final class ScheduledActionsListByScopeMockTests { @Test public void testListByScope() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"xivcbkutpumlt\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"ynbpvzlqywauy\",\"njc\",\"hmocgjshg\"],\"language\":\"a\",\"message\":\"wvixq\",\"regionalFormat\":\"gljkybsj\",\"subject\":\"clrvtzqnrbctbh\"},\"notificationEmail\":\"hxpcvrdnyeita\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":297181437,\"daysOfWeek\":[\"Tuesday\"],\"weeksOfMonth\":[\"Fourth\",\"Third\",\"Third\",\"First\"],\"dayOfMonth\":41519341,\"startDate\":\"2021-02-25T15:02:36Z\",\"endDate\":\"2021-03-27T13:49:42Z\"},\"scope\":\"cz\",\"status\":\"Expired\",\"viewId\":\"iceevsaaxwspca\"},\"eTag\":\"khfjqebglcxkx\",\"kind\":\"InsightAlert\",\"id\":\"omv\",\"name\":\"g\",\"type\":\"sem\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"nkiuajewnah\",\"fileDestination\":{\"fileFormats\":[\"Csv\",\"Csv\",\"Csv\",\"Csv\"]},\"notification\":{\"to\":[\"lmsoodtmve\",\"dhdyswcrptveaj\"],\"language\":\"xvl\",\"message\":\"rgkrfi\",\"regionalFormat\":\"pywlptyuqhrl\",\"subject\":\"cs\"},\"notificationEmail\":\"kpfuofix\",\"schedule\":{\"frequency\":\"Monthly\",\"hourOfDay\":406688234,\"daysOfWeek\":[\"Monday\",\"Wednesday\",\"Wednesday\"],\"weeksOfMonth\":[\"First\",\"Fourth\"],\"dayOfMonth\":1800967897,\"startDate\":\"2021-07-01T14:35:54Z\",\"endDate\":\"2021-02-16T23:20:50Z\"},\"scope\":\"prdpwrpc\",\"status\":\"Enabled\",\"viewId\":\"cfj\"},\"eTag\":\"zlgzawkgyepey\",\"kind\":\"InsightAlert\",\"id\":\"idmdiawpzxkzrntm\",\"name\":\"ctdhuosgwq\",\"type\":\"sq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.scheduledActions().listByScope("wilzzhnijmriprlk", "neyttl", com.azure.core.util.Context.NONE); + = manager.scheduledActions().listByScope("zox", "dxqlfrolq", com.azure.core.util.Context.NONE); + Assertions.assertEquals("zlgzawkgyepey", response.iterator().next().etag()); Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, response.iterator().next().kind()); - Assertions.assertEquals("xivcbkutpumlt", response.iterator().next().displayName()); + Assertions.assertEquals("nkiuajewnah", response.iterator().next().displayName()); Assertions.assertEquals(FileFormat.CSV, response.iterator().next().fileDestination().fileFormats().get(0)); - Assertions.assertEquals("ynbpvzlqywauy", response.iterator().next().notification().to().get(0)); - Assertions.assertEquals("a", response.iterator().next().notification().language()); - Assertions.assertEquals("wvixq", response.iterator().next().notification().message()); - Assertions.assertEquals("gljkybsj", response.iterator().next().notification().regionalFormat()); - Assertions.assertEquals("clrvtzqnrbctbh", response.iterator().next().notification().subject()); - Assertions.assertEquals("hxpcvrdnyeita", response.iterator().next().notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.WEEKLY, response.iterator().next().schedule().frequency()); - Assertions.assertEquals(297181437, response.iterator().next().schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.TUESDAY, response.iterator().next().schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FOURTH, response.iterator().next().schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(41519341, response.iterator().next().schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T15:02:36Z"), + Assertions.assertEquals("lmsoodtmve", response.iterator().next().notification().to().get(0)); + Assertions.assertEquals("xvl", response.iterator().next().notification().language()); + Assertions.assertEquals("rgkrfi", response.iterator().next().notification().message()); + Assertions.assertEquals("pywlptyuqhrl", response.iterator().next().notification().regionalFormat()); + Assertions.assertEquals("cs", response.iterator().next().notification().subject()); + Assertions.assertEquals("kpfuofix", response.iterator().next().notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.MONTHLY, response.iterator().next().schedule().frequency()); + Assertions.assertEquals(406688234, response.iterator().next().schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.MONDAY, response.iterator().next().schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.FIRST, response.iterator().next().schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(1800967897, response.iterator().next().schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T14:35:54Z"), response.iterator().next().schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T13:49:42Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T23:20:50Z"), response.iterator().next().schedule().endDate()); - Assertions.assertEquals("cz", response.iterator().next().scope()); - Assertions.assertEquals(ScheduledActionStatus.EXPIRED, response.iterator().next().status()); - Assertions.assertEquals("iceevsaaxwspca", response.iterator().next().viewId()); + Assertions.assertEquals("prdpwrpc", response.iterator().next().scope()); + Assertions.assertEquals(ScheduledActionStatus.ENABLED, response.iterator().next().status()); + Assertions.assertEquals("cfj", response.iterator().next().viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListMockTests.java index c19c43cee591..2a616a6d6a23 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.DaysOfWeek; @@ -28,38 +28,39 @@ public final class ScheduledActionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"haqidoyzltgiomqo\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"eapfse\",\"gdtpe\",\"nacyheqwb\"],\"language\":\"qncjubkhjozfymcw\",\"message\":\"upyvqyvliq\",\"regionalFormat\":\"psejbsvsiaies\",\"subject\":\"hddzydisnuepy\"},\"notificationEmail\":\"jlnldpxottdiiaoc\",\"schedule\":{\"frequency\":\"Daily\",\"hourOfDay\":1061804775,\"daysOfWeek\":[\"Friday\",\"Saturday\"],\"weeksOfMonth\":[\"First\",\"Second\",\"Second\",\"Last\"],\"dayOfMonth\":401443519,\"startDate\":\"2021-07-30T12:34:28Z\",\"endDate\":\"2021-09-13T12:54:11Z\"},\"scope\":\"wqwoqsratjhdhzyb\",\"status\":\"Expired\",\"viewId\":\"ijh\"},\"eTag\":\"zgdkkagvwu\",\"kind\":\"InsightAlert\",\"id\":\"s\",\"name\":\"mo\",\"type\":\"fmz\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"uktirzkaugpu\",\"fileDestination\":{\"fileFormats\":[\"Csv\"]},\"notification\":{\"to\":[\"plw\",\"o\"],\"language\":\"hxw\",\"message\":\"lvzkl\",\"regionalFormat\":\"bgikyjtkakvlbi\",\"subject\":\"hjvpzaptu\"},\"notificationEmail\":\"kaoizjixw\",\"schedule\":{\"frequency\":\"Weekly\",\"hourOfDay\":216879472,\"daysOfWeek\":[\"Tuesday\"],\"weeksOfMonth\":[\"Second\"],\"dayOfMonth\":793970860,\"startDate\":\"2021-12-05T15:28:03Z\",\"endDate\":\"2021-04-02T08:31:22Z\"},\"scope\":\"qynvavitmdm\",\"status\":\"Disabled\",\"viewId\":\"ohhihraxqud\"},\"eTag\":\"wjc\",\"kind\":\"InsightAlert\",\"id\":\"hlhpvzadb\",\"name\":\"enninafhxrzfrm\",\"type\":\"ztiucwviql\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.scheduledActions().list("dnw", com.azure.core.util.Context.NONE); + = manager.scheduledActions().list("i", com.azure.core.util.Context.NONE); + Assertions.assertEquals("wjc", response.iterator().next().etag()); Assertions.assertEquals(ScheduledActionKind.INSIGHT_ALERT, response.iterator().next().kind()); - Assertions.assertEquals("haqidoyzltgiomqo", response.iterator().next().displayName()); + Assertions.assertEquals("uktirzkaugpu", response.iterator().next().displayName()); Assertions.assertEquals(FileFormat.CSV, response.iterator().next().fileDestination().fileFormats().get(0)); - Assertions.assertEquals("eapfse", response.iterator().next().notification().to().get(0)); - Assertions.assertEquals("qncjubkhjozfymcw", response.iterator().next().notification().language()); - Assertions.assertEquals("upyvqyvliq", response.iterator().next().notification().message()); - Assertions.assertEquals("psejbsvsiaies", response.iterator().next().notification().regionalFormat()); - Assertions.assertEquals("hddzydisnuepy", response.iterator().next().notification().subject()); - Assertions.assertEquals("jlnldpxottdiiaoc", response.iterator().next().notificationEmail()); - Assertions.assertEquals(ScheduleFrequency.DAILY, response.iterator().next().schedule().frequency()); - Assertions.assertEquals(1061804775, response.iterator().next().schedule().hourOfDay()); - Assertions.assertEquals(DaysOfWeek.FRIDAY, response.iterator().next().schedule().daysOfWeek().get(0)); - Assertions.assertEquals(WeeksOfMonth.FIRST, response.iterator().next().schedule().weeksOfMonth().get(0)); - Assertions.assertEquals(401443519, response.iterator().next().schedule().dayOfMonth()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T12:34:28Z"), + Assertions.assertEquals("plw", response.iterator().next().notification().to().get(0)); + Assertions.assertEquals("hxw", response.iterator().next().notification().language()); + Assertions.assertEquals("lvzkl", response.iterator().next().notification().message()); + Assertions.assertEquals("bgikyjtkakvlbi", response.iterator().next().notification().regionalFormat()); + Assertions.assertEquals("hjvpzaptu", response.iterator().next().notification().subject()); + Assertions.assertEquals("kaoizjixw", response.iterator().next().notificationEmail()); + Assertions.assertEquals(ScheduleFrequency.WEEKLY, response.iterator().next().schedule().frequency()); + Assertions.assertEquals(216879472, response.iterator().next().schedule().hourOfDay()); + Assertions.assertEquals(DaysOfWeek.TUESDAY, response.iterator().next().schedule().daysOfWeek().get(0)); + Assertions.assertEquals(WeeksOfMonth.SECOND, response.iterator().next().schedule().weeksOfMonth().get(0)); + Assertions.assertEquals(793970860, response.iterator().next().schedule().dayOfMonth()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-05T15:28:03Z"), response.iterator().next().schedule().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T12:54:11Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T08:31:22Z"), response.iterator().next().schedule().endDate()); - Assertions.assertEquals("wqwoqsratjhdhzyb", response.iterator().next().scope()); - Assertions.assertEquals(ScheduledActionStatus.EXPIRED, response.iterator().next().status()); - Assertions.assertEquals("ijh", response.iterator().next().viewId()); + Assertions.assertEquals("qynvavitmdm", response.iterator().next().scope()); + Assertions.assertEquals(ScheduledActionStatus.DISABLED, response.iterator().next().status()); + Assertions.assertEquals("ohhihraxqud", response.iterator().next().viewId()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeWithResponseMockTests.java index 49fc32ad2bc4..ce0d8c8810f1 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testRunByScopeWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.scheduledActions().runByScopeWithResponse("zfe", "zjljmphfk", com.azure.core.util.Context.NONE); + manager.scheduledActions().runByScopeWithResponse("zihqod", "qgcnbhcbmjk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunWithResponseMockTests.java index 5dbd8e5b4872..dd554d3a9fd0 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ScheduledActionsRunWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testRunWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.scheduledActions().runWithResponse("pu", com.azure.core.util.Context.NONE); + manager.scheduledActions().runWithResponse("ukhk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingInnerTests.java new file mode 100644 index 000000000000..dd9ff4b09094 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; + +public final class SettingInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SettingInner model = BinaryData + .fromString("{\"kind\":\"Setting\",\"id\":\"dabtqwp\",\"name\":\"yawbzasqbu\",\"type\":\"ljgkyex\"}") + .toObject(SettingInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SettingInner model = new SettingInner(); + model = BinaryData.fromObject(model).toObject(SettingInner.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsCreateOrUpdateByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsCreateOrUpdateByScopeWithResponseMockTests.java new file mode 100644 index 000000000000..20c652aac76b --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsCreateOrUpdateByScopeWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingInner; +import com.azure.resourcemanager.costmanagement.models.Setting; +import com.azure.resourcemanager.costmanagement.models.SettingType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SettingsCreateOrUpdateByScopeWithResponseMockTests { + @Test + public void testCreateOrUpdateByScopeWithResponse() throws Exception { + String responseStr = "{\"kind\":\"Setting\",\"id\":\"apj\",\"name\":\"jodmkrrwep\",\"type\":\"qvqokql\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Setting response = manager.settings() + .createOrUpdateByScopeWithResponse("xiqqzjkoxdupna", SettingType.TAGINHERITANCE, new SettingInner(), + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsDeleteByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsDeleteByScopeWithResponseMockTests.java new file mode 100644 index 000000000000..d591980e2122 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsDeleteByScopeWithResponseMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.SettingType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SettingsDeleteByScopeWithResponseMockTests { + @Test + public void testDeleteByScopeWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.settings() + .deleteByScopeWithResponse("jqgir", SettingType.TAGINHERITANCE, com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsGetByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsGetByScopeWithResponseMockTests.java new file mode 100644 index 000000000000..783d4d3b534e --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsGetByScopeWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.Setting; +import com.azure.resourcemanager.costmanagement.models.SettingType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SettingsGetByScopeWithResponseMockTests { + @Test + public void testGetByScopeWithResponse() throws Exception { + String responseStr = "{\"kind\":\"Setting\",\"id\":\"shzz\",\"name\":\"g\",\"type\":\"ll\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Setting response = manager.settings() + .getByScopeWithResponse("decfiwhagxsure", SettingType.TAGINHERITANCE, com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsListResultInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsListResultInnerTests.java new file mode 100644 index 000000000000..b621bd206060 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsListResultInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.fluent.models.SettingsListResultInner; + +public final class SettingsListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SettingsListResultInner model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"Setting\",\"id\":\"qdqx\",\"name\":\"bjwgnyfus\",\"type\":\"zsvtuikzhajqgl\"},{\"kind\":\"Setting\",\"id\":\"hm\",\"name\":\"rqryxynqn\",\"type\":\"rd\"},{\"kind\":\"Setting\",\"id\":\"ovw\",\"name\":\"zn\",\"type\":\"tgoe\"}]}") + .toObject(SettingsListResultInner.class); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsListWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsListWithResponseMockTests.java new file mode 100644 index 000000000000..307a59ecdb23 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SettingsListWithResponseMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.costmanagement.CostManagementManager; +import com.azure.resourcemanager.costmanagement.models.SettingsListResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SettingsListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"Setting\",\"id\":\"pqvctsfaeuhwwsk\",\"name\":\"stvzuzhasupml\",\"type\":\"pdpg\"},{\"kind\":\"Setting\",\"id\":\"zqazvb\",\"name\":\"arkptgongruatsyi\",\"type\":\"sjqhenigbeqngu\"},{\"kind\":\"Setting\",\"id\":\"byjdeayscse\",\"name\":\"d\",\"type\":\"jemexmnv\"},{\"kind\":\"Setting\",\"id\":\"muwrx\",\"name\":\"n\",\"type\":\"wmcpmrrdlhvdvm\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CostManagementManager manager = CostManagementManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SettingsListResult response + = manager.settings().listWithResponse("wly", com.azure.core.util.Context.NONE).getValue(); + + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SourceCostAllocationResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SourceCostAllocationResourceTests.java new file mode 100644 index 000000000000..5123f6a2515d --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SourceCostAllocationResourceTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.SourceCostAllocationResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SourceCostAllocationResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SourceCostAllocationResource model = BinaryData + .fromString("{\"values\":[\"pakdkifmjnnawt\"],\"resourceType\":\"Dimension\",\"name\":\"bpxuckpggqoweyi\"}") + .toObject(SourceCostAllocationResource.class); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, model.resourceType()); + Assertions.assertEquals("bpxuckpggqoweyi", model.name()); + Assertions.assertEquals("pakdkifmjnnawt", model.values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SourceCostAllocationResource model + = new SourceCostAllocationResource().withResourceType(CostAllocationResourceType.DIMENSION) + .withName("bpxuckpggqoweyi") + .withValues(Arrays.asList("pakdkifmjnnawt")); + model = BinaryData.fromObject(model).toObject(SourceCostAllocationResource.class); + Assertions.assertEquals(CostAllocationResourceType.DIMENSION, model.resourceType()); + Assertions.assertEquals("bpxuckpggqoweyi", model.name()); + Assertions.assertEquals("pakdkifmjnnawt", model.values().get(0)); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/StatusTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/StatusTests.java index 301f452acdb1..1960cdedd8f5 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/StatusTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/StatusTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -12,14 +12,7 @@ public final class StatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Status model = BinaryData.fromString("{\"status\":\"NoDataFound\"}").toObject(Status.class); - Assertions.assertEquals(ReportOperationStatusType.NO_DATA_FOUND, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Status model = new Status().withStatus(ReportOperationStatusType.NO_DATA_FOUND); - model = BinaryData.fromObject(model).toObject(Status.class); - Assertions.assertEquals(ReportOperationStatusType.NO_DATA_FOUND, model.status()); + Status model = BinaryData.fromString("{\"status\":\"InProgress\"}").toObject(Status.class); + Assertions.assertEquals(ReportOperationStatusType.IN_PROGRESS, model.status()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SystemAssignedServiceIdentityTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SystemAssignedServiceIdentityTests.java new file mode 100644 index 000000000000..5dd763531127 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/SystemAssignedServiceIdentityTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentity; +import com.azure.resourcemanager.costmanagement.models.SystemAssignedServiceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class SystemAssignedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SystemAssignedServiceIdentity model + = BinaryData.fromString("{\"principalId\":\"xbzpfzab\",\"tenantId\":\"cuh\",\"type\":\"None\"}") + .toObject(SystemAssignedServiceIdentity.class); + Assertions.assertEquals(SystemAssignedServiceIdentityType.NONE, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SystemAssignedServiceIdentity model + = new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.NONE); + model = BinaryData.fromObject(model).toObject(SystemAssignedServiceIdentity.class); + Assertions.assertEquals(SystemAssignedServiceIdentityType.NONE, model.type()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TagInheritancePropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TagInheritancePropertiesTests.java new file mode 100644 index 000000000000..9a842f12f662 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TagInheritancePropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceProperties; +import org.junit.jupiter.api.Assertions; + +public final class TagInheritancePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TagInheritanceProperties model + = BinaryData.fromString("{\"preferContainerTags\":false}").toObject(TagInheritanceProperties.class); + Assertions.assertFalse(model.preferContainerTags()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TagInheritanceProperties model = new TagInheritanceProperties().withPreferContainerTags(false); + model = BinaryData.fromObject(model).toObject(TagInheritanceProperties.class); + Assertions.assertFalse(model.preferContainerTags()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TagInheritanceSettingTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TagInheritanceSettingTests.java new file mode 100644 index 000000000000..af8797fe1268 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TagInheritanceSettingTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceProperties; +import com.azure.resourcemanager.costmanagement.models.TagInheritanceSetting; +import org.junit.jupiter.api.Assertions; + +public final class TagInheritanceSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TagInheritanceSetting model = BinaryData.fromString( + "{\"kind\":\"taginheritance\",\"properties\":{\"preferContainerTags\":false},\"id\":\"yaipidsda\",\"name\":\"ltxijjumfqwazln\",\"type\":\"nm\"}") + .toObject(TagInheritanceSetting.class); + Assertions.assertFalse(model.properties().preferContainerTags()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TagInheritanceSetting model + = new TagInheritanceSetting().withProperties(new TagInheritanceProperties().withPreferContainerTags(false)); + model = BinaryData.fromObject(model).toObject(TagInheritanceSetting.class); + Assertions.assertFalse(model.properties().preferContainerTags()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TargetCostAllocationResourceTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TargetCostAllocationResourceTests.java new file mode 100644 index 000000000000..d018f28348f7 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/TargetCostAllocationResourceTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.costmanagement.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.costmanagement.models.CostAllocationPolicyType; +import com.azure.resourcemanager.costmanagement.models.CostAllocationProportion; +import com.azure.resourcemanager.costmanagement.models.CostAllocationResourceType; +import com.azure.resourcemanager.costmanagement.models.TargetCostAllocationResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TargetCostAllocationResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TargetCostAllocationResource model = BinaryData.fromString( + "{\"values\":[{\"name\":\"qqmpizruwnpqx\",\"percentage\":16.700915276575113},{\"name\":\"wfcngjsaas\",\"percentage\":97.4362682320823}],\"policyType\":\"FixedProportion\",\"resourceType\":\"Tag\",\"name\":\"kzjv\"}") + .toObject(TargetCostAllocationResource.class); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.resourceType()); + Assertions.assertEquals("kzjv", model.name()); + Assertions.assertEquals("qqmpizruwnpqx", model.values().get(0).name()); + Assertions.assertEquals(16.700915276575113, model.values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, model.policyType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TargetCostAllocationResource model + = new TargetCostAllocationResource().withResourceType(CostAllocationResourceType.TAG) + .withName("kzjv") + .withValues(Arrays.asList( + new CostAllocationProportion().withName("qqmpizruwnpqx").withPercentage(16.700915276575113), + new CostAllocationProportion().withName("wfcngjsaas").withPercentage(97.4362682320823))) + .withPolicyType(CostAllocationPolicyType.FIXED_PROPORTION); + model = BinaryData.fromObject(model).toObject(TargetCostAllocationResource.class); + Assertions.assertEquals(CostAllocationResourceType.TAG, model.resourceType()); + Assertions.assertEquals("kzjv", model.name()); + Assertions.assertEquals("qqmpizruwnpqx", model.values().get(0).name()); + Assertions.assertEquals(16.700915276575113, model.values().get(0).percentage()); + Assertions.assertEquals(CostAllocationPolicyType.FIXED_PROPORTION, model.policyType()); + } +} diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewInnerTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewInnerTests.java index 754cbd7c51d0..b32fd2d2c77d 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewInnerTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -38,118 +38,122 @@ public final class ViewInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ViewInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"sdkf\",\"scope\":\"wxmnteiwao\",\"createdOn\":\"2021-05-06T07:03:15Z\",\"modifiedOn\":\"2021-09-03T21:23:34Z\",\"dateRange\":\"c\",\"currency\":\"xdcu\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2021-06-10T12:05:31Z\",\"to\":\"2021-09-11T09:48:37Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"ezcxtbzsgfyccsne\",\"mdwzjeiachboo\"]},\"aggregation\":{\"zzvypyqrimzinp\":{\"name\":\"nrosfqpte\",\"function\":\"Sum\"},\"qxhcrmn\":{\"name\":\"swjdkirso\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"ckwhds\"},{\"type\":\"Dimension\",\"name\":\"fiyipjxsqwpgrj\"},{\"type\":\"TagKey\",\"name\":\"norcjxvsnbyxqab\"}],\"sorting\":[{\"direction\":\"Ascending\",\"name\":\"cyshurzafbljjgp\"},{\"direction\":\"Ascending\",\"name\":\"qcjm\"}],\"filter\":{\"and\":[{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"idtqajzyu\",\"operator\":\"In\",\"values\":[\"u\",\"jkrlkhbzhfepg\",\"gqexzlocxs\"]},\"tags\":{\"name\":\"aierhhb\",\"operator\":\"In\",\"values\":[\"l\"]}}},\"includeMonetaryCommitment\":false},\"chart\":\"GroupedColumn\",\"accumulated\":\"true\",\"metric\":\"AHUB\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"bdxkqpxokaj\",\"enabled\":false},{\"type\":\"Budget\",\"id\":\"ex\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"po\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"r\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"ovmclwhijcoejct\"},{\"type\":\"TagKey\",\"name\":\"s\"},{\"type\":\"Dimension\",\"name\":\"bkbfkgukdkex\"},{\"type\":\"Dimension\",\"name\":\"fmxa\"}]},\"eTag\":\"fjpgddtocjjxhvp\",\"id\":\"o\",\"name\":\"exhd\",\"type\":\"xibqeojnx\"}") + "{\"properties\":{\"displayName\":\"pskrdqmh\",\"scope\":\"dhtldwkyz\",\"createdOn\":\"2021-08-29T07:48:34Z\",\"modifiedOn\":\"2021-02-19T07:46:09Z\",\"dateRange\":\"cwscwsvlx\",\"currency\":\"ogtwrupqsxvnmi\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2020-12-28T17:16:14Z\",\"to\":\"2021-02-25T06:56:38Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"notyfjfcnjbkcn\",\"dhbt\",\"kphywpnvjto\"]},\"aggregation\":{\"rpabg\":{\"name\":\"rmclfplphoxu\",\"function\":\"Sum\"},\"ywpmueefjzwfqkq\":{\"name\":\"epsbjtazqu\",\"function\":\"Sum\"},\"tcc\":{\"name\":\"jidsuyonobglaoc\",\"function\":\"Sum\"},\"dxyt\":{\"name\":\"g\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"rxv\"},{\"type\":\"TagKey\",\"name\":\"u\"},{\"type\":\"Dimension\",\"name\":\"pz\"},{\"type\":\"TagKey\",\"name\":\"xhdzhlrqjbhckf\"}],\"sorting\":[{\"direction\":\"Descending\",\"name\":\"sbkyvpycanuzbp\"},{\"direction\":\"Ascending\",\"name\":\"fkuwbcrnwbmehhse\"}],\"filter\":{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"slhs\",\"operator\":\"Contains\",\"values\":[\"eemaofmxagkvtme\",\"mqkrhahvljuahaqu\"]},\"tags\":{\"name\":\"dhmdua\",\"operator\":\"In\",\"values\":[\"xqpvfadmw\"]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Area\",\"accumulated\":\"true\",\"metric\":\"AHUB\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"fmisg\",\"enabled\":false},{\"type\":\"Budget\",\"id\":\"ldawkzbaliourqha\",\"enabled\":true}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"fwxosowzxcu\"},{\"type\":\"TagKey\",\"name\":\"ooxdjebwpuc\"},{\"type\":\"TagKey\",\"name\":\"ovbvmeueciv\"}]},\"eTag\":\"zceuojgjrw\",\"id\":\"eiotwmcdytdx\",\"name\":\"it\",\"type\":\"nrjawgqwg\"}") .toObject(ViewInner.class); - Assertions.assertEquals("fjpgddtocjjxhvp", model.etag()); - Assertions.assertEquals("sdkf", model.displayName()); - Assertions.assertEquals("wxmnteiwao", model.scope()); - Assertions.assertEquals("c", model.dateRange()); - Assertions.assertEquals(ChartType.GROUPED_COLUMN, model.chart()); + Assertions.assertEquals("zceuojgjrw", model.etag()); + Assertions.assertEquals("pskrdqmh", model.displayName()); + Assertions.assertEquals("dhtldwkyz", model.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-19T07:46:09Z"), model.modifiedOn()); + Assertions.assertEquals("cwscwsvlx", model.dateRange()); + Assertions.assertEquals(ChartType.AREA, model.chart()); Assertions.assertEquals(AccumulatedType.TRUE, model.accumulated()); Assertions.assertEquals(MetricType.AHUB, model.metric()); Assertions.assertEquals(KpiType.BUDGET, model.kpis().get(0).type()); - Assertions.assertEquals("bdxkqpxokaj", model.kpis().get(0).id()); - Assertions.assertEquals(false, model.kpis().get(0).enabled()); + Assertions.assertEquals("fmisg", model.kpis().get(0).id()); + Assertions.assertFalse(model.kpis().get(0).enabled()); Assertions.assertEquals(PivotType.TAG_KEY, model.pivots().get(0).type()); - Assertions.assertEquals("ovmclwhijcoejct", model.pivots().get(0).name()); + Assertions.assertEquals("fwxosowzxcu", model.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, model.typePropertiesType()); Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T12:05:31Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T09:48:37Z"), model.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, model.dataSet().granularity()); - Assertions.assertEquals("ezcxtbzsgfyccsne", model.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("nrosfqpte", model.dataSet().aggregation().get("zzvypyqrimzinp").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("zzvypyqrimzinp").function()); - Assertions.assertEquals(QueryColumnType.TAG_KEY, model.dataSet().grouping().get(0).type()); - Assertions.assertEquals("ckwhds", model.dataSet().grouping().get(0).name()); - Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.dataSet().sorting().get(0).direction()); - Assertions.assertEquals("cyshurzafbljjgp", model.dataSet().sorting().get(0).name()); - Assertions.assertEquals("idtqajzyu", model.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("u", model.dataSet().filter().dimensions().values().get(0)); - Assertions.assertEquals("aierhhb", model.dataSet().filter().tags().name()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T17:16:14Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T06:56:38Z"), model.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.DAILY, model.dataSet().granularity()); + Assertions.assertEquals("notyfjfcnjbkcn", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("rmclfplphoxu", model.dataSet().aggregation().get("rpabg").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("rpabg").function()); + Assertions.assertEquals(QueryColumnType.DIMENSION, model.dataSet().grouping().get(0).type()); + Assertions.assertEquals("rxv", model.dataSet().grouping().get(0).name()); + Assertions.assertEquals(ReportConfigSortingType.DESCENDING, model.dataSet().sorting().get(0).direction()); + Assertions.assertEquals("sbkyvpycanuzbp", model.dataSet().sorting().get(0).name()); + Assertions.assertEquals("slhs", model.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("eemaofmxagkvtme", model.dataSet().filter().dimensions().values().get(0)); + Assertions.assertEquals("dhmdua", model.dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().tags().operator()); - Assertions.assertEquals("l", model.dataSet().filter().tags().values().get(0)); - Assertions.assertEquals(false, model.includeMonetaryCommitment()); + Assertions.assertEquals("xqpvfadmw", model.dataSet().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeMonetaryCommitment()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ViewInner model = new ViewInner().withEtag("fjpgddtocjjxhvp") - .withDisplayName("sdkf") - .withScope("wxmnteiwao") - .withDateRange("c") - .withChart(ChartType.GROUPED_COLUMN) + ViewInner model = new ViewInner().withEtag("zceuojgjrw") + .withDisplayName("pskrdqmh") + .withScope("dhtldwkyz") + .withModifiedOn(OffsetDateTime.parse("2021-02-19T07:46:09Z")) + .withDateRange("cwscwsvlx") + .withChart(ChartType.AREA) .withAccumulated(AccumulatedType.TRUE) .withMetric(MetricType.AHUB) - .withKpis( - Arrays.asList(new KpiProperties().withType(KpiType.BUDGET).withId("bdxkqpxokaj").withEnabled(false), - new KpiProperties().withType(KpiType.BUDGET).withId("ex").withEnabled(true), - new KpiProperties().withType(KpiType.FORECAST).withId("po").withEnabled(true), - new KpiProperties().withType(KpiType.BUDGET).withId("r").withEnabled(false))) - .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.TAG_KEY).withName("ovmclwhijcoejct"), - new PivotProperties().withType(PivotType.TAG_KEY).withName("s"), - new PivotProperties().withType(PivotType.DIMENSION).withName("bkbfkgukdkex"), - new PivotProperties().withType(PivotType.DIMENSION).withName("fmxa"))) + .withKpis(Arrays.asList(new KpiProperties().withType(KpiType.BUDGET).withId("fmisg").withEnabled(false), + new KpiProperties().withType(KpiType.BUDGET).withId("ldawkzbaliourqha").withEnabled(true))) + .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.TAG_KEY).withName("fwxosowzxcu"), + new PivotProperties().withType(PivotType.TAG_KEY).withName("ooxdjebwpuc"), + new PivotProperties().withType(PivotType.TAG_KEY).withName("ovbvmeueciv"))) .withTypePropertiesType(ReportType.USAGE) .withTimeframe(ReportTimeframeType.WEEK_TO_DATE) - .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-06-10T12:05:31Z")) - .withTo(OffsetDateTime.parse("2021-09-11T09:48:37Z"))) - .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.MONTHLY) + .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2020-12-28T17:16:14Z")) + .withTo(OffsetDateTime.parse("2021-02-25T06:56:38Z"))) + .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) .withConfiguration(new ReportConfigDatasetConfiguration() - .withColumns(Arrays.asList("ezcxtbzsgfyccsne", "mdwzjeiachboo"))) - .withAggregation(mapOf("zzvypyqrimzinp", - new ReportConfigAggregation().withName("nrosfqpte").withFunction(FunctionType.SUM), "qxhcrmn", - new ReportConfigAggregation().withName("swjdkirso").withFunction(FunctionType.SUM))) + .withColumns(Arrays.asList("notyfjfcnjbkcn", "dhbt", "kphywpnvjto"))) + .withAggregation(mapOf("rpabg", + new ReportConfigAggregation().withName("rmclfplphoxu").withFunction(FunctionType.SUM), + "ywpmueefjzwfqkq", + new ReportConfigAggregation().withName("epsbjtazqu").withFunction(FunctionType.SUM), "tcc", + new ReportConfigAggregation().withName("jidsuyonobglaoc").withFunction(FunctionType.SUM), "dxyt", + new ReportConfigAggregation().withName("g").withFunction(FunctionType.SUM))) .withGrouping( - Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("ckwhds"), - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("fiyipjxsqwpgrj"), - new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("norcjxvsnbyxqab"))) + Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("rxv"), + new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("u"), + new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("pz"), + new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("xhdzhlrqjbhckf"))) .withSorting(Arrays.asList( + new ReportConfigSorting().withDirection(ReportConfigSortingType.DESCENDING) + .withName("sbkyvpycanuzbp"), new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING) - .withName("cyshurzafbljjgp"), - new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("qcjm"))) + .withName("fkuwbcrnwbmehhse"))) .withFilter(new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("idtqajzyu") + .withOr(Arrays.asList(new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("slhs") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("eemaofmxagkvtme", "mqkrhahvljuahaqu"))) + .withTags(new ReportConfigComparisonExpression().withName("dhmdua") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("u", "jkrlkhbzhfepg", "gqexzlocxs"))) - .withTags(new ReportConfigComparisonExpression().withName("aierhhb") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList("l"))))) - .withIncludeMonetaryCommitment(false); + .withValues(Arrays.asList("xqpvfadmw"))))) + .withIncludeMonetaryCommitment(true); model = BinaryData.fromObject(model).toObject(ViewInner.class); - Assertions.assertEquals("fjpgddtocjjxhvp", model.etag()); - Assertions.assertEquals("sdkf", model.displayName()); - Assertions.assertEquals("wxmnteiwao", model.scope()); - Assertions.assertEquals("c", model.dateRange()); - Assertions.assertEquals(ChartType.GROUPED_COLUMN, model.chart()); + Assertions.assertEquals("zceuojgjrw", model.etag()); + Assertions.assertEquals("pskrdqmh", model.displayName()); + Assertions.assertEquals("dhtldwkyz", model.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-19T07:46:09Z"), model.modifiedOn()); + Assertions.assertEquals("cwscwsvlx", model.dateRange()); + Assertions.assertEquals(ChartType.AREA, model.chart()); Assertions.assertEquals(AccumulatedType.TRUE, model.accumulated()); Assertions.assertEquals(MetricType.AHUB, model.metric()); Assertions.assertEquals(KpiType.BUDGET, model.kpis().get(0).type()); - Assertions.assertEquals("bdxkqpxokaj", model.kpis().get(0).id()); - Assertions.assertEquals(false, model.kpis().get(0).enabled()); + Assertions.assertEquals("fmisg", model.kpis().get(0).id()); + Assertions.assertFalse(model.kpis().get(0).enabled()); Assertions.assertEquals(PivotType.TAG_KEY, model.pivots().get(0).type()); - Assertions.assertEquals("ovmclwhijcoejct", model.pivots().get(0).name()); + Assertions.assertEquals("fwxosowzxcu", model.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, model.typePropertiesType()); Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T12:05:31Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T09:48:37Z"), model.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, model.dataSet().granularity()); - Assertions.assertEquals("ezcxtbzsgfyccsne", model.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("nrosfqpte", model.dataSet().aggregation().get("zzvypyqrimzinp").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("zzvypyqrimzinp").function()); - Assertions.assertEquals(QueryColumnType.TAG_KEY, model.dataSet().grouping().get(0).type()); - Assertions.assertEquals("ckwhds", model.dataSet().grouping().get(0).name()); - Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.dataSet().sorting().get(0).direction()); - Assertions.assertEquals("cyshurzafbljjgp", model.dataSet().sorting().get(0).name()); - Assertions.assertEquals("idtqajzyu", model.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("u", model.dataSet().filter().dimensions().values().get(0)); - Assertions.assertEquals("aierhhb", model.dataSet().filter().tags().name()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T17:16:14Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T06:56:38Z"), model.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.DAILY, model.dataSet().granularity()); + Assertions.assertEquals("notyfjfcnjbkcn", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("rmclfplphoxu", model.dataSet().aggregation().get("rpabg").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("rpabg").function()); + Assertions.assertEquals(QueryColumnType.DIMENSION, model.dataSet().grouping().get(0).type()); + Assertions.assertEquals("rxv", model.dataSet().grouping().get(0).name()); + Assertions.assertEquals(ReportConfigSortingType.DESCENDING, model.dataSet().sorting().get(0).direction()); + Assertions.assertEquals("sbkyvpycanuzbp", model.dataSet().sorting().get(0).name()); + Assertions.assertEquals("slhs", model.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("eemaofmxagkvtme", model.dataSet().filter().dimensions().values().get(0)); + Assertions.assertEquals("dhmdua", model.dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().tags().operator()); - Assertions.assertEquals("l", model.dataSet().filter().tags().values().get(0)); - Assertions.assertEquals(false, model.includeMonetaryCommitment()); + Assertions.assertEquals("xqpvfadmw", model.dataSet().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeMonetaryCommitment()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewListResultTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewListResultTests.java index fb6ad6b64fa8..570a690b8b5a 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewListResultTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.costmanagement.models.ViewListResult; +import com.azure.resourcemanager.costmanagement.implementation.models.ViewListResult; +import org.junit.jupiter.api.Assertions; public final class ViewListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ViewListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ccsnhsjc\",\"scope\":\"ejhkry\",\"createdOn\":\"2021-03-30T08:32:11Z\",\"modifiedOn\":\"2021-11-17T21:53:26Z\",\"dateRange\":\"zw\",\"currency\":\"kjyemkk\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"YearToDate\",\"timePeriod\":{\"from\":\"2021-06-01T01:33:29Z\",\"to\":\"2021-07-12T23:10:20Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{},\"aggregation\":{\"deh\":{\"name\":\"ejspodmail\",\"function\":\"Sum\"},\"ixjsprozvcputeg\":{\"name\":\"jwyahuxinpmqnja\",\"function\":\"Sum\"},\"t\":{\"name\":\"vwmf\",\"function\":\"Sum\"},\"hulsuuvmkjozkrwf\":{\"name\":\"cmdv\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"djpslw\"},{\"type\":\"TagKey\",\"name\":\"dpvwryoqpsoaccta\"}],\"sorting\":[{\"name\":\"ljlahbcryf\"},{\"name\":\"dfdosygexp\"}],\"filter\":{}},\"includeMonetaryCommitment\":true},\"chart\":\"Line\",\"accumulated\":\"true\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"evdphlxaol\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"qjbpfzfsin\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"zoxxjtf\"},{\"type\":\"TagKey\",\"name\":\"wfzitonpeqfpjk\"},{\"type\":\"TagKey\",\"name\":\"fpdvhpfxxypi\"},{\"type\":\"TagKey\",\"name\":\"ayhuy\"}]},\"eTag\":\"kpode\",\"id\":\"ooginuvamih\",\"name\":\"ognarxzxtheotus\",\"type\":\"vyevcciqi\"},{\"properties\":{\"displayName\":\"un\",\"scope\":\"wjzrnfygxgisp\",\"createdOn\":\"2021-05-03T11:09:18Z\",\"modifiedOn\":\"2021-01-12T09:11:57Z\",\"dateRange\":\"kufubljo\",\"currency\":\"qeof\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-01-23T13:20:17Z\",\"to\":\"2021-08-04T06:00:55Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{},\"aggregation\":{\"gc\":{\"name\":\"smjqulngsntnbyb\",\"function\":\"Sum\"},\"kcqvkocrc\":{\"name\":\"rwclxxwrljdo\",\"function\":\"Sum\"},\"xbnjbiksq\":{\"name\":\"dkwt\",\"function\":\"Sum\"},\"inqpjwnzll\":{\"name\":\"gls\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"pee\"},{\"type\":\"TagKey\",\"name\":\"mgxsab\"},{\"type\":\"TagKey\",\"name\":\"qduujitcjczdz\"}],\"sorting\":[{\"name\":\"dhkrwpdappdsbdk\"},{\"name\":\"wrwjfeu\"}],\"filter\":{}},\"includeMonetaryCommitment\":true},\"chart\":\"Area\",\"accumulated\":\"true\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"gjzzdatqxhocdg\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"huticndvkao\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"yhxhu\",\"enabled\":false},{\"type\":\"Budget\",\"id\":\"xolniwpwcukjfk\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"ypl\"},{\"type\":\"Dimension\",\"name\":\"asy\"}]},\"eTag\":\"nddhsgcbacph\",\"id\":\"jkot\",\"name\":\"nqgoulzndli\",\"type\":\"wyqkgfgibm\"},{\"properties\":{\"displayName\":\"akeqs\",\"scope\":\"yb\",\"createdOn\":\"2021-03-26T22:16:08Z\",\"modifiedOn\":\"2021-02-21T09:55:36Z\",\"dateRange\":\"ytb\",\"currency\":\"qfou\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-09-02T23:31:13Z\",\"to\":\"2021-12-07T12:50:46Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{},\"aggregation\":{\"utduqktapspwgcu\":{\"name\":\"lougpbkw\",\"function\":\"Sum\"},\"bmdg\":{\"name\":\"rtumkdosvq\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"ddgmb\"},{\"type\":\"TagKey\",\"name\":\"ex\"},{\"type\":\"Dimension\",\"name\":\"bhtqqrolfpfpsa\"}],\"sorting\":[{\"name\":\"qux\"},{\"name\":\"gjyjgzjaoyfhrtxi\"}],\"filter\":{}},\"includeMonetaryCommitment\":false},\"chart\":\"Table\",\"accumulated\":\"false\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"fqawrlyxw\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"b\"},{\"type\":\"TagKey\",\"name\":\"tbvpysszdnru\"},{\"type\":\"TagKey\",\"name\":\"hmuouqfprwzwbn\"},{\"type\":\"TagKey\",\"name\":\"nwui\"}]},\"eTag\":\"a\",\"id\":\"x\",\"name\":\"fizuckyf\",\"type\":\"hr\"}],\"nextLink\":\"dfvzwdzuhty\"}") + "{\"value\":[{\"properties\":{\"displayName\":\"wesgogczh\",\"scope\":\"nxkrlgnyhmossxkk\",\"createdOn\":\"2021-10-30T19:25:09Z\",\"modifiedOn\":\"2021-06-21T18:07:23Z\",\"dateRange\":\"hxjbdhqxvc\",\"currency\":\"frpdsofbshrns\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-10-24T16:56:58Z\",\"to\":\"2021-05-17T15:19:01Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{},\"aggregation\":{\"jsrtk\":{\"name\":\"nu\",\"function\":\"Sum\"},\"x\":{\"name\":\"awnopqgikyzirtxd\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"tpsew\"},{\"type\":\"Dimension\",\"name\":\"oi\"},{\"type\":\"TagKey\",\"name\":\"ukry\"},{\"type\":\"Dimension\",\"name\":\"tqmieox\"}],\"sorting\":[{\"name\":\"gufhyaomtbg\"},{\"name\":\"havgrvk\"},{\"name\":\"fo\"}],\"filter\":{}},\"includeMonetaryCommitment\":false},\"chart\":\"Table\",\"accumulated\":\"false\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"mv\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"vwxnbkfe\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"hwzdgirujbz\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"btdcqvpniyujvi\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"snrbgyefrymsgao\"},{\"type\":\"Dimension\",\"name\":\"nc\"},{\"type\":\"TagKey\",\"name\":\"fhir\"}]},\"eTag\":\"ymoxoftpipiwyczu\",\"id\":\"a\",\"name\":\"pqjlihhyusps\",\"type\":\"asdvl\"},{\"properties\":{\"displayName\":\"dgzxulucvpamrsr\",\"scope\":\"zvxurisjnhny\",\"createdOn\":\"2021-05-07T06:22:43Z\",\"modifiedOn\":\"2021-08-30T04:18:03Z\",\"dateRange\":\"zgxmr\",\"currency\":\"blwpcesutrgj\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"YearToDate\",\"timePeriod\":{\"from\":\"2021-07-20T22:26:52Z\",\"to\":\"2021-05-19T21:38:43Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{},\"aggregation\":{\"nfqn\":{\"name\":\"ejqgw\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"sx\"},{\"type\":\"Dimension\",\"name\":\"foimwkslircizjxv\"},{\"type\":\"TagKey\",\"name\":\"fceacvlhvygd\"}],\"sorting\":[{\"name\":\"umrtwnawjsl\"}],\"filter\":{}},\"includeMonetaryCommitment\":true},\"chart\":\"GroupedColumn\",\"accumulated\":\"false\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"nbaeqphchqn\",\"enabled\":false},{\"type\":\"Forecast\",\"id\":\"huwrykqgaifm\",\"enabled\":false},{\"type\":\"Budget\",\"id\":\"dvk\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"cvdsrhnj\"}]},\"eTag\":\"olvtnovqfzge\",\"id\":\"dftuljltduce\",\"name\":\"mtmczuome\",\"type\":\"wcw\"},{\"properties\":{\"displayName\":\"oknssxmojmsvpkjp\",\"scope\":\"kwcf\",\"createdOn\":\"2021-12-08T22:14:22Z\",\"modifiedOn\":\"2021-11-25T04:25:13Z\",\"dateRange\":\"gtczheydb\",\"currency\":\"shmkxmaehvbbxur\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-08-11T19:12:35Z\",\"to\":\"2021-04-21T08:05:23Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{},\"aggregation\":{\"pyklyhpluodpvru\":{\"name\":\"xywr\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"zibt\"}],\"sorting\":[{\"name\":\"tgk\"},{\"name\":\"stvdxeclz\"}],\"filter\":{}},\"includeMonetaryCommitment\":true},\"chart\":\"GroupedColumn\",\"accumulated\":\"true\",\"metric\":\"AHUB\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"kdl\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"mlkxtrqjfs\",\"enabled\":false},{\"type\":\"Forecast\",\"id\":\"hwgfwsrt\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"brhu\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"oookkqfq\"},{\"type\":\"Dimension\",\"name\":\"eorfm\"}]},\"eTag\":\"iqtqzfavyvnq\",\"id\":\"bar\",\"name\":\"euayjkqabqgzsles\",\"type\":\"cbhernntiewdj\"}],\"nextLink\":\"bquwrbehw\"}") .toObject(ViewListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ViewListResult model = new ViewListResult(); - model = BinaryData.fromObject(model).toObject(ViewListResult.class); + Assertions.assertEquals("bquwrbehw", model.nextLink()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewPropertiesTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewPropertiesTests.java index 70f072b8c4ce..e81e39eebc89 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewPropertiesTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; @@ -38,168 +38,194 @@ public final class ViewPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ViewProperties model = BinaryData.fromString( - "{\"displayName\":\"zvddntwndeicbtwn\",\"scope\":\"aoqvuh\",\"createdOn\":\"2021-02-17T19:22:59Z\",\"modifiedOn\":\"2021-07-03T16:36:07Z\",\"dateRange\":\"yd\",\"currency\":\"lmjthjq\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-11-30T09:09:34Z\",\"to\":\"2021-07-04T22:32:14Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"q\",\"hkh\",\"xuigdtopbobj\",\"ghmewuam\"]},\"aggregation\":{\"pgvdf\":{\"name\":\"rzayv\",\"function\":\"Sum\"},\"xlefgugnxkrx\":{\"name\":\"iotkftutqxl\",\"function\":\"Sum\"},\"thz\":{\"name\":\"qmi\",\"function\":\"Sum\"},\"jybige\":{\"name\":\"vqdra\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"bowsk\"},{\"type\":\"Dimension\",\"name\":\"yktz\"}],\"sorting\":[{\"direction\":\"Ascending\",\"name\":\"wgqyw\"}],\"filter\":{\"and\":[{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"gpphrcgyn\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"pec\",\"operator\":\"In\",\"values\":[]}},{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"fsxlzevgbmqjqa\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"pmivkwlzu\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"nbacfi\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"ebxetqgtzxdp\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"feallnwsu\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"njampm\",\"operator\":\"Contains\",\"values\":[]}}],\"dimensions\":{\"name\":\"zscxaqwo\",\"operator\":\"Contains\",\"values\":[\"cbonqvpk\",\"lrxnjeaseiphe\",\"f\"]},\"tags\":{\"name\":\"keyyi\",\"operator\":\"In\",\"values\":[\"bdlwtgrhpdjpj\",\"masxazjpqyegu\",\"lhbxxhejjzzvdud\",\"wdslfhotwmcy\"]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Table\",\"accumulated\":\"false\",\"metric\":\"AHUB\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"dehxnltyfsoppu\",\"enabled\":false},{\"type\":\"Forecast\",\"id\":\"wd\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"zdmohctbqvu\"},{\"type\":\"Dimension\",\"name\":\"ndnvo\"},{\"type\":\"TagKey\",\"name\":\"jugwdkcglhsl\"}]}") + "{\"displayName\":\"ni\",\"scope\":\"x\",\"createdOn\":\"2021-09-13T09:37:01Z\",\"modifiedOn\":\"2021-04-10T12:35:25Z\",\"dateRange\":\"gklwn\",\"currency\":\"hjdauwhvylwz\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2021-05-11T10:23:35Z\",\"to\":\"2021-11-19T04:43:06Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"wuwprzqlv\"]},\"aggregation\":{\"hfxobbcswsrtj\":{\"name\":\"lupj\",\"function\":\"Sum\"},\"gw\":{\"name\":\"iplrbpbewtghfgb\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"v\"},{\"type\":\"Dimension\",\"name\":\"jkbegibtnmxiebww\"},{\"type\":\"TagKey\",\"name\":\"oayqc\"}],\"sorting\":[{\"direction\":\"Ascending\",\"name\":\"j\"},{\"direction\":\"Ascending\",\"name\":\"wyzmhtxon\"}],\"filter\":{\"and\":[{\"and\":[{},{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"pwxqp\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"nftguvriuhpr\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"tayriwwroyqbex\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"qibycnojvknm\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"ah\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"y\",\"operator\":\"In\",\"values\":[]}}],\"or\":[{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"rvxdjzlmw\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"vu\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"wjvzunluthnn\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"xipeilpjzuaejx\",\"operator\":\"Contains\",\"values\":[]}},{\"and\":[{},{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"bbtdzumvee\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"wozuhkf\",\"operator\":\"In\",\"values\":[]}}],\"dimensions\":{\"name\":\"jyofdxluusdtto\",\"operator\":\"In\",\"values\":[\"boekqvkel\",\"smv\"]},\"tags\":{\"name\":\"wyjsflhhcaalnjix\",\"operator\":\"Contains\",\"values\":[\"yaw\",\"oyaqcslyjpkiid\"]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Line\",\"accumulated\":\"true\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Forecast\",\"id\":\"tfolhbnx\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"lp\",\"enabled\":true}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"pnyiropuhp\"},{\"type\":\"TagKey\",\"name\":\"gylgqgitxmedjvcs\"},{\"type\":\"Dimension\",\"name\":\"wwncwzzhxgk\"},{\"type\":\"Dimension\",\"name\":\"ucnapkteoellwp\"}]}") .toObject(ViewProperties.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.displayName()); - Assertions.assertEquals("aoqvuh", model.scope()); - Assertions.assertEquals("yd", model.dateRange()); - Assertions.assertEquals(ChartType.TABLE, model.chart()); - Assertions.assertEquals(AccumulatedType.FALSE, model.accumulated()); - Assertions.assertEquals(MetricType.AHUB, model.metric()); - Assertions.assertEquals(KpiType.BUDGET, model.kpis().get(0).type()); - Assertions.assertEquals("dehxnltyfsoppu", model.kpis().get(0).id()); - Assertions.assertEquals(false, model.kpis().get(0).enabled()); + Assertions.assertEquals("ni", model.displayName()); + Assertions.assertEquals("x", model.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T12:35:25Z"), model.modifiedOn()); + Assertions.assertEquals("gklwn", model.dateRange()); + Assertions.assertEquals(ChartType.LINE, model.chart()); + Assertions.assertEquals(AccumulatedType.TRUE, model.accumulated()); + Assertions.assertEquals(MetricType.ACTUAL_COST, model.metric()); + Assertions.assertEquals(KpiType.FORECAST, model.kpis().get(0).type()); + Assertions.assertEquals("tfolhbnx", model.kpis().get(0).id()); + Assertions.assertTrue(model.kpis().get(0).enabled()); Assertions.assertEquals(PivotType.TAG_KEY, model.pivots().get(0).type()); - Assertions.assertEquals("zdmohctbqvu", model.pivots().get(0).name()); + Assertions.assertEquals("pnyiropuhp", model.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, model.type()); - Assertions.assertEquals(ReportTimeframeType.CUSTOM, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-30T09:09:34Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T22:32:14Z"), model.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, model.dataSet().granularity()); - Assertions.assertEquals("q", model.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("rzayv", model.dataSet().aggregation().get("pgvdf").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("pgvdf").function()); + Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T10:23:35Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T04:43:06Z"), model.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.DAILY, model.dataSet().granularity()); + Assertions.assertEquals("wuwprzqlv", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("lupj", model.dataSet().aggregation().get("hfxobbcswsrtj").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("hfxobbcswsrtj").function()); Assertions.assertEquals(QueryColumnType.DIMENSION, model.dataSet().grouping().get(0).type()); - Assertions.assertEquals("bowsk", model.dataSet().grouping().get(0).name()); + Assertions.assertEquals("v", model.dataSet().grouping().get(0).name()); Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.dataSet().sorting().get(0).direction()); - Assertions.assertEquals("wgqyw", model.dataSet().sorting().get(0).name()); - Assertions.assertEquals("gpphrcgyn", model.dataSet().filter().and().get(0).dimensions().name()); + Assertions.assertEquals("j", model.dataSet().sorting().get(0).name()); + Assertions.assertEquals("pwxqp", model.dataSet().filter().and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("pec", model.dataSet().filter().and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().and().get(0).tags().operator()); - Assertions.assertEquals("feallnwsu", model.dataSet().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("nftguvriuhpr", model.dataSet().filter().and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).tags().operator()); + Assertions.assertEquals("rvxdjzlmw", model.dataSet().filter().or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("njampm", model.dataSet().filter().or().get(0).tags().name()); + Assertions.assertEquals("vu", model.dataSet().filter().or().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).tags().operator()); - Assertions.assertEquals("zscxaqwo", model.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("cbonqvpk", model.dataSet().filter().dimensions().values().get(0)); - Assertions.assertEquals("keyyi", model.dataSet().filter().tags().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().tags().operator()); - Assertions.assertEquals("bdlwtgrhpdjpj", model.dataSet().filter().tags().values().get(0)); - Assertions.assertEquals(true, model.includeMonetaryCommitment()); + Assertions.assertEquals("jyofdxluusdtto", model.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("boekqvkel", model.dataSet().filter().dimensions().values().get(0)); + Assertions.assertEquals("wyjsflhhcaalnjix", model.dataSet().filter().tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().tags().operator()); + Assertions.assertEquals("yaw", model.dataSet().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeMonetaryCommitment()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ViewProperties model - = new ViewProperties().withDisplayName("zvddntwndeicbtwn") - .withScope("aoqvuh") - .withDateRange("yd") - .withChart(ChartType.TABLE) - .withAccumulated(AccumulatedType.FALSE) - .withMetric(MetricType.AHUB) - .withKpis(Arrays.asList( - new KpiProperties().withType(KpiType.BUDGET).withId("dehxnltyfsoppu").withEnabled(false), - new KpiProperties().withType(KpiType.FORECAST).withId("wd").withEnabled(false))) - .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.TAG_KEY).withName("zdmohctbqvu"), - new PivotProperties().withType(PivotType.DIMENSION).withName("ndnvo"), - new PivotProperties().withType(PivotType.TAG_KEY).withName("jugwdkcglhsl"))) - .withType(ReportType.USAGE) - .withTimeframe(ReportTimeframeType.CUSTOM) - .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-11-30T09:09:34Z")) - .withTo(OffsetDateTime.parse("2021-07-04T22:32:14Z"))) - .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.MONTHLY) - .withConfiguration(new ReportConfigDatasetConfiguration() - .withColumns(Arrays.asList("q", "hkh", "xuigdtopbobj", "ghmewuam"))) - .withAggregation(mapOf("pgvdf", - new ReportConfigAggregation().withName("rzayv").withFunction(FunctionType.SUM), "xlefgugnxkrx", - new ReportConfigAggregation().withName("iotkftutqxl").withFunction(FunctionType.SUM), "thz", - new ReportConfigAggregation().withName("qmi").withFunction(FunctionType.SUM), "jybige", - new ReportConfigAggregation().withName("vqdra").withFunction(FunctionType.SUM))) - .withGrouping( - Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("bowsk"), - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("yktz"))) - .withSorting(Arrays.asList( - new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("wgqyw"))) - .withFilter(new ReportConfigFilter() - .withAnd(Arrays.asList( - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("gpphrcgyn") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("pec") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())), - new ReportConfigFilter().withAnd(Arrays.asList(new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("fsxlzevgbmqjqa") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("pmivkwlzu") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())), - new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("nbacfi") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("ebxetqgtzxdp") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())))) - .withOr(Arrays.asList(new ReportConfigFilter() + ViewProperties model = new ViewProperties().withDisplayName("ni") + .withScope("x") + .withModifiedOn(OffsetDateTime.parse("2021-04-10T12:35:25Z")) + .withDateRange("gklwn") + .withChart(ChartType.LINE) + .withAccumulated(AccumulatedType.TRUE) + .withMetric(MetricType.ACTUAL_COST) + .withKpis(Arrays.asList(new KpiProperties().withType(KpiType.FORECAST).withId("tfolhbnx").withEnabled(true), + new KpiProperties().withType(KpiType.FORECAST).withId("lp").withEnabled(true))) + .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.TAG_KEY).withName("pnyiropuhp"), + new PivotProperties().withType(PivotType.TAG_KEY).withName("gylgqgitxmedjvcs"), + new PivotProperties().withType(PivotType.DIMENSION).withName("wwncwzzhxgk"), + new PivotProperties().withType(PivotType.DIMENSION).withName("ucnapkteoellwp"))) + .withType(ReportType.USAGE) + .withTimeframe(ReportTimeframeType.WEEK_TO_DATE) + .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-05-11T10:23:35Z")) + .withTo(OffsetDateTime.parse("2021-11-19T04:43:06Z"))) + .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) + .withConfiguration(new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("wuwprzqlv"))) + .withAggregation(mapOf("hfxobbcswsrtj", + new ReportConfigAggregation().withName("lupj").withFunction(FunctionType.SUM), "gw", + new ReportConfigAggregation().withName("iplrbpbewtghfgb").withFunction(FunctionType.SUM))) + .withGrouping( + Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("v"), + new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("jkbegibtnmxiebww"), + new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("oayqc"))) + .withSorting(Arrays.asList( + new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("j"), + new ReportConfigSorting().withDirection(ReportConfigSortingType.ASCENDING).withName("wyzmhtxon"))) + .withFilter(new ReportConfigFilter() + .withAnd(Arrays.asList( + new ReportConfigFilter() .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("feallnwsu") + .withDimensions(new ReportConfigComparisonExpression().withName("pwxqp") .withOperator(OperatorType.CONTAINS) .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("njampm") + .withTags(new ReportConfigComparisonExpression() + .withName("nftguvriuhpr") .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("tayriwwroyqbex") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("qibycnojvknm") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("ah") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("y") + .withOperator(OperatorType.IN) .withValues(Arrays.asList())))) - .withDimensions(new ReportConfigComparisonExpression().withName("zscxaqwo") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList("cbonqvpk", "lrxnjeaseiphe", "f"))) - .withTags( - new ReportConfigComparisonExpression().withName("keyyi") + .withOr(Arrays.asList( + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("rvxdjzlmw") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("vu") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("wjvzunluthnn") .withOperator(OperatorType.IN) - .withValues(Arrays.asList("bdlwtgrhpdjpj", "masxazjpqyegu", "lhbxxhejjzzvdud", - "wdslfhotwmcy"))))) - .withIncludeMonetaryCommitment(true); + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("xipeilpjzuaejx") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())), + new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), + new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("bbtdzumvee") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("wozuhkf") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())))) + .withDimensions(new ReportConfigComparisonExpression().withName("jyofdxluusdtto") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList("boekqvkel", "smv"))) + .withTags(new ReportConfigComparisonExpression().withName("wyjsflhhcaalnjix") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList("yaw", "oyaqcslyjpkiid"))))) + .withIncludeMonetaryCommitment(true); model = BinaryData.fromObject(model).toObject(ViewProperties.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.displayName()); - Assertions.assertEquals("aoqvuh", model.scope()); - Assertions.assertEquals("yd", model.dateRange()); - Assertions.assertEquals(ChartType.TABLE, model.chart()); - Assertions.assertEquals(AccumulatedType.FALSE, model.accumulated()); - Assertions.assertEquals(MetricType.AHUB, model.metric()); - Assertions.assertEquals(KpiType.BUDGET, model.kpis().get(0).type()); - Assertions.assertEquals("dehxnltyfsoppu", model.kpis().get(0).id()); - Assertions.assertEquals(false, model.kpis().get(0).enabled()); + Assertions.assertEquals("ni", model.displayName()); + Assertions.assertEquals("x", model.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T12:35:25Z"), model.modifiedOn()); + Assertions.assertEquals("gklwn", model.dateRange()); + Assertions.assertEquals(ChartType.LINE, model.chart()); + Assertions.assertEquals(AccumulatedType.TRUE, model.accumulated()); + Assertions.assertEquals(MetricType.ACTUAL_COST, model.metric()); + Assertions.assertEquals(KpiType.FORECAST, model.kpis().get(0).type()); + Assertions.assertEquals("tfolhbnx", model.kpis().get(0).id()); + Assertions.assertTrue(model.kpis().get(0).enabled()); Assertions.assertEquals(PivotType.TAG_KEY, model.pivots().get(0).type()); - Assertions.assertEquals("zdmohctbqvu", model.pivots().get(0).name()); + Assertions.assertEquals("pnyiropuhp", model.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, model.type()); - Assertions.assertEquals(ReportTimeframeType.CUSTOM, model.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-30T09:09:34Z"), model.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T22:32:14Z"), model.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, model.dataSet().granularity()); - Assertions.assertEquals("q", model.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("rzayv", model.dataSet().aggregation().get("pgvdf").name()); - Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("pgvdf").function()); + Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, model.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T10:23:35Z"), model.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T04:43:06Z"), model.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.DAILY, model.dataSet().granularity()); + Assertions.assertEquals("wuwprzqlv", model.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("lupj", model.dataSet().aggregation().get("hfxobbcswsrtj").name()); + Assertions.assertEquals(FunctionType.SUM, model.dataSet().aggregation().get("hfxobbcswsrtj").function()); Assertions.assertEquals(QueryColumnType.DIMENSION, model.dataSet().grouping().get(0).type()); - Assertions.assertEquals("bowsk", model.dataSet().grouping().get(0).name()); + Assertions.assertEquals("v", model.dataSet().grouping().get(0).name()); Assertions.assertEquals(ReportConfigSortingType.ASCENDING, model.dataSet().sorting().get(0).direction()); - Assertions.assertEquals("wgqyw", model.dataSet().sorting().get(0).name()); - Assertions.assertEquals("gpphrcgyn", model.dataSet().filter().and().get(0).dimensions().name()); + Assertions.assertEquals("j", model.dataSet().sorting().get(0).name()); + Assertions.assertEquals("pwxqp", model.dataSet().filter().and().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).dimensions().operator()); - Assertions.assertEquals("pec", model.dataSet().filter().and().get(0).tags().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().and().get(0).tags().operator()); - Assertions.assertEquals("feallnwsu", model.dataSet().filter().or().get(0).dimensions().name()); + Assertions.assertEquals("nftguvriuhpr", model.dataSet().filter().and().get(0).tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().and().get(0).tags().operator()); + Assertions.assertEquals("rvxdjzlmw", model.dataSet().filter().or().get(0).dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).dimensions().operator()); - Assertions.assertEquals("njampm", model.dataSet().filter().or().get(0).tags().name()); + Assertions.assertEquals("vu", model.dataSet().filter().or().get(0).tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().or().get(0).tags().operator()); - Assertions.assertEquals("zscxaqwo", model.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("cbonqvpk", model.dataSet().filter().dimensions().values().get(0)); - Assertions.assertEquals("keyyi", model.dataSet().filter().tags().name()); - Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().tags().operator()); - Assertions.assertEquals("bdlwtgrhpdjpj", model.dataSet().filter().tags().values().get(0)); - Assertions.assertEquals(true, model.includeMonetaryCommitment()); + Assertions.assertEquals("jyofdxluusdtto", model.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.IN, model.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("boekqvkel", model.dataSet().filter().dimensions().values().get(0)); + Assertions.assertEquals("wyjsflhhcaalnjix", model.dataSet().filter().tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, model.dataSet().filter().tags().operator()); + Assertions.assertEquals("yaw", model.dataSet().filter().tags().values().get(0)); + Assertions.assertTrue(model.includeMonetaryCommitment()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeWithResponseMockTests.java index c8bd113ce8ed..488b1ef63715 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AccumulatedType; @@ -45,86 +45,92 @@ public final class ViewsCreateOrUpdateByScopeWithResponseMockTests { @Test public void testCreateOrUpdateByScopeWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"bfu\",\"scope\":\"frojsydgr\",\"createdOn\":\"2021-04-19T05:33:50Z\",\"modifiedOn\":\"2021-11-05T07:34:40Z\",\"dateRange\":\"ywezskiecafyg\",\"currency\":\"xieqv\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2021-04-25T16:17:08Z\",\"to\":\"2021-09-22T06:47:14Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"xalybxawoijpo\",\"tblxpkkwjdjodqhy\",\"incnr\"]},\"aggregation\":{\"kadppyibngq\":{\"name\":\"hllizhceumoq\",\"function\":\"Sum\"},\"vvadswzs\":{\"name\":\"adywrxwhydt\",\"function\":\"Sum\"},\"wuowhlxlnwy\":{\"name\":\"uyem\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"vblgmokzk\"},{\"type\":\"Dimension\",\"name\":\"rfowtdvrfmvlih\"}],\"sorting\":[{\"name\":\"drqc\"},{\"name\":\"jidhftu\"},{\"name\":\"vhdxlwyo\"},{\"name\":\"bfqz\"}],\"filter\":{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"xhafratqx\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"roumzznva\",\"operator\":\"Contains\",\"values\":[]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Area\",\"accumulated\":\"false\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"usllywpvtiotz\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"ryf\"},{\"type\":\"Dimension\",\"name\":\"sigrowsocnequygd\"}]},\"eTag\":\"oqgrmtqjkqevadr\",\"id\":\"mwiuawvcm\",\"name\":\"z\",\"type\":\"xiid\"}"; + = "{\"properties\":{\"displayName\":\"omqo\",\"scope\":\"epiaeapfsergd\",\"createdOn\":\"2021-06-24T08:16:31Z\",\"modifiedOn\":\"2021-08-17T14:31:44Z\",\"dateRange\":\"cyheqwbpqqncj\",\"currency\":\"khjoz\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-09-17T10:30:36Z\",\"to\":\"2021-08-18T16:14:30Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"vliqiips\",\"jbsv\"]},\"aggregation\":{\"pywyjlnld\":{\"name\":\"ieswhddzydisn\",\"function\":\"Sum\"},\"qibzji\":{\"name\":\"xottdiia\",\"function\":\"Sum\"},\"wqwoqsratjhdhzyb\":{\"name\":\"weebiphryv\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"hfrzgdkkagvwukhs\"}],\"sorting\":[{\"name\":\"mo\"}],\"filter\":{\"and\":[{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"lzzhnijmr\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"lk\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":true},\"chart\":\"GroupedColumn\",\"accumulated\":\"false\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Forecast\",\"id\":\"utpum\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"ynbpvzlqywauy\"},{\"type\":\"TagKey\",\"name\":\"khmocgjs\"},{\"type\":\"TagKey\",\"name\":\"a\"}]},\"eTag\":\"wvixq\",\"id\":\"gljkybsj\",\"name\":\"clrvtzqnrbctbh\",\"type\":\"jhxpcvrd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - View response = manager.views() - .define("fwmyymv") - .withExistingScope("onql") - .withEtag("itnspxlzde") - .withDisplayName("pb") - .withScope("ckdvez") - .withDateRange("zhddubbnqf") - .withChart(ChartType.GROUPED_COLUMN) - .withAccumulated(AccumulatedType.FALSE) - .withMetric(MetricType.ACTUAL_COST) - .withKpis(Arrays.asList(new KpiProperties().withType(KpiType.FORECAST).withId("iytxt").withEnabled(false))) - .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.DIMENSION).withName("ktg"), - new PivotProperties().withType(PivotType.TAG_KEY).withName("ouambewre"), - new PivotProperties().withType(PivotType.DIMENSION).withName("weg"), - new PivotProperties().withType(PivotType.TAG_KEY).withName("eyxeyguqigi"))) - .withTypePropertiesType(ReportType.USAGE) - .withTimeframe(ReportTimeframeType.CUSTOM) - .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-10-21T13:38:19Z")) - .withTo(OffsetDateTime.parse("2021-07-29T15:54:11Z"))) - .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) - .withConfiguration(new ReportConfigDatasetConfiguration() - .withColumns(Arrays.asList("qjtiogqgdm", "nictteajo", "iygspnbonhpczyk", "ktpv"))) - .withAggregation( - mapOf("umqy", new ReportConfigAggregation().withName("csehchkhufm").withFunction(FunctionType.SUM))) - .withGrouping( - Arrays.asList(new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("zulo"), - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("aeuzanh"), - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("nhsenwphpzfng"), - new ReportConfigGrouping().withType(QueryColumnType.TAG_KEY).withName("clid"))) - .withSorting(Arrays.asList(new ReportConfigSorting().withName("jwjj"))) - .withFilter(new ReportConfigFilter() - .withAnd( - Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("k") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("htssruqnmdvhazc") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())))) - .withIncludeMonetaryCommitment(false) - .create(); + View response + = manager.views() + .define("mhmnulwemp") + .withExistingScope("wrczfjjnnuxxrk") + .withEtag("cjzlquzexokjxebj") + .withDisplayName("frhjulrsulwzp") + .withScope("usnaw") + .withModifiedOn(OffsetDateTime.parse("2021-09-15T04:54:24Z")) + .withDateRange("tfriyrgko") + .withChart(ChartType.TABLE) + .withAccumulated(AccumulatedType.TRUE) + .withMetric(MetricType.ACTUAL_COST) + .withKpis(Arrays.asList( + new KpiProperties().withType(KpiType.FORECAST).withId("ammgmqfmefgv").withEnabled(false), + new KpiProperties().withType(KpiType.BUDGET).withId("gquxweysland").withEnabled(false), + new KpiProperties().withType(KpiType.BUDGET).withId("unhghcgawnr").withEnabled(false))) + .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.DIMENSION).withName("tireimse"), + new PivotProperties().withType(PivotType.TAG_KEY).withName("xstcyilbvzm"))) + .withTypePropertiesType(ReportType.USAGE) + .withTimeframe(ReportTimeframeType.WEEK_TO_DATE) + .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-06-11T17:43:23Z")) + .withTo(OffsetDateTime.parse("2021-07-20T10:23:40Z"))) + .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) + .withConfiguration(new ReportConfigDatasetConfiguration() + .withColumns(Arrays.asList("molpcqyde", "kvskiczdfrjei", "ikgqaboohxbms"))) + .withAggregation(mapOf("aeohpjhgejkbvhh", + new ReportConfigAggregation().withName("qsxrmdvewu").withFunction(FunctionType.SUM), "bkhxj", + new ReportConfigAggregation().withName("aurghooxa").withFunction(FunctionType.SUM), "mbozom", + new ReportConfigAggregation().withName("joezlqxrkdknkobe").withFunction(FunctionType.SUM))) + .withGrouping(Arrays.asList( + new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("icbigwcdgzse"), + new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("uxk"), + new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("ai"))) + .withSorting(Arrays.asList(new ReportConfigSorting().withName("bmdlqjbed"), + new ReportConfigSorting().withName("f"))) + .withFilter(new ReportConfigFilter() + .withAnd( + Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("omihzbdnpxpkcd") + .withOperator(OperatorType.CONTAINS) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("yxelyicghflr") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())))) + .withIncludeMonetaryCommitment(false) + .create(); - Assertions.assertEquals("oqgrmtqjkqevadr", response.etag()); - Assertions.assertEquals("bfu", response.displayName()); - Assertions.assertEquals("frojsydgr", response.scope()); - Assertions.assertEquals("ywezskiecafyg", response.dateRange()); - Assertions.assertEquals(ChartType.AREA, response.chart()); + Assertions.assertEquals("wvixq", response.etag()); + Assertions.assertEquals("omqo", response.displayName()); + Assertions.assertEquals("epiaeapfsergd", response.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-17T14:31:44Z"), response.modifiedOn()); + Assertions.assertEquals("cyheqwbpqqncj", response.dateRange()); + Assertions.assertEquals(ChartType.GROUPED_COLUMN, response.chart()); Assertions.assertEquals(AccumulatedType.FALSE, response.accumulated()); Assertions.assertEquals(MetricType.AMORTIZED_COST, response.metric()); - Assertions.assertEquals(KpiType.BUDGET, response.kpis().get(0).type()); - Assertions.assertEquals("usllywpvtiotz", response.kpis().get(0).id()); - Assertions.assertEquals(false, response.kpis().get(0).enabled()); + Assertions.assertEquals(KpiType.FORECAST, response.kpis().get(0).type()); + Assertions.assertEquals("utpum", response.kpis().get(0).id()); + Assertions.assertFalse(response.kpis().get(0).enabled()); Assertions.assertEquals(PivotType.DIMENSION, response.pivots().get(0).type()); - Assertions.assertEquals("ryf", response.pivots().get(0).name()); + Assertions.assertEquals("ynbpvzlqywauy", response.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, response.typePropertiesType()); - Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, response.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T16:17:08Z"), response.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T06:47:14Z"), response.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.DAILY, response.dataSet().granularity()); - Assertions.assertEquals("xalybxawoijpo", response.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("hllizhceumoq", response.dataSet().aggregation().get("kadppyibngq").name()); - Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("kadppyibngq").function()); - Assertions.assertEquals(QueryColumnType.TAG_KEY, response.dataSet().grouping().get(0).type()); - Assertions.assertEquals("vblgmokzk", response.dataSet().grouping().get(0).name()); - Assertions.assertEquals("drqc", response.dataSet().sorting().get(0).name()); - Assertions.assertEquals("xhafratqx", response.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("roumzznva", response.dataSet().filter().tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().tags().operator()); - Assertions.assertEquals(true, response.includeMonetaryCommitment()); + Assertions.assertEquals(ReportTimeframeType.CUSTOM, response.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T10:30:36Z"), response.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T16:14:30Z"), response.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.MONTHLY, response.dataSet().granularity()); + Assertions.assertEquals("vliqiips", response.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("ieswhddzydisn", response.dataSet().aggregation().get("pywyjlnld").name()); + Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("pywyjlnld").function()); + Assertions.assertEquals(QueryColumnType.DIMENSION, response.dataSet().grouping().get(0).type()); + Assertions.assertEquals("hfrzgdkkagvwukhs", response.dataSet().grouping().get(0).name()); + Assertions.assertEquals("mo", response.dataSet().sorting().get(0).name()); + Assertions.assertEquals("lzzhnijmr", response.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("lk", response.dataSet().filter().tags().name()); + Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().tags().operator()); + Assertions.assertTrue(response.includeMonetaryCommitment()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateWithResponseMockTests.java index 342eaff54f8b..6d97c76b4674 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.fluent.models.ViewInner; @@ -46,84 +46,82 @@ public final class ViewsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"nxrwzawnvs\",\"scope\":\"fhzag\",\"createdOn\":\"2021-09-16T04:20:05Z\",\"modifiedOn\":\"2021-07-23T03:18:32Z\",\"dateRange\":\"dimwrzregzgyu\",\"currency\":\"trwpw\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-10-17T22:34:22Z\",\"to\":\"2021-02-10T19:44:01Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"tawjyosx\"]},\"aggregation\":{\"n\":{\"name\":\"nhjtf\",\"function\":\"Sum\"},\"nwynudq\":{\"name\":\"pmil\",\"function\":\"Sum\"},\"auzpjlx\":{\"name\":\"l\",\"function\":\"Sum\"},\"xls\":{\"name\":\"ehuxiqhzlraym\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"xrfdsajre\"}],\"sorting\":[{\"name\":\"yyshtuwgmevua\"},{\"name\":\"pwzyi\"},{\"name\":\"rkgwltxeqip\"}],\"filter\":{\"and\":[{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"sfayorpravkjoges\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"nsmjkwynqxaekqs\",\"operator\":\"Contains\",\"values\":[]}}},\"includeMonetaryCommitment\":false},\"chart\":\"GroupedColumn\",\"accumulated\":\"true\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"jcrspxklurcclfgx\",\"enabled\":false},{\"type\":\"Forecast\",\"id\":\"t\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"gpxvkqmaupxvpi\"},{\"type\":\"Dimension\",\"name\":\"ify\"},{\"type\":\"TagKey\",\"name\":\"yuubeidszlfyto\"}]},\"eTag\":\"hgygvfltgvd\",\"id\":\"hoynk\",\"name\":\"xwetwkdrcyrucpc\",\"type\":\"nn\"}"; + = "{\"properties\":{\"displayName\":\"iksbb\",\"scope\":\"ooxr\",\"createdOn\":\"2021-09-02T01:09:10Z\",\"modifiedOn\":\"2021-10-23T21:24:46Z\",\"dateRange\":\"chgjtnhtukfacih\",\"currency\":\"fntumeezbxvqx\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-03-19T07:46:42Z\",\"to\":\"2021-11-06T23:30:54Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"mjzwx\"]},\"aggregation\":{\"zt\":{\"name\":\"ovsxp\",\"function\":\"Sum\"},\"gfredmlscg\":{\"name\":\"fmkk\",\"function\":\"Sum\"},\"na\":{\"name\":\"ll\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"wazhpabaco\"},{\"type\":\"TagKey\",\"name\":\"yotgkwsxnsrqorc\"},{\"type\":\"Dimension\",\"name\":\"nmvceb\"}],\"sorting\":[{\"name\":\"tqujxcxxqndcqjk\"},{\"name\":\"dwqu\"},{\"name\":\"cgojmrv\"}],\"filter\":{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"zsehqqrsilcchskx\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"nsbvr\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":false},\"chart\":\"StackedColumn\",\"accumulated\":\"false\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"ejrthcfjzhxlyub\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"vrjeqmtzzbeqrztr\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"habsrwrsnrh\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"vyanxkvvcsemsvu\"},{\"type\":\"TagKey\",\"name\":\"qxetqmmlivrjjx\"}]},\"eTag\":\"xdchp\",\"id\":\"xlehzlxpgfquwzp\",\"name\":\"iibelwcerw\",\"type\":\"w\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - View response - = manager.views() - .createOrUpdateWithResponse("hza", new ViewInner().withEtag("ormcqmic") - .withDisplayName("nuhiig") - .withScope("lbuigv") - .withDateRange("rkdlb") - .withChart(ChartType.LINE) - .withAccumulated(AccumulatedType.TRUE) - .withMetric(MetricType.AMORTIZED_COST) - .withKpis(Arrays.asList( - new KpiProperties().withType(KpiType.FORECAST).withId("lxiutgjcyzyzjdnr").withEnabled(true))) - .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.TAG_KEY).withName("oqa"), - new PivotProperties().withType(PivotType.DIMENSION).withName("yh"), - new PivotProperties().withType(PivotType.DIMENSION).withName("uatbwbqamteuliy"), - new PivotProperties().withType(PivotType.DIMENSION).withName("cvmwfauxxepmy"))) - .withTypePropertiesType(ReportType.USAGE) - .withTimeframe(ReportTimeframeType.MONTH_TO_DATE) - .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-05-18T07:30Z")) - .withTo(OffsetDateTime.parse("2021-07-10T01:02:29Z"))) - .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) - .withConfiguration( - new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("dwead", "rzmwn"))) - .withAggregation(mapOf("magoaqylkjz", - new ReportConfigAggregation().withName("agttm").withFunction(FunctionType.SUM))) - .withGrouping(Arrays.asList( - new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("azjcgmxitpfin"))) - .withSorting(Arrays.asList(new ReportConfigSorting().withName("dltkrlg"), - new ReportConfigSorting().withName("mtbdrvcqgu"))) - .withFilter(new ReportConfigFilter() - .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter(), - new ReportConfigFilter(), new ReportConfigFilter())) - .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) - .withDimensions(new ReportConfigComparisonExpression().withName("heqdurelyujlfyou") - .withOperator(OperatorType.IN) - .withValues(Arrays.asList())) - .withTags(new ReportConfigComparisonExpression().withName("kyeclcdigpta") - .withOperator(OperatorType.CONTAINS) - .withValues(Arrays.asList())))) - .withIncludeMonetaryCommitment(true), com.azure.core.util.Context.NONE) - .getValue(); + View response = manager.views() + .createOrUpdateWithResponse("ag", new ViewInner().withEtag("axdvwzaehp") + .withDisplayName("tltng") + .withScope("reuptrk") + .withModifiedOn(OffsetDateTime.parse("2021-04-07T13:03:38Z")) + .withDateRange("jwolxfsvaghmpynw") + .withChart(ChartType.AREA) + .withAccumulated(AccumulatedType.TRUE) + .withMetric(MetricType.AHUB) + .withKpis(Arrays + .asList(new KpiProperties().withType(KpiType.BUDGET).withId("dgcruxspinymm").withEnabled(false))) + .withPivots(Arrays.asList(new PivotProperties().withType(PivotType.DIMENSION).withName("pazf"), + new PivotProperties().withType(PivotType.DIMENSION).withName("uvjipfd"))) + .withTypePropertiesType(ReportType.USAGE) + .withTimeframe(ReportTimeframeType.YEAR_TO_DATE) + .withTimePeriod(new ReportConfigTimePeriod().withFrom(OffsetDateTime.parse("2021-10-25T06:08:03Z")) + .withTo(OffsetDateTime.parse("2021-01-20T22:15:57Z"))) + .withDataSet(new ReportConfigDataset().withGranularity(ReportGranularityType.DAILY) + .withConfiguration(new ReportConfigDatasetConfiguration().withColumns(Arrays.asList("psnssovyxp"))) + .withAggregation(mapOf("slpuxgcbdsva", + new ReportConfigAggregation().withName("dnievwffcvvy").withFunction(FunctionType.SUM), "kx", + new ReportConfigAggregation().withName("pnptw").withFunction(FunctionType.SUM), "qvn", + new ReportConfigAggregation().withName("pazwug").withFunction(FunctionType.SUM))) + .withGrouping(Arrays + .asList(new ReportConfigGrouping().withType(QueryColumnType.DIMENSION).withName("elhldi"))) + .withSorting(Arrays.asList(new ReportConfigSorting().withName("zgqlmfae"))) + .withFilter(new ReportConfigFilter() + .withAnd(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withOr(Arrays.asList(new ReportConfigFilter(), new ReportConfigFilter())) + .withDimensions(new ReportConfigComparisonExpression().withName("p") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())) + .withTags(new ReportConfigComparisonExpression().withName("httqh") + .withOperator(OperatorType.IN) + .withValues(Arrays.asList())))) + .withIncludeMonetaryCommitment(true), com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("hgygvfltgvd", response.etag()); - Assertions.assertEquals("nxrwzawnvs", response.displayName()); - Assertions.assertEquals("fhzag", response.scope()); - Assertions.assertEquals("dimwrzregzgyu", response.dateRange()); - Assertions.assertEquals(ChartType.GROUPED_COLUMN, response.chart()); - Assertions.assertEquals(AccumulatedType.TRUE, response.accumulated()); - Assertions.assertEquals(MetricType.AMORTIZED_COST, response.metric()); + Assertions.assertEquals("xdchp", response.etag()); + Assertions.assertEquals("iksbb", response.displayName()); + Assertions.assertEquals("ooxr", response.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T21:24:46Z"), response.modifiedOn()); + Assertions.assertEquals("chgjtnhtukfacih", response.dateRange()); + Assertions.assertEquals(ChartType.STACKED_COLUMN, response.chart()); + Assertions.assertEquals(AccumulatedType.FALSE, response.accumulated()); + Assertions.assertEquals(MetricType.ACTUAL_COST, response.metric()); Assertions.assertEquals(KpiType.BUDGET, response.kpis().get(0).type()); - Assertions.assertEquals("jcrspxklurcclfgx", response.kpis().get(0).id()); - Assertions.assertEquals(false, response.kpis().get(0).enabled()); - Assertions.assertEquals(PivotType.TAG_KEY, response.pivots().get(0).type()); - Assertions.assertEquals("gpxvkqmaupxvpi", response.pivots().get(0).name()); + Assertions.assertEquals("ejrthcfjzhxlyub", response.kpis().get(0).id()); + Assertions.assertTrue(response.kpis().get(0).enabled()); + Assertions.assertEquals(PivotType.DIMENSION, response.pivots().get(0).type()); + Assertions.assertEquals("vyanxkvvcsemsvu", response.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, response.typePropertiesType()); - Assertions.assertEquals(ReportTimeframeType.CUSTOM, response.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T22:34:22Z"), response.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T19:44:01Z"), response.timePeriod().to()); + Assertions.assertEquals(ReportTimeframeType.MONTH_TO_DATE, response.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-19T07:46:42Z"), response.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T23:30:54Z"), response.timePeriod().to()); Assertions.assertEquals(ReportGranularityType.DAILY, response.dataSet().granularity()); - Assertions.assertEquals("tawjyosx", response.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("nhjtf", response.dataSet().aggregation().get("n").name()); - Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("n").function()); - Assertions.assertEquals(QueryColumnType.TAG_KEY, response.dataSet().grouping().get(0).type()); - Assertions.assertEquals("xrfdsajre", response.dataSet().grouping().get(0).name()); - Assertions.assertEquals("yyshtuwgmevua", response.dataSet().sorting().get(0).name()); - Assertions.assertEquals("sfayorpravkjoges", response.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("nsmjkwynqxaekqs", response.dataSet().filter().tags().name()); - Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().tags().operator()); - Assertions.assertEquals(false, response.includeMonetaryCommitment()); + Assertions.assertEquals("mjzwx", response.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("ovsxp", response.dataSet().aggregation().get("zt").name()); + Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("zt").function()); + Assertions.assertEquals(QueryColumnType.DIMENSION, response.dataSet().grouping().get(0).type()); + Assertions.assertEquals("wazhpabaco", response.dataSet().grouping().get(0).name()); + Assertions.assertEquals("tqujxcxxqndcqjk", response.dataSet().sorting().get(0).name()); + Assertions.assertEquals("zsehqqrsilcchskx", response.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("nsbvr", response.dataSet().filter().tags().name()); + Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().tags().operator()); + Assertions.assertFalse(response.includeMonetaryCommitment()); } // Use "Map.of" if available diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeWithResponseMockTests.java index 7d4d9e7fbd54..3852eb4cb10b 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteByScopeWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.views().deleteByScopeWithResponse("aglt", "xoe", com.azure.core.util.Context.NONE); + manager.views().deleteByScopeWithResponse("yejuwyqwdqigmghg", "nztxlujkh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteWithResponseMockTests.java index aa1ca560a5c1..ca939e3eeffc 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.views().deleteWithResponse("zdqumoe", com.azure.core.util.Context.NONE); + manager.views().deleteWithResponse("pjxljtxb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeWithResponseMockTests.java index ccbc34fc996a..4e1e27a98703 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetByScopeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AccumulatedType; @@ -32,46 +32,46 @@ public final class ViewsGetByScopeWithResponseMockTests { @Test public void testGetByScopeWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"n\",\"scope\":\"op\",\"createdOn\":\"2021-12-05T00:29:05Z\",\"modifiedOn\":\"2021-10-31T16:01:30Z\",\"dateRange\":\"nrlyxnuc\",\"currency\":\"p\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-04-05T15:21:36Z\",\"to\":\"2021-02-13T05:49:56Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"dtcjbctv\",\"vuzqymt\",\"owog\",\"gitsqh\"]},\"aggregation\":{\"ds\":{\"name\":\"rzcdbanf\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"eatkdbmwnrdj\"},{\"type\":\"Dimension\",\"name\":\"bqbnaomhjrmkuh\"},{\"type\":\"TagKey\",\"name\":\"xljalfihc\"},{\"type\":\"TagKey\",\"name\":\"obcancdexxqcw\"}],\"sorting\":[{\"name\":\"fgvaknokzwj\"}],\"filter\":{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"l\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"yfytpq\",\"operator\":\"Contains\",\"values\":[]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Table\",\"accumulated\":\"false\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"juvsmbmslzoyovw\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"ybe\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"cvtlubseskvc\"}]},\"eTag\":\"rtrh\",\"id\":\"nlp\",\"name\":\"rykycndzfqivjr\",\"type\":\"uykbbmn\"}"; + = "{\"properties\":{\"displayName\":\"msexroqr\",\"scope\":\"ktxfvonfe\",\"createdOn\":\"2021-03-09T14:48:28Z\",\"modifiedOn\":\"2021-07-19T01:45:33Z\",\"dateRange\":\"ietbgnix\",\"currency\":\"wwzkyf\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2021-04-15T10:42:36Z\",\"to\":\"2021-06-26T23:44:24Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"p\",\"pk\",\"dm\",\"xxij\"]},\"aggregation\":{\"kjgyacwrasekwe\":{\"name\":\"ws\",\"function\":\"Sum\"},\"woqartwy\":{\"name\":\"cvo\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"l\"}],\"sorting\":[{\"name\":\"atdavuqmcbyms\"},{\"name\":\"ob\"},{\"name\":\"lquvjezcjumvp\"},{\"name\":\"imioyo\"}],\"filter\":{\"and\":[{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"wnnra\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"bbfqpspklady\",\"operator\":\"Contains\",\"values\":[]}}},\"includeMonetaryCommitment\":false},\"chart\":\"Table\",\"accumulated\":\"true\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Forecast\",\"id\":\"mnmabeddqil\",\"enabled\":false},{\"type\":\"Forecast\",\"id\":\"qfp\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"rvwerfwxbsmtb\"}]},\"eTag\":\"jehhci\",\"id\":\"wdv\",\"name\":\"tbrekqhsqhtf\",\"type\":\"wpq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - View response = manager.views() - .getByScopeWithResponse("odnaienhqhskndn", "lqkaadlknwf", com.azure.core.util.Context.NONE) - .getValue(); + View response + = manager.views().getByScopeWithResponse("angp", "bfaxyxzlbc", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("rtrh", response.etag()); - Assertions.assertEquals("n", response.displayName()); - Assertions.assertEquals("op", response.scope()); - Assertions.assertEquals("nrlyxnuc", response.dateRange()); + Assertions.assertEquals("jehhci", response.etag()); + Assertions.assertEquals("msexroqr", response.displayName()); + Assertions.assertEquals("ktxfvonfe", response.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T01:45:33Z"), response.modifiedOn()); + Assertions.assertEquals("ietbgnix", response.dateRange()); Assertions.assertEquals(ChartType.TABLE, response.chart()); - Assertions.assertEquals(AccumulatedType.FALSE, response.accumulated()); - Assertions.assertEquals(MetricType.ACTUAL_COST, response.metric()); - Assertions.assertEquals(KpiType.BUDGET, response.kpis().get(0).type()); - Assertions.assertEquals("juvsmbmslzoyovw", response.kpis().get(0).id()); - Assertions.assertEquals(true, response.kpis().get(0).enabled()); - Assertions.assertEquals(PivotType.TAG_KEY, response.pivots().get(0).type()); - Assertions.assertEquals("cvtlubseskvc", response.pivots().get(0).name()); + Assertions.assertEquals(AccumulatedType.TRUE, response.accumulated()); + Assertions.assertEquals(MetricType.AMORTIZED_COST, response.metric()); + Assertions.assertEquals(KpiType.FORECAST, response.kpis().get(0).type()); + Assertions.assertEquals("mnmabeddqil", response.kpis().get(0).id()); + Assertions.assertFalse(response.kpis().get(0).enabled()); + Assertions.assertEquals(PivotType.DIMENSION, response.pivots().get(0).type()); + Assertions.assertEquals("rvwerfwxbsmtb", response.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, response.typePropertiesType()); - Assertions.assertEquals(ReportTimeframeType.MONTH_TO_DATE, response.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T15:21:36Z"), response.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T05:49:56Z"), response.timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.DAILY, response.dataSet().granularity()); - Assertions.assertEquals("dtcjbctv", response.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("rzcdbanf", response.dataSet().aggregation().get("ds").name()); - Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("ds").function()); - Assertions.assertEquals(QueryColumnType.TAG_KEY, response.dataSet().grouping().get(0).type()); - Assertions.assertEquals("eatkdbmwnrdj", response.dataSet().grouping().get(0).name()); - Assertions.assertEquals("fgvaknokzwj", response.dataSet().sorting().get(0).name()); - Assertions.assertEquals("l", response.dataSet().filter().dimensions().name()); + Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, response.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T10:42:36Z"), response.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T23:44:24Z"), response.timePeriod().to()); + Assertions.assertEquals(ReportGranularityType.MONTHLY, response.dataSet().granularity()); + Assertions.assertEquals("p", response.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("ws", response.dataSet().aggregation().get("kjgyacwrasekwe").name()); + Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("kjgyacwrasekwe").function()); + Assertions.assertEquals(QueryColumnType.DIMENSION, response.dataSet().grouping().get(0).type()); + Assertions.assertEquals("l", response.dataSet().grouping().get(0).name()); + Assertions.assertEquals("atdavuqmcbyms", response.dataSet().sorting().get(0).name()); + Assertions.assertEquals("wnnra", response.dataSet().filter().dimensions().name()); Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("yfytpq", response.dataSet().filter().tags().name()); + Assertions.assertEquals("bbfqpspklady", response.dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().tags().operator()); - Assertions.assertEquals(true, response.includeMonetaryCommitment()); + Assertions.assertFalse(response.includeMonetaryCommitment()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetWithResponseMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetWithResponseMockTests.java index 3dbf5bfcd4fa..b588603b0c68 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetWithResponseMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AccumulatedType; @@ -32,44 +32,45 @@ public final class ViewsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"jb\",\"scope\":\"ykfhyqezvqqugdrf\",\"createdOn\":\"2021-07-24T11:55:41Z\",\"modifiedOn\":\"2021-09-19T09:08:43Z\",\"dateRange\":\"reuquowtljvf\",\"currency\":\"reagkhyxvrqt\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"YearToDate\",\"timePeriod\":{\"from\":\"2021-06-12T01:43:34Z\",\"to\":\"2021-05-11T17:13:28Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"epjpfs\",\"ykgsangpszng\"]},\"aggregation\":{\"kvec\":{\"name\":\"g\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ngoadyedmzr\"},{\"type\":\"Dimension\",\"name\":\"foknubnoitp\"},{\"type\":\"TagKey\",\"name\":\"ztrgdgxvcoq\"}],\"sorting\":[{\"name\":\"wugyx\"}],\"filter\":{\"and\":[{},{},{},{}],\"or\":[{},{},{}],\"dimensions\":{\"name\":\"alwvskbu\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"caqt\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":false},\"chart\":\"GroupedColumn\",\"accumulated\":\"false\",\"metric\":\"AHUB\",\"kpis\":[{\"type\":\"Forecast\",\"id\":\"kuejk\",\"enabled\":false},{\"type\":\"Budget\",\"id\":\"jofqcvovjufycs\",\"enabled\":false},{\"type\":\"Forecast\",\"id\":\"yeji\",\"enabled\":true}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"ortudawlpjfel\"},{\"type\":\"TagKey\",\"name\":\"ptcbgqnzmnh\"},{\"type\":\"TagKey\",\"name\":\"alwcjgckbb\"}]},\"eTag\":\"cgzpraoxnyu\",\"id\":\"fa\",\"name\":\"sgftipwc\",\"type\":\"byubhiqdxyurnpn\"}"; + = "{\"properties\":{\"displayName\":\"enygnxcgjtfrnquk\",\"scope\":\"fnslnlrxsmy\",\"createdOn\":\"2021-05-25T06:55:41Z\",\"modifiedOn\":\"2021-07-11T02:01:04Z\",\"dateRange\":\"fmtbgwjdxwn\",\"currency\":\"kurrdreyzjwh\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"WeekToDate\",\"timePeriod\":{\"from\":\"2021-08-19T13:35:08Z\",\"to\":\"2021-08-17T08:32:13Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"zuukykcyqhyqq\"]},\"aggregation\":{\"ey\":{\"name\":\"c\",\"function\":\"Sum\"},\"ewqcfu\":{\"name\":\"tewfopazdazgbsq\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"vozglqjbk\"},{\"type\":\"TagKey\",\"name\":\"zcl\"},{\"type\":\"Dimension\",\"name\":\"zeyowmndcovdwzqa\"}],\"sorting\":[{\"name\":\"a\"},{\"name\":\"hmkvfruwkudrb\"},{\"name\":\"pftxudqyeme\"}],\"filter\":{\"and\":[{},{},{}],\"or\":[{},{}],\"dimensions\":{\"name\":\"cirtn\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"mjauwcgx\",\"operator\":\"Contains\",\"values\":[]}}},\"includeMonetaryCommitment\":true},\"chart\":\"GroupedColumn\",\"accumulated\":\"false\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Forecast\",\"id\":\"wgudasmxu\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"fcocefhpr\",\"enabled\":false}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"raudsvhlcdcul\"},{\"type\":\"Dimension\",\"name\":\"qtmojhvrztnvgy\"},{\"type\":\"Dimension\",\"name\":\"dgrtwmew\"},{\"type\":\"Dimension\",\"name\":\"ykcfazz\"}]},\"eTag\":\"cayer\",\"id\":\"ransyby\",\"name\":\"polwzrghsrlei\",\"type\":\"kfscjfncjwv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - View response = manager.views().getWithResponse("hluqwquls", com.azure.core.util.Context.NONE).getValue(); + View response = manager.views().getWithResponse("kfvvdshxcde", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("cgzpraoxnyu", response.etag()); - Assertions.assertEquals("jb", response.displayName()); - Assertions.assertEquals("ykfhyqezvqqugdrf", response.scope()); - Assertions.assertEquals("reuquowtljvf", response.dateRange()); + Assertions.assertEquals("cayer", response.etag()); + Assertions.assertEquals("enygnxcgjtfrnquk", response.displayName()); + Assertions.assertEquals("fnslnlrxsmy", response.scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T02:01:04Z"), response.modifiedOn()); + Assertions.assertEquals("fmtbgwjdxwn", response.dateRange()); Assertions.assertEquals(ChartType.GROUPED_COLUMN, response.chart()); Assertions.assertEquals(AccumulatedType.FALSE, response.accumulated()); - Assertions.assertEquals(MetricType.AHUB, response.metric()); + Assertions.assertEquals(MetricType.AMORTIZED_COST, response.metric()); Assertions.assertEquals(KpiType.FORECAST, response.kpis().get(0).type()); - Assertions.assertEquals("kuejk", response.kpis().get(0).id()); - Assertions.assertEquals(false, response.kpis().get(0).enabled()); + Assertions.assertEquals("wgudasmxu", response.kpis().get(0).id()); + Assertions.assertTrue(response.kpis().get(0).enabled()); Assertions.assertEquals(PivotType.DIMENSION, response.pivots().get(0).type()); - Assertions.assertEquals("ortudawlpjfel", response.pivots().get(0).name()); + Assertions.assertEquals("raudsvhlcdcul", response.pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, response.typePropertiesType()); - Assertions.assertEquals(ReportTimeframeType.YEAR_TO_DATE, response.timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T01:43:34Z"), response.timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T17:13:28Z"), response.timePeriod().to()); + Assertions.assertEquals(ReportTimeframeType.WEEK_TO_DATE, response.timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T13:35:08Z"), response.timePeriod().from()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-17T08:32:13Z"), response.timePeriod().to()); Assertions.assertEquals(ReportGranularityType.MONTHLY, response.dataSet().granularity()); - Assertions.assertEquals("epjpfs", response.dataSet().configuration().columns().get(0)); - Assertions.assertEquals("g", response.dataSet().aggregation().get("kvec").name()); - Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("kvec").function()); + Assertions.assertEquals("zuukykcyqhyqq", response.dataSet().configuration().columns().get(0)); + Assertions.assertEquals("c", response.dataSet().aggregation().get("ey").name()); + Assertions.assertEquals(FunctionType.SUM, response.dataSet().aggregation().get("ey").function()); Assertions.assertEquals(QueryColumnType.DIMENSION, response.dataSet().grouping().get(0).type()); - Assertions.assertEquals("ngoadyedmzr", response.dataSet().grouping().get(0).name()); - Assertions.assertEquals("wugyx", response.dataSet().sorting().get(0).name()); - Assertions.assertEquals("alwvskbu", response.dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().dimensions().operator()); - Assertions.assertEquals("caqt", response.dataSet().filter().tags().name()); - Assertions.assertEquals(OperatorType.IN, response.dataSet().filter().tags().operator()); - Assertions.assertEquals(false, response.includeMonetaryCommitment()); + Assertions.assertEquals("vozglqjbk", response.dataSet().grouping().get(0).name()); + Assertions.assertEquals("a", response.dataSet().sorting().get(0).name()); + Assertions.assertEquals("cirtn", response.dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().dimensions().operator()); + Assertions.assertEquals("mjauwcgx", response.dataSet().filter().tags().name()); + Assertions.assertEquals(OperatorType.CONTAINS, response.dataSet().filter().tags().operator()); + Assertions.assertTrue(response.includeMonetaryCommitment()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeMockTests.java index 43499cc02f03..f57c4dd43c90 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListByScopeMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AccumulatedType; @@ -33,49 +33,51 @@ public final class ViewsListByScopeMockTests { @Test public void testListByScope() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"c\",\"scope\":\"iqyhgfse\",\"createdOn\":\"2021-11-02T16:29:47Z\",\"modifiedOn\":\"2020-12-25T20:56:32Z\",\"dateRange\":\"sfledyn\",\"currency\":\"pziuwfbzkkdtnh\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-06-09T09:04:15Z\",\"to\":\"2021-04-17T05:36:17Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"afvafh\",\"by\",\"ccbevxrhyzdf\",\"rsofpltdbmairrh\"]},\"aggregation\":{\"qigtuujwouhdaws\":{\"name\":\"nracw\",\"function\":\"Sum\"},\"az\":{\"name\":\"grbjbxsjybvitvqk\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ggmuwdcho\"},{\"type\":\"TagKey\",\"name\":\"nkf\"}],\"sorting\":[{\"name\":\"v\"}],\"filter\":{\"and\":[{},{},{}],\"or\":[{},{},{},{}],\"dimensions\":{\"name\":\"voaiknaqlnuw\",\"operator\":\"In\",\"values\":[]},\"tags\":{\"name\":\"yxl\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":false},\"chart\":\"Line\",\"accumulated\":\"true\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Forecast\",\"id\":\"jtlkexaonwivkcqh\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"lccrmmkyupi\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"fkak\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"myildudxjasc\",\"enabled\":true}],\"pivots\":[{\"type\":\"Dimension\",\"name\":\"dxphlk\"},{\"type\":\"TagKey\",\"name\":\"gzv\"}]},\"eTag\":\"ij\",\"id\":\"kzuqnwsith\",\"name\":\"q\",\"type\":\"ly\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"qtwmlmhjnqtqeahj\",\"scope\":\"vragpokddx\",\"createdOn\":\"2021-10-15T00:36:49Z\",\"modifiedOn\":\"2021-09-25T13:02:37Z\",\"dateRange\":\"guavtptb\",\"currency\":\"wkqyns\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-08-24T08:09:26Z\",\"to\":\"2021-08-12T00:26:23Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"xaexqokmyrljial\",\"bn\",\"brqlpbcjtrpz\",\"yudivbxnhsqeaeo\"]},\"aggregation\":{\"za\":{\"name\":\"lwgdhuruz\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"tmol\"},{\"type\":\"Dimension\",\"name\":\"ywmpinmzvfkneer\"},{\"type\":\"TagKey\",\"name\":\"trknsjulu\"}],\"sorting\":[{\"name\":\"bnhrxlelfjhkeiz\"},{\"name\":\"pihtdmiwjekpt\"},{\"name\":\"caydbjzcqymlcfnz\"},{\"name\":\"mhsurlgwqkpmm\"}],\"filter\":{\"and\":[{},{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"lawiubmomsgvvjhv\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"lohewjjmajnkdflq\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Table\",\"accumulated\":\"true\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"oshohtotrye\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"mexznlwkb\",\"enabled\":true}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"ze\"}]},\"eTag\":\"fgjblcd\",\"id\":\"yfcemftz\",\"name\":\"yykyalu\",\"type\":\"ekdfqnhttwd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.views().listByScope("jxsqwjhqkbiwetp", com.azure.core.util.Context.NONE); + PagedIterable response = manager.views().listByScope("jcmrnkfm", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ij", response.iterator().next().etag()); - Assertions.assertEquals("c", response.iterator().next().displayName()); - Assertions.assertEquals("iqyhgfse", response.iterator().next().scope()); - Assertions.assertEquals("sfledyn", response.iterator().next().dateRange()); - Assertions.assertEquals(ChartType.LINE, response.iterator().next().chart()); + Assertions.assertEquals("fgjblcd", response.iterator().next().etag()); + Assertions.assertEquals("qtwmlmhjnqtqeahj", response.iterator().next().displayName()); + Assertions.assertEquals("vragpokddx", response.iterator().next().scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T13:02:37Z"), response.iterator().next().modifiedOn()); + Assertions.assertEquals("guavtptb", response.iterator().next().dateRange()); + Assertions.assertEquals(ChartType.TABLE, response.iterator().next().chart()); Assertions.assertEquals(AccumulatedType.TRUE, response.iterator().next().accumulated()); Assertions.assertEquals(MetricType.AMORTIZED_COST, response.iterator().next().metric()); - Assertions.assertEquals(KpiType.FORECAST, response.iterator().next().kpis().get(0).type()); - Assertions.assertEquals("jtlkexaonwivkcqh", response.iterator().next().kpis().get(0).id()); - Assertions.assertEquals(true, response.iterator().next().kpis().get(0).enabled()); - Assertions.assertEquals(PivotType.DIMENSION, response.iterator().next().pivots().get(0).type()); - Assertions.assertEquals("dxphlk", response.iterator().next().pivots().get(0).name()); + Assertions.assertEquals(KpiType.BUDGET, response.iterator().next().kpis().get(0).type()); + Assertions.assertEquals("oshohtotrye", response.iterator().next().kpis().get(0).id()); + Assertions.assertTrue(response.iterator().next().kpis().get(0).enabled()); + Assertions.assertEquals(PivotType.TAG_KEY, response.iterator().next().pivots().get(0).type()); + Assertions.assertEquals("ze", response.iterator().next().pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, response.iterator().next().typePropertiesType()); - Assertions.assertEquals(ReportTimeframeType.MONTH_TO_DATE, response.iterator().next().timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T09:04:15Z"), + Assertions.assertEquals(ReportTimeframeType.CUSTOM, response.iterator().next().timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T08:09:26Z"), response.iterator().next().timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T05:36:17Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T00:26:23Z"), response.iterator().next().timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, response.iterator().next().dataSet().granularity()); - Assertions.assertEquals("afvafh", response.iterator().next().dataSet().configuration().columns().get(0)); - Assertions.assertEquals("nracw", - response.iterator().next().dataSet().aggregation().get("qigtuujwouhdaws").name()); + Assertions.assertEquals(ReportGranularityType.DAILY, response.iterator().next().dataSet().granularity()); + Assertions.assertEquals("xaexqokmyrljial", + response.iterator().next().dataSet().configuration().columns().get(0)); + Assertions.assertEquals("lwgdhuruz", response.iterator().next().dataSet().aggregation().get("za").name()); Assertions.assertEquals(FunctionType.SUM, - response.iterator().next().dataSet().aggregation().get("qigtuujwouhdaws").function()); + response.iterator().next().dataSet().aggregation().get("za").function()); Assertions.assertEquals(QueryColumnType.DIMENSION, response.iterator().next().dataSet().grouping().get(0).type()); - Assertions.assertEquals("ggmuwdcho", response.iterator().next().dataSet().grouping().get(0).name()); - Assertions.assertEquals("v", response.iterator().next().dataSet().sorting().get(0).name()); - Assertions.assertEquals("voaiknaqlnuw", response.iterator().next().dataSet().filter().dimensions().name()); - Assertions.assertEquals(OperatorType.IN, response.iterator().next().dataSet().filter().dimensions().operator()); - Assertions.assertEquals("yxl", response.iterator().next().dataSet().filter().tags().name()); + Assertions.assertEquals("tmol", response.iterator().next().dataSet().grouping().get(0).name()); + Assertions.assertEquals("bnhrxlelfjhkeiz", response.iterator().next().dataSet().sorting().get(0).name()); + Assertions.assertEquals("lawiubmomsgvvjhv", response.iterator().next().dataSet().filter().dimensions().name()); + Assertions.assertEquals(OperatorType.CONTAINS, + response.iterator().next().dataSet().filter().dimensions().operator()); + Assertions.assertEquals("lohewjjmajnkdflq", response.iterator().next().dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.IN, response.iterator().next().dataSet().filter().tags().operator()); - Assertions.assertEquals(false, response.iterator().next().includeMonetaryCommitment()); + Assertions.assertTrue(response.iterator().next().includeMonetaryCommitment()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListMockTests.java b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListMockTests.java index 93517e92be6f..36b02ea4a5ac 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListMockTests.java +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/src/test/java/com/azure/resourcemanager/costmanagement/generated/ViewsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.costmanagement.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.costmanagement.CostManagementManager; import com.azure.resourcemanager.costmanagement.models.AccumulatedType; @@ -33,49 +33,50 @@ public final class ViewsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"rryveimipskdy\",\"scope\":\"tv\",\"createdOn\":\"2021-09-22T17:23:18Z\",\"modifiedOn\":\"2021-10-28T14:29:34Z\",\"dateRange\":\"tjvv\",\"currency\":\"xwigsye\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"timePeriod\":{\"from\":\"2021-08-13T07:56:44Z\",\"to\":\"2021-03-14T18:33:51Z\"},\"dataSet\":{\"granularity\":\"Monthly\",\"configuration\":{\"columns\":[\"kkileplkc\",\"mknhwtbbaedor\",\"vmq\",\"loyg\"]},\"aggregation\":{\"dhp\":{\"name\":\"wumgx\",\"function\":\"Sum\"},\"jddvjsaqw\":{\"name\":\"bgd\",\"function\":\"Sum\"},\"llcolsrsxapte\":{\"name\":\"tm\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"cgjokjljnhvlq\"},{\"type\":\"Dimension\",\"name\":\"ek\"},{\"type\":\"Dimension\",\"name\":\"eksnbksdqhjvyk\"},{\"type\":\"Dimension\",\"name\":\"eslk\"}],\"sorting\":[{\"name\":\"stcpoqmavnwqjw\"},{\"name\":\"o\"}],\"filter\":{\"and\":[{},{},{}],\"or\":[{}],\"dimensions\":{\"name\":\"kxybwfdbkj\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"ensvkzykjtj\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":false},\"chart\":\"GroupedColumn\",\"accumulated\":\"false\",\"metric\":\"ActualCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"nq\",\"enabled\":true},{\"type\":\"Forecast\",\"id\":\"pkuwxeoioj\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"zwfbcyaykmmfzs\"}]},\"eTag\":\"wxrzxmdewsrsxkrp\",\"id\":\"bjazejwwviy\",\"name\":\"y\",\"type\":\"suhbrnn\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"tbxxniuisd\",\"scope\":\"gbdgzp\",\"createdOn\":\"2021-07-05T12:03:18Z\",\"modifiedOn\":\"2021-09-13T08:33:56Z\",\"dateRange\":\"adbuwqrgxfllmqiy\",\"currency\":\"zoellnkkiiwvmtum\",\"query\":{\"type\":\"Usage\",\"timeframe\":\"Custom\",\"timePeriod\":{\"from\":\"2021-12-05T14:16:47Z\",\"to\":\"2021-02-13T02:19:45Z\"},\"dataSet\":{\"granularity\":\"Daily\",\"configuration\":{\"columns\":[\"vqpilrguncanldu\",\"zorxsb\"]},\"aggregation\":{\"ymxkqvfqepdx\":{\"name\":\"qk\",\"function\":\"Sum\"},\"pjbowcpj\":{\"name\":\"ltuubw\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"TagKey\",\"name\":\"gixexkydfbwlj\"},{\"type\":\"Dimension\",\"name\":\"huerkjddvrglie\"}],\"sorting\":[{\"name\":\"cvbiiftksdw\"},{\"name\":\"dnkefgm\"},{\"name\":\"dhcebuv\"}],\"filter\":{\"and\":[{}],\"or\":[{}],\"dimensions\":{\"name\":\"zoutb\",\"operator\":\"Contains\",\"values\":[]},\"tags\":{\"name\":\"gzekajclyzgsno\",\"operator\":\"In\",\"values\":[]}}},\"includeMonetaryCommitment\":true},\"chart\":\"Area\",\"accumulated\":\"false\",\"metric\":\"AmortizedCost\",\"kpis\":[{\"type\":\"Budget\",\"id\":\"hlobvvjbhv\",\"enabled\":false},{\"type\":\"Budget\",\"id\":\"fluiyuosnuud\",\"enabled\":true},{\"type\":\"Budget\",\"id\":\"ibdrqrswhbuubpyr\",\"enabled\":false}],\"pivots\":[{\"type\":\"TagKey\",\"name\":\"fwfqchvcze\"},{\"type\":\"TagKey\",\"name\":\"cta\"},{\"type\":\"Dimension\",\"name\":\"rtpqpemhz\"}]},\"eTag\":\"krepdqhqyhwqwem\",\"id\":\"qabckmzeoxin\",\"name\":\"greohtwhlpuzjp\",\"type\":\"eezn\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); CostManagementManager manager = CostManagementManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.views().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("wxrzxmdewsrsxkrp", response.iterator().next().etag()); - Assertions.assertEquals("rryveimipskdy", response.iterator().next().displayName()); - Assertions.assertEquals("tv", response.iterator().next().scope()); - Assertions.assertEquals("tjvv", response.iterator().next().dateRange()); - Assertions.assertEquals(ChartType.GROUPED_COLUMN, response.iterator().next().chart()); + Assertions.assertEquals("krepdqhqyhwqwem", response.iterator().next().etag()); + Assertions.assertEquals("tbxxniuisd", response.iterator().next().displayName()); + Assertions.assertEquals("gbdgzp", response.iterator().next().scope()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T08:33:56Z"), response.iterator().next().modifiedOn()); + Assertions.assertEquals("adbuwqrgxfllmqiy", response.iterator().next().dateRange()); + Assertions.assertEquals(ChartType.AREA, response.iterator().next().chart()); Assertions.assertEquals(AccumulatedType.FALSE, response.iterator().next().accumulated()); - Assertions.assertEquals(MetricType.ACTUAL_COST, response.iterator().next().metric()); + Assertions.assertEquals(MetricType.AMORTIZED_COST, response.iterator().next().metric()); Assertions.assertEquals(KpiType.BUDGET, response.iterator().next().kpis().get(0).type()); - Assertions.assertEquals("nq", response.iterator().next().kpis().get(0).id()); - Assertions.assertEquals(true, response.iterator().next().kpis().get(0).enabled()); + Assertions.assertEquals("hlobvvjbhv", response.iterator().next().kpis().get(0).id()); + Assertions.assertFalse(response.iterator().next().kpis().get(0).enabled()); Assertions.assertEquals(PivotType.TAG_KEY, response.iterator().next().pivots().get(0).type()); - Assertions.assertEquals("zwfbcyaykmmfzs", response.iterator().next().pivots().get(0).name()); + Assertions.assertEquals("fwfqchvcze", response.iterator().next().pivots().get(0).name()); Assertions.assertEquals(ReportType.USAGE, response.iterator().next().typePropertiesType()); - Assertions.assertEquals(ReportTimeframeType.MONTH_TO_DATE, response.iterator().next().timeframe()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T07:56:44Z"), + Assertions.assertEquals(ReportTimeframeType.CUSTOM, response.iterator().next().timeframe()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-05T14:16:47Z"), response.iterator().next().timePeriod().from()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T18:33:51Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T02:19:45Z"), response.iterator().next().timePeriod().to()); - Assertions.assertEquals(ReportGranularityType.MONTHLY, response.iterator().next().dataSet().granularity()); - Assertions.assertEquals("kkileplkc", response.iterator().next().dataSet().configuration().columns().get(0)); - Assertions.assertEquals("wumgx", response.iterator().next().dataSet().aggregation().get("dhp").name()); + Assertions.assertEquals(ReportGranularityType.DAILY, response.iterator().next().dataSet().granularity()); + Assertions.assertEquals("vqpilrguncanldu", + response.iterator().next().dataSet().configuration().columns().get(0)); + Assertions.assertEquals("qk", response.iterator().next().dataSet().aggregation().get("ymxkqvfqepdx").name()); Assertions.assertEquals(FunctionType.SUM, - response.iterator().next().dataSet().aggregation().get("dhp").function()); - Assertions.assertEquals(QueryColumnType.DIMENSION, - response.iterator().next().dataSet().grouping().get(0).type()); - Assertions.assertEquals("cgjokjljnhvlq", response.iterator().next().dataSet().grouping().get(0).name()); - Assertions.assertEquals("stcpoqmavnwqjw", response.iterator().next().dataSet().sorting().get(0).name()); - Assertions.assertEquals("kxybwfdbkj", response.iterator().next().dataSet().filter().dimensions().name()); + response.iterator().next().dataSet().aggregation().get("ymxkqvfqepdx").function()); + Assertions.assertEquals(QueryColumnType.TAG_KEY, response.iterator().next().dataSet().grouping().get(0).type()); + Assertions.assertEquals("gixexkydfbwlj", response.iterator().next().dataSet().grouping().get(0).name()); + Assertions.assertEquals("cvbiiftksdw", response.iterator().next().dataSet().sorting().get(0).name()); + Assertions.assertEquals("zoutb", response.iterator().next().dataSet().filter().dimensions().name()); Assertions.assertEquals(OperatorType.CONTAINS, response.iterator().next().dataSet().filter().dimensions().operator()); - Assertions.assertEquals("ensvkzykjtj", response.iterator().next().dataSet().filter().tags().name()); + Assertions.assertEquals("gzekajclyzgsno", response.iterator().next().dataSet().filter().tags().name()); Assertions.assertEquals(OperatorType.IN, response.iterator().next().dataSet().filter().tags().operator()); - Assertions.assertEquals(false, response.iterator().next().includeMonetaryCommitment()); + Assertions.assertTrue(response.iterator().next().includeMonetaryCommitment()); } } diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/tsp-location.yaml b/sdk/costmanagement/azure-resourcemanager-costmanagement/tsp-location.yaml new file mode 100644 index 000000000000..2a070c688a46 --- /dev/null +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cost-management/resource-manager/Microsoft.CostManagement/CostManagement +commit: de5af7be7ad092c3cf52862dedd75293ccb70187 +repo: Azure/azure-rest-api-specs +additionalDirectories: